From 0d935ce75e1408dfd9832ae7dbb7d84df50a645d Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Mon, 9 Feb 2009 00:32:59 +0000 Subject: Put the display colours for monochrome and greyscale targets into the target config files, and use them both for the simulator UI and screendumps. The Clip now shows the split display properly in screendumps and simulator. A side effect is that screendumps of ordinary monochrome targets are now 4-bit BMP files (saves an alternate code path, and might be more compatible with some gfx programs). * Simplify the simulation of split display, and also simplify greylib simulation. The simulator now always calculates 129 shades (2*128 for a Clip sim), and just uses 2 (or 4) of those for native display simulation. * Centralised the simulator LCD dimension definition. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19950 a1c6a512-1295-4272-9138-f99709370657 --- uisimulator/sdl/lcd-charcells.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'uisimulator/sdl/lcd-charcells.c') diff --git a/uisimulator/sdl/lcd-charcells.c b/uisimulator/sdl/lcd-charcells.c index 6f09858717..19d27d5152 100644 --- a/uisimulator/sdl/lcd-charcells.c +++ b/uisimulator/sdl/lcd-charcells.c @@ -35,10 +35,19 @@ extern int sim_creat(const char *name); SDL_Surface* lcd_surface; -SDL_Color lcd_color_zero = {UI_LCD_BGCOLOR, 0}; -SDL_Color lcd_backlight_color_zero = {UI_LCD_BGCOLORLIGHT, 0}; -SDL_Color lcd_color_max = {UI_LCD_FGCOLOR, 0}; -SDL_Color lcd_backlight_color_max = {UI_LCD_FGCOLORLIGHT, 0}; + +SDL_Color lcd_bl_color_dark = {RED_CMP(LCD_BL_DARKCOLOR), + GREEN_CMP(LCD_BL_DARKCOLOR), + BLUE_CMP(LCD_BL_DARKCOLOR), 0}; +SDL_Color lcd_bl_color_bright = {RED_CMP(LCD_BL_BRIGHTCOLOR), + GREEN_CMP(LCD_BL_BRIGHTCOLOR), + BLUE_CMP(LCD_BL_BRIGHTCOLOR), 0}; +SDL_Color lcd_color_dark = {RED_CMP(LCD_DARKCOLOR), + GREEN_CMP(LCD_DARKCOLOR), + BLUE_CMP(LCD_DARKCOLOR), 0}; +SDL_Color lcd_color_bright = {RED_CMP(LCD_BRIGHTCOLOR), + GREEN_CMP(LCD_BRIGHTCOLOR), + BLUE_CMP(LCD_BRIGHTCOLOR), 0}; static unsigned long get_lcd_pixel(int x, int y) @@ -78,12 +87,11 @@ void lcd_update(void) void sim_backlight(int value) { if (value > 0) { - sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero, - &lcd_backlight_color_max, - 0, (1<