diff options
Diffstat (limited to 'uisimulator/sdl/lcd-remote-bitmap.c')
-rw-r--r-- | uisimulator/sdl/lcd-remote-bitmap.c | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/uisimulator/sdl/lcd-remote-bitmap.c b/uisimulator/sdl/lcd-remote-bitmap.c index ecb9904a40..c44e476288 100644 --- a/uisimulator/sdl/lcd-remote-bitmap.c +++ b/uisimulator/sdl/lcd-remote-bitmap.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include "lcd-remote-bitmap.h" | 24 | #include "lcd-remote-bitmap.h" |
25 | #include "screendump.h" | 25 | #include "screendump.h" |
26 | 26 | ||
27 | SDL_Surface *remote_surface; | 27 | SDL_Surface *remote_surface = 0; |
28 | 28 | ||
29 | SDL_Color remote_bl_color_dark = {RED_CMP(LCD_REMOTE_BL_DARKCOLOR), | 29 | SDL_Color remote_bl_color_dark = {RED_CMP(LCD_REMOTE_BL_DARKCOLOR), |
30 | GREEN_CMP(LCD_REMOTE_BL_DARKCOLOR), | 30 | GREEN_CMP(LCD_REMOTE_BL_DARKCOLOR), |
@@ -65,27 +65,35 @@ void lcd_remote_update (void) | |||
65 | 65 | ||
66 | void lcd_remote_update_rect(int x_start, int y_start, int width, int height) | 66 | void lcd_remote_update_rect(int x_start, int y_start, int width, int height) |
67 | { | 67 | { |
68 | sdl_update_rect(remote_surface, x_start, y_start, width, height, | 68 | if (remote_surface) |
69 | LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, get_lcd_remote_pixel); | 69 | { |
70 | sdl_gui_update(remote_surface, x_start, y_start, width, height, | 70 | sdl_update_rect(remote_surface, x_start, y_start, width, height, |
71 | LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, background ? UI_REMOTE_POSX : 0, | 71 | LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, get_lcd_remote_pixel); |
72 | background ? UI_REMOTE_POSY : LCD_HEIGHT); | 72 | sdl_gui_update(remote_surface, x_start, y_start, width, height, |
73 | LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, background ? UI_REMOTE_POSX : 0, | ||
74 | background ? UI_REMOTE_POSY : LCD_HEIGHT); | ||
75 | } | ||
73 | } | 76 | } |
74 | 77 | ||
75 | void sim_remote_backlight(int value) | 78 | void sim_remote_backlight(int value) |
76 | { | 79 | { |
77 | if (value > 0) { | 80 | if (remote_surface) |
78 | sdl_set_gradient(remote_surface, &remote_bl_color_dark, | 81 | { |
79 | &remote_bl_color_bright, 0, NUM_SHADES); | 82 | if (value > 0) |
80 | } else { | 83 | { |
81 | sdl_set_gradient(remote_surface, &remote_color_dark, | 84 | sdl_set_gradient(remote_surface, &remote_bl_color_dark, |
82 | &remote_color_bright, 0, NUM_SHADES); | 85 | &remote_bl_color_bright, 0, NUM_SHADES); |
86 | } | ||
87 | else | ||
88 | { | ||
89 | sdl_set_gradient(remote_surface, &remote_color_dark, | ||
90 | &remote_color_bright, 0, NUM_SHADES); | ||
91 | } | ||
92 | sdl_gui_update(remote_surface, 0, 0, LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, | ||
93 | LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, | ||
94 | background ? UI_REMOTE_POSX : 0, | ||
95 | background? UI_REMOTE_POSY : LCD_HEIGHT); | ||
83 | } | 96 | } |
84 | |||
85 | sdl_gui_update(remote_surface, 0, 0, LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, | ||
86 | LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, | ||
87 | background ? UI_REMOTE_POSX : 0, | ||
88 | background? UI_REMOTE_POSY : LCD_HEIGHT); | ||
89 | } | 97 | } |
90 | 98 | ||
91 | /* initialise simulator lcd remote driver */ | 99 | /* initialise simulator lcd remote driver */ |