summaryrefslogtreecommitdiff
path: root/uisimulator/sdl/lcd-sdl.c
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator/sdl/lcd-sdl.c')
-rw-r--r--uisimulator/sdl/lcd-sdl.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/uisimulator/sdl/lcd-sdl.c b/uisimulator/sdl/lcd-sdl.c
index 80a3c96a87..1a6e8da8e8 100644
--- a/uisimulator/sdl/lcd-sdl.c
+++ b/uisimulator/sdl/lcd-sdl.c
@@ -94,7 +94,11 @@ void lcd_update_rect(int x_start, int y_start, int width, int height)
94 SDL_Rect src = {x_start, y_start, xmax, ymax}; 94 SDL_Rect src = {x_start, y_start, xmax, ymax};
95 SDL_Rect dest = {UI_LCD_POSX + x_start, UI_LCD_POSY + y_start, xmax, ymax}; 95 SDL_Rect dest = {UI_LCD_POSX + x_start, UI_LCD_POSY + y_start, xmax, ymax};
96 96
97 97 if (!background) {
98 dest.x -= UI_LCD_POSX;
99 dest.y -= UI_LCD_POSY;
100 }
101
98 SDL_BlitSurface(lcd_surface, &src, gui_surface, &dest); 102 SDL_BlitSurface(lcd_surface, &src, gui_surface, &dest);
99 SDL_UpdateRect(gui_surface, dest.x, dest.y, dest.w, dest.h); 103 SDL_UpdateRect(gui_surface, dest.x, dest.y, dest.w, dest.h);
100 SDL_Flip(gui_surface); 104 SDL_Flip(gui_surface);
@@ -141,6 +145,12 @@ void lcd_remote_update_rect(int x_start, int y_start,
141 SDL_Rect src = {x_start, y_start, xmax, ymax}; 145 SDL_Rect src = {x_start, y_start, xmax, ymax};
142 SDL_Rect dest = {UI_REMOTE_POSX + x_start, UI_REMOTE_POSY + y_start, xmax, ymax}; 146 SDL_Rect dest = {UI_REMOTE_POSX + x_start, UI_REMOTE_POSY + y_start, xmax, ymax};
143 147
148 if (!background) {
149 dest.x -= UI_REMOTE_POSX;
150 dest.y -= UI_REMOTE_POSY;
151 dest.y += UI_LCD_HEIGHT;
152 }
153
144 SDL_BlitSurface(remote_surface, &src, gui_surface, &dest); 154 SDL_BlitSurface(remote_surface, &src, gui_surface, &dest);
145 SDL_UpdateRect(gui_surface, dest.x, dest.y, dest.w, dest.h); 155 SDL_UpdateRect(gui_surface, dest.x, dest.y, dest.w, dest.h);
146 SDL_Flip(gui_surface); 156 SDL_Flip(gui_surface);
@@ -176,12 +186,19 @@ void lcd_update(void)
176 } 186 }
177 } 187 }
178 } 188 }
189
179 if (changed) 190 if (changed)
180 { 191 {
192 if (!background) {
193 dest.x -= UI_LCD_POSX;
194 dest.y -= UI_LCD_POSY;
195 }
196
181 SDL_BlitSurface(lcd_surface, NULL, gui_surface, &dest); 197 SDL_BlitSurface(lcd_surface, NULL, gui_surface, &dest);
182 SDL_UpdateRect(gui_surface, dest.x, dest.y, dest.w, dest.h); 198 SDL_UpdateRect(gui_surface, dest.x, dest.y, dest.w, dest.h);
183 SDL_Flip(gui_surface); 199 SDL_Flip(gui_surface);
184 } 200 }
201
185 lcd_display_redraw = false; 202 lcd_display_redraw = false;
186} 203}
187 204