From: kub Date: Wed, 28 Sep 2022 18:46:32 +0000 (+0000) Subject: platform sdl, fix screen clearing if line pitch isn't width X-Git-Tag: v2.00~294 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1ef15a783f37cf260819d9742991ed677f931a4;p=picodrive.git platform sdl, fix screen clearing if line pitch isn't width --- diff --git a/platform/common/plat_sdl.c b/platform/common/plat_sdl.c index cb02919b..79664c3d 100644 --- a/platform/common/plat_sdl.c +++ b/platform/common/plat_sdl.c @@ -191,7 +191,7 @@ void plat_video_flip(void) g_screen_ptr = plat_sdl_screen->pixels; plat_video_set_buffer(g_screen_ptr); if (clear_buf_cnt) { - memset(g_screen_ptr, 0, plat_sdl_screen->w*plat_sdl_screen->h * 2); + memset(g_screen_ptr, 0, plat_sdl_screen->pitch*plat_sdl_screen->h); clear_buf_cnt--; } } @@ -225,7 +225,7 @@ void plat_video_clear_buffers(void) if (plat_sdl_overlay || plat_sdl_gl_active) memset(shadow_fb, 0, g_menuscreen_w * g_menuscreen_h * 2); else { - memset(g_screen_ptr, 0, plat_sdl_screen->w*plat_sdl_screen->h * 2); + memset(g_screen_ptr, 0, plat_sdl_screen->pitch*plat_sdl_screen->h); clear_buf_cnt = 3; // do it thrice in case of triple buffering } }