From: kub Date: Wed, 26 Feb 2025 22:41:54 +0000 (+0100) Subject: platform sdl, add fullscreen mode X-Git-Tag: v2.04~39 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a51177a4def8ab7cf8d3cd6a36cfd96179be404d;p=picodrive.git platform sdl, add fullscreen mode --- diff --git a/platform/common/plat_sdl.c b/platform/common/plat_sdl.c index bdef051a..5a484fc1 100644 --- a/platform/common/plat_sdl.c +++ b/platform/common/plat_sdl.c @@ -300,7 +300,7 @@ void plat_video_flip(void) if ((plat_sdl_screen->w != g_menuscreen_w || plat_sdl_screen->h != g_menuscreen_h) && plat_sdl_is_windowed() && SDL_WM_GrabInput(SDL_GRAB_ON) == SDL_GRAB_ON) { - plat_sdl_change_video_mode(g_menuscreen_w, g_menuscreen_h, 1); + plat_sdl_change_video_mode(g_menuscreen_w, g_menuscreen_h, -1); SDL_WM_GrabInput(SDL_GRAB_OFF); g_menuscreen_pp = plat_sdl_screen->pitch/2; @@ -367,7 +367,7 @@ void plat_video_menu_update(void) int w, h; do { w = g_menuscreen_w, h = g_menuscreen_h; - plat_sdl_change_video_mode(w, h, 1); + plat_sdl_change_video_mode(w, h, -1); } while (w != g_menuscreen_w || h != g_menuscreen_h); SDL_WM_GrabInput(SDL_GRAB_OFF); } diff --git a/platform/libpicofe b/platform/libpicofe index 7bd23aaf..9e049f36 160000 --- a/platform/libpicofe +++ b/platform/libpicofe @@ -1 +1 @@ -Subproject commit 7bd23aaf69e6caf8f6d8933bd9b2f4db3210eb51 +Subproject commit 9e049f3601bd101f41016df47d2568b781b50f8e diff --git a/platform/linux/menu.c b/platform/linux/menu.c index a039cc85..f7007cc4 100644 --- a/platform/linux/menu.c +++ b/platform/linux/menu.c @@ -12,22 +12,26 @@ static const char *mgn_windowsize(int id, int *offs) { int scale = g_menuscreen_w / 320; - if (g_menuscreen_w == scale*320 && g_menuscreen_h == scale*240) - sprintf(static_buff, "%dx%d", scale*320, scale*240); - else sprintf(static_buff, "custom"); + if ((g_menuscreen_w == scale*320 && g_menuscreen_h == scale*240) || + plat_sdl_is_fullscreen()) + sprintf(static_buff, "%dx%d", g_menuscreen_w, g_menuscreen_h); + else + sprintf(static_buff, "custom"); return static_buff; } static int mh_windowsize(int id, int keys) { - if (keys & (PBTN_LEFT|PBTN_RIGHT)) { // multi choice - int scale = g_menuscreen_w / 320; - if (keys & PBTN_RIGHT) scale++; - if (keys & PBTN_LEFT ) scale--; - if (scale <= 0) scale = 1; - if (scale > 20) scale = 20; - g_menuscreen_w = scale*320; - g_menuscreen_h = scale*240; + if (keys & (PBTN_LEFT|PBTN_RIGHT)) { + if (!plat_target.vout_fullscreen) { + int scale = g_menuscreen_w / 320; + if (keys & PBTN_RIGHT) scale++; + if (keys & PBTN_LEFT ) scale--; + if (scale <= 0) scale = 1; + if (scale > 20) scale = 20; + g_menuscreen_w = scale*320; + g_menuscreen_h = scale*240; + } return 0; } return 1; @@ -35,6 +39,7 @@ static int mh_windowsize(int id, int keys) #define MENU_OPTIONS_GFX \ mee_cust_s_h ("Window size", MA_OPT_VOUT_SIZE, 0,mh_windowsize, mgn_windowsize, NULL), \ + mee_onoff ("Fullscreen mode", MA_OPT_VOUT_FULL, plat_target.vout_fullscreen, 1), \ mee_enum_h ("Horizontal scaling", MA_OPT_SCALING, currentConfig.scaling, men_scaling_opts, h_scale), \ mee_enum_h ("Vertical scaling", MA_OPT_VSCALING, currentConfig.vscaling, men_scaling_opts, h_scale), \ mee_enum_h ("Scaler type", MA_OPT3_FILTERING, currentConfig.filter, men_filter_opts, h_stype), \