diff options
Diffstat (limited to 'uisimulator/sdl/lcd-bitmap.c')
-rw-r--r-- | uisimulator/sdl/lcd-bitmap.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/uisimulator/sdl/lcd-bitmap.c b/uisimulator/sdl/lcd-bitmap.c index db4a98d823..2fd7576ecc 100644 --- a/uisimulator/sdl/lcd-bitmap.c +++ b/uisimulator/sdl/lcd-bitmap.c | |||
@@ -17,13 +17,15 @@ | |||
17 | * | 17 | * |
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | 19 | ||
20 | #include "debug.h" | ||
20 | #include "uisdl.h" | 21 | #include "uisdl.h" |
21 | #include "lcd-sdl.h" | 22 | #include "lcd-sdl.h" |
22 | 23 | ||
23 | SDL_Surface* lcd_surface; | 24 | SDL_Surface* lcd_surface; |
24 | 25 | ||
25 | #if LCD_DEPTH <= 8 | 26 | #if LCD_DEPTH <= 8 |
26 | SDL_Color lcd_color_zero = {UI_LCD_BGCOLORLIGHT, 0}; | 27 | SDL_Color lcd_color_zero = {UI_LCD_BGCOLOR, 0}; |
28 | SDL_Color lcd_backlight_color_zero = {UI_LCD_BGCOLORLIGHT, 0}; | ||
27 | SDL_Color lcd_color_max = {0, 0, 0, 0}; | 29 | SDL_Color lcd_color_max = {0, 0, 0, 0}; |
28 | #endif | 30 | #endif |
29 | 31 | ||
@@ -60,6 +62,22 @@ void lcd_update_rect(int x_start, int y_start, int width, int height) | |||
60 | get_lcd_pixel); | 62 | get_lcd_pixel); |
61 | } | 63 | } |
62 | 64 | ||
65 | #ifdef CONFIG_BACKLIGHT | ||
66 | void sim_backlight(int value) | ||
67 | { | ||
68 | #if LCD_DEPTH <= 8 | ||
69 | if (value > 0) { | ||
70 | sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero, &lcd_color_max, (1<<LCD_DEPTH)); | ||
71 | } else { | ||
72 | sdl_set_gradient(lcd_surface, &lcd_color_zero, &lcd_color_max, (1<<LCD_DEPTH)); | ||
73 | } | ||
74 | |||
75 | lcd_update(); | ||
76 | #else | ||
77 | DEBUGF("backlight: %s\n", (value > 0) ? "on" : "off"); | ||
78 | #endif | ||
79 | } | ||
80 | #endif | ||
63 | 81 | ||
64 | /* initialise simulator lcd driver */ | 82 | /* initialise simulator lcd driver */ |
65 | void sim_lcd_init(void) | 83 | void sim_lcd_init(void) |