summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2009-02-09 23:34:44 +0000
committerJens Arnold <amiconn@rockbox.org>2009-02-09 23:34:44 +0000
commit309a3c4590ea0ed3cf028cfc7f1372ca019fe638 (patch)
tree1f0828d5876f280686ba83bcd2589d9b9f808cda /uisimulator
parenta12c2d59ade3f8d4c1edb56ad4812836766df95b (diff)
downloadrockbox-309a3c4590ea0ed3cf028cfc7f1372ca019fe638.tar.gz
rockbox-309a3c4590ea0ed3cf028cfc7f1372ca019fe638.tar.bz2
rockbox-309a3c4590ea0ed3cf028cfc7f1372ca019fe638.zip
More compact screendump routines for core and greylib. The core routine might be a little slower for vertically packed mono and greyscale displays, the greylib one should be faster in all cases. * Reduce stack usage of greyscale screendump on the Clip* Rename a macro in the bitmap LCD simulation.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19959 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/sdl/lcd-bitmap.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/uisimulator/sdl/lcd-bitmap.c b/uisimulator/sdl/lcd-bitmap.c
index 1d720b80a1..b4e6dcd4c0 100644
--- a/uisimulator/sdl/lcd-bitmap.c
+++ b/uisimulator/sdl/lcd-bitmap.c
@@ -59,9 +59,9 @@ SDL_Color lcd_color2_bright = {RED_CMP(LCD_BRIGHTCOLOR_2),
#endif
#ifdef HAVE_LCD_SPLIT
-#define GRADIENT_MAX 127
+#define NUM_SHADES 128
#else
-#define GRADIENT_MAX 128
+#define NUM_SHADES 129
#endif
#endif /* LCD_DEPTH <= 8 */
@@ -78,9 +78,9 @@ static unsigned long get_lcd_pixel(int x, int y)
{
#if LCD_DEPTH == 1
#ifdef HAVE_NEGATIVE_LCD
- return (lcd_framebuffer[y/8][x] & (1 << (y & 7))) ? GRADIENT_MAX : 0;
+ return (lcd_framebuffer[y/8][x] & (1 << (y & 7))) ? (NUM_SHADES-1) : 0;
#else
- return (lcd_framebuffer[y/8][x] & (1 << (y & 7))) ? 0 : GRADIENT_MAX;
+ return (lcd_framebuffer[y/8][x] & (1 << (y & 7))) ? 0 : (NUM_SHADES-1);
#endif
#elif LCD_DEPTH == 2
#if LCD_PIXELFORMAT == HORIZONTAL_PACKING
@@ -122,17 +122,17 @@ void sim_backlight(int value)
#if LCD_DEPTH <= 8
if (value > 0) {
sdl_set_gradient(lcd_surface, &lcd_bl_color_dark,
- &lcd_bl_color_bright, 0, GRADIENT_MAX+1);
+ &lcd_bl_color_bright, 0, NUM_SHADES);
#ifdef HAVE_LCD_SPLIT
sdl_set_gradient(lcd_surface, &lcd_bl_color2_dark,
- &lcd_bl_color2_bright, GRADIENT_MAX+1, GRADIENT_MAX+1);
+ &lcd_bl_color2_bright, NUM_SHADES, NUM_SHADES);
#endif
} else {
sdl_set_gradient(lcd_surface, &lcd_color_dark,
- &lcd_color_bright, 0, GRADIENT_MAX+1);
+ &lcd_color_bright, 0, NUM_SHADES);
#ifdef HAVE_LCD_SPLIT
sdl_set_gradient(lcd_surface, &lcd_color2_dark,
- &lcd_color2_bright, GRADIENT_MAX+1, GRADIENT_MAX+1);
+ &lcd_color2_bright, NUM_SHADES, NUM_SHADES);
#endif
}
sdl_gui_update(lcd_surface, 0, 0, SIM_LCD_WIDTH, SIM_LCD_HEIGHT,
@@ -162,17 +162,17 @@ void sim_lcd_init(void)
#if LCD_DEPTH <= 8
#ifdef HAVE_BACKLIGHT
sdl_set_gradient(lcd_surface, &lcd_bl_color_dark,
- &lcd_bl_color_bright, 0, GRADIENT_MAX+1);
+ &lcd_bl_color_bright, 0, NUM_SHADES);
#ifdef HAVE_LCD_SPLIT
sdl_set_gradient(lcd_surface, &lcd_bl_color2_dark,
- &lcd_bl_color2_bright, GRADIENT_MAX+1, GRADIENT_MAX+1);
+ &lcd_bl_color2_bright, NUM_SHADES, NUM_SHADES);
#endif
#else /* !HAVE_BACKLIGHT */
sdl_set_gradient(lcd_surface, &lcd_color_dark,
- &lcd_color_bright, 0, GRADIENT_MAX+1);
+ &lcd_color_bright, 0, NUM_SHADES);
#ifdef HAVE_LCD_SPLIT
sdl_set_gradient(lcd_surface, &lcd_color2_dark,
- &lcd_color2_bright, GRADIENT_MAX+1, GRADIENT_MAX+1);
+ &lcd_color2_bright, NUM_SHADES, NUM_SHADES);
#endif
#endif /* !HAVE_BACKLIGHT */
#endif /* LCD_DEPTH < 8 */