From 5cda26f9fb02b2114f32e6cd743d41e16f7a30a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C3=ABl=20Carr=C3=A9?= Date: Sat, 30 Jan 2010 08:39:02 +0000 Subject: [PATCH] backport r24377 and r24378 mandelbrot color fixes for greyscale targets git-svn-id: svn://svn.rockbox.org/rockbox/branches/v3_5@24379 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/fractals/mandelbrot_set.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/plugins/fractals/mandelbrot_set.c b/apps/plugins/fractals/mandelbrot_set.c index fbd527438e..18fc746cfa 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 ^ 7) << 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)