summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-01-30 07:16:16 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-01-30 07:16:16 +0000
commit82fafb2d555bc4a282f04fa6fe42b0294b8c4341 (patch)
treead362e047a028053387b3dc52ef5407c685cb75a /apps/plugins
parent436f4d3a204e8183d32d8c47975e6a294be1c0fa (diff)
mandelbrot: use correct colors on greyscale targets (FS#10935)
Tested on Clipv1 (sim/target) and Ipod3g (sim) Each color would be calculated as 0 Note the iteration over the whole range of colors is quite weird, and I can not really sense what max_iter represents (except it's a number of different colors, right?) It should be backported to branch after tomers check if color range is correct (FS#10935 mentions much smaller range for color targets as well) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24377 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/fractals/mandelbrot_set.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/plugins/fractals/mandelbrot_set.c b/apps/plugins/fractals/mandelbrot_set.c
index fbd527438e..ad5a172f33 100644
--- a/apps/plugins/fractals/mandelbrot_set.c
+++ b/apps/plugins/fractals/mandelbrot_set.c
@@ -31,14 +31,16 @@ static unsigned char imgbuffer[LCD_HEIGHT];
static fb_data imgbuffer[LCD_HEIGHT];
#endif
-#define NUM_COLORS ((unsigned)(1 << LCD_DEPTH))
-
+#ifdef USEGSLIB
+#define LCOLOR(iter) (iter << 5)
+#else
/*
* Spread iter's colors over color range.
* 345 (=15*26-45) is max_iter maximal value
* This implementation ignores pixel format, thus it is not uniformly spread
*/
-#define LCOLOR(iter) ((iter * NUM_COLORS) / 345)
+#define LCOLOR(iter) ((iter << LCD_DEPTH) / 345)
+#endif
#ifdef HAVE_LCD_COLOR
#define COLOR(iter) (fb_data)LCOLOR(iter)