diff options
author | Marcin Bukat <marcin.bukat@gmail.com> | 2018-06-20 21:57:34 +0200 |
---|---|---|
committer | Marcin Bukat <marcin.bukat@gmail.com> | 2018-06-20 21:57:34 +0200 |
commit | 708a54d3de31ef76f524baeb0f5c2697589e93d7 (patch) | |
tree | e511c49d18284c76eb8340eaf7ec92d2bb3f9470 /apps/plugins/fractals/mandelbrot_set.c | |
parent | 28cfeed4c1a07262ac9d0abc4e9263f10971633a (diff) | |
download | rockbox-708a54d3de31ef76f524baeb0f5c2697589e93d7.tar.gz rockbox-708a54d3de31ef76f524baeb0f5c2697589e93d7.zip |
Fix yellow for LCD_DEPTH == 32
Change-Id: I59e9ec8720555c17e882a3a8c7ed0ba281b8d7c7
Diffstat (limited to 'apps/plugins/fractals/mandelbrot_set.c')
-rw-r--r-- | apps/plugins/fractals/mandelbrot_set.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/plugins/fractals/mandelbrot_set.c b/apps/plugins/fractals/mandelbrot_set.c index 583095913f..69485d405a 100644 --- a/apps/plugins/fractals/mandelbrot_set.c +++ b/apps/plugins/fractals/mandelbrot_set.c | |||
@@ -39,8 +39,15 @@ static fb_data imgbuffer[LCD_HEIGHT]; | |||
39 | * 345 (=15*26-45) is max_iter maximal value | 39 | * 345 (=15*26-45) is max_iter maximal value |
40 | * This implementation ignores pixel format, thus it is not uniformly spread | 40 | * This implementation ignores pixel format, thus it is not uniformly spread |
41 | */ | 41 | */ |
42 | #if LCD_DEPTH > 24 | ||
43 | /* when LCD_DEPTH is 32 casting to 64bit intermediate is needed to prevent | ||
44 | * overflow and warning 'left shift count >= width of type' | ||
45 | */ | ||
46 | #define LCOLOR(iter) ((unsigned int)(((unsigned long long)iter << LCD_DEPTH) / 345)) | ||
47 | #else | ||
42 | #define LCOLOR(iter) ((iter << LCD_DEPTH) / 345) | 48 | #define LCOLOR(iter) ((iter << LCD_DEPTH) / 345) |
43 | #endif | 49 | #endif |
50 | #endif | ||
44 | 51 | ||
45 | #ifdef HAVE_LCD_COLOR | 52 | #ifdef HAVE_LCD_COLOR |
46 | #define COLOR(iter) FB_SCALARPACK(LCOLOR(iter)) | 53 | #define COLOR(iter) FB_SCALARPACK(LCOLOR(iter)) |