From: kub Date: Sat, 18 Feb 2023 17:28:05 +0000 (+0000) Subject: platform sdl, fix minor bug in window size handling X-Git-Tag: v2.00~254 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c989b8fec1092a4af0b02cab0b48208dab18258c;p=picodrive.git platform sdl, fix minor bug in window size handling --- diff --git a/platform/common/plat_sdl.c b/platform/common/plat_sdl.c index de4b0549..705d4769 100644 --- a/platform/common/plat_sdl.c +++ b/platform/common/plat_sdl.c @@ -142,10 +142,11 @@ static void resize_buffers(void) void plat_video_set_size(int w, int h) { if (area.w != w || area.h != h) { + area = (struct area) { w, h }; if (plat_sdl_change_video_mode(w, h, 0) < 0) { // failed, revert to original resolution + area = (struct area) { g_screen_width,g_screen_height }; plat_sdl_change_video_mode(g_screen_width, g_screen_height, 0); - w = g_screen_width, h = g_screen_height; } if (!plat_sdl_overlay && !plat_sdl_gl_active) { g_screen_width = plat_sdl_screen->w; @@ -157,7 +158,6 @@ void plat_video_set_size(int w, int h) g_screen_height = h; g_screen_ppitch = w; } - area = (struct area) { w, h }; } } @@ -389,7 +389,7 @@ void plat_init(void) #if defined(__RG99__) // do not use the default resolution - plat_video_set_size(320, 240); + plat_sdl_change_video_mode(320, 240, 1); #endif bgr_to_uyvy_init();