summaryrefslogtreecommitdiffstats
path: root/apps/plugins
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2019-07-25 14:26:45 -0400
committerFranklin Wei <git@fwei.tk>2019-07-25 14:27:17 -0400
commitcdfb7d44f2c698a6c3dcfcbd4bdccf066ccfaf8a (patch)
treeb4e06ab1907fd9fe829704e71846b9a5e13ad6c0 /apps/plugins
parent6e32e06498782f98db57bbb05baa6fc4ba3d76be (diff)
downloadrockbox-cdfb7d44f2c698a6c3dcfcbd4bdccf066ccfaf8a.tar.gz
rockbox-cdfb7d44f2c698a6c3dcfcbd4bdccf066ccfaf8a.zip
sdl: fix video regression introduced by 5d05b9d
The quake commit tried to optimize lcd updates but inadvertently broke wolf3d (which always uses a 320x200 screen size). This fixes that and also lets direct mode truly exit early to hopefully save some cycles. Change-Id: I41d96cd584257fe25e791c7f615812849f348e4f
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/sdl/src/video/rockbox/SDL_rockboxvideo.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/apps/plugins/sdl/src/video/rockbox/SDL_rockboxvideo.c b/apps/plugins/sdl/src/video/rockbox/SDL_rockboxvideo.c
index 3a12d984b8..9d11ae2acc 100644
--- a/apps/plugins/sdl/src/video/rockbox/SDL_rockboxvideo.c
+++ b/apps/plugins/sdl/src/video/rockbox/SDL_rockboxvideo.c
@@ -687,21 +687,21 @@ static void blit_rotated(fb_data *src, int x, int y, int w, int h)
rb->lcd_framebuffer[x_0 * LCD_WIDTH + y_0] = src[(LCD_WIDTH - y_0) * LCD_HEIGHT + x_0];
}
-//static fb_data tmp_fb[LCD_WIDTH * LCD_HEIGHT];
-
static void ROCKBOX_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
{
+ /* Direct mode writes directly to lcd_framebuffer. Update and
+ * exit! */
+ if(this->hidden->direct)
+ {
+ rb->lcd_update();
+ return;
+ }
+
if(this->screen->pixels)
{
for(int i = 0; i < numrects; ++i)
{
- /* no scaling */
- if(this->hidden->direct)
- {
- /* no-op */
- }
- /* screen is rotated */
- else if(this->hidden->rotate)
+ if(this->hidden->rotate)
{
LOGF("rotated copy");
blit_rotated(this->screen->pixels, rects[i].x, rects[i].y, rects[i].w, rects[i].h);
@@ -769,9 +769,13 @@ static void ROCKBOX_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
/* FIXME: this won't work for rotated screen or overlapping rects */
flip_pixels(rects[i].x, rects[i].y, rects[i].w, rects[i].h);
#endif
- rb->lcd_update_rect(rects[i].x, rects[i].y, rects[i].w, rects[i].h);
+ /* We are lazy and do not want to figure out the new
+ * rectangle coordinates. See lcd_update() below. */
+ //rb->lcd_update_rect(rects[i].x, rects[i].y, rects[i].w, rects[i].h);
} /* for */
} /* if */
+
+ rb->lcd_update();
}
int ROCKBOX_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)