platform sdl, add fullscreen mode
authorkub <derkub@gmail.com>
Wed, 26 Feb 2025 22:41:54 +0000 (23:41 +0100)
committerkub <derkub@gmail.com>
Wed, 26 Feb 2025 23:21:07 +0000 (00:21 +0100)
platform/common/plat_sdl.c
platform/libpicofe
platform/linux/menu.c

index bdef051..5a484fc 100644 (file)
@@ -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);
        }
index 7bd23aa..9e049f3 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 7bd23aaf69e6caf8f6d8933bd9b2f4db3210eb51
+Subproject commit 9e049f3601bd101f41016df47d2568b781b50f8e
index a039cc8..f7007cc 100644 (file)
@@ -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), \