mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-24 16:01:00 +00:00
Add borderless windowed mode options to menu
git-svn-id: https://svn.eduke32.com/eduke32@8084 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
12eea3740c
commit
11e9baa045
1 changed files with 27 additions and 10 deletions
|
@ -492,7 +492,7 @@ MAKE_MENU_TOP_ENTRYLINK( "Touch Setup", MEF_BigOptionsRtSections, OPTIONS_TOUCHS
|
||||||
MAKE_MENU_TOP_ENTRYLINK("Cheats", MEF_OptionsMenu, OPTIONS_CHEATS, MENU_CHEATS);
|
MAKE_MENU_TOP_ENTRYLINK("Cheats", MEF_OptionsMenu, OPTIONS_CHEATS, MENU_CHEATS);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int32_t newresolution, newrendermode, newfullscreen, newvsync;
|
static int32_t newresolution, newrendermode, newfullscreen, newvsync, newborderless;
|
||||||
|
|
||||||
enum resflags_t {
|
enum resflags_t {
|
||||||
RES_FS = 0x1,
|
RES_FS = 0x1,
|
||||||
|
@ -530,9 +530,14 @@ static MenuOption_t MEO_VIDEOSETUP_RENDERER = MAKE_MENUOPTION( &MF_Redfont, &MEO
|
||||||
static MenuEntry_t ME_VIDEOSETUP_RENDERER = MAKE_MENUENTRY( "Renderer:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_RENDERER, Option );
|
static MenuEntry_t ME_VIDEOSETUP_RENDERER = MAKE_MENUENTRY( "Renderer:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_RENDERER, Option );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static MenuOption_t MEO_VIDEOSETUP_FULLSCREEN = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &newfullscreen );
|
static MenuOption_t MEO_VIDEOSETUP_FULLSCREEN = MAKE_MENUOPTION( &MF_Redfont, &MEOS_YesNo, &newfullscreen );
|
||||||
static MenuEntry_t ME_VIDEOSETUP_FULLSCREEN = MAKE_MENUENTRY( "Fullscreen:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_FULLSCREEN, Option );
|
static MenuEntry_t ME_VIDEOSETUP_FULLSCREEN = MAKE_MENUENTRY( "Windowed:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_FULLSCREEN, Option );
|
||||||
|
|
||||||
|
static char const *MEOSN_VIDEOSETUP_BORDERLESS [] = { "No", "Yes", "Auto", };
|
||||||
|
static int32_t MEOSV_VIDEOSETUP_BORDERLESS [] = { 0, 1, 2, };
|
||||||
|
static MenuOptionSet_t MEOS_VIDEOSETUP_BORDERLESS = MAKE_MENUOPTIONSET(MEOSN_VIDEOSETUP_BORDERLESS, MEOSV_VIDEOSETUP_BORDERLESS, 0x2);
|
||||||
|
static MenuOption_t MEO_VIDEOSETUP_BORDERLESS = MAKE_MENUOPTION(&MF_Redfont, &MEOS_VIDEOSETUP_BORDERLESS, &newborderless);
|
||||||
|
static MenuEntry_t ME_VIDEOSETUP_BORDERLESS = MAKE_MENUENTRY("Borderless:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_BORDERLESS, Option);
|
||||||
|
|
||||||
static char const *MEOSN_VIDEOSETUP_VSYNC [] = { "Adaptive", "Off", "On", };
|
static char const *MEOSN_VIDEOSETUP_VSYNC [] = { "Adaptive", "Off", "On", };
|
||||||
static int32_t MEOSV_VIDEOSETUP_VSYNC [] = { -1, 0, 1, };
|
static int32_t MEOSV_VIDEOSETUP_VSYNC [] = { -1, 0, 1, };
|
||||||
|
@ -540,6 +545,8 @@ static MenuOptionSet_t MEOS_VIDEOSETUP_VSYNC = MAKE_MENUOPTIONSET(MEOSN_VIDEOSET
|
||||||
static MenuOption_t MEO_VIDEOSETUP_VSYNC = MAKE_MENUOPTION(&MF_Redfont, &MEOS_VIDEOSETUP_VSYNC, &newvsync);
|
static MenuOption_t MEO_VIDEOSETUP_VSYNC = MAKE_MENUOPTION(&MF_Redfont, &MEOS_VIDEOSETUP_VSYNC, &newvsync);
|
||||||
static MenuEntry_t ME_VIDEOSETUP_VSYNC = MAKE_MENUENTRY("VSync:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_VSYNC, Option);
|
static MenuEntry_t ME_VIDEOSETUP_VSYNC = MAKE_MENUENTRY("VSync:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_VSYNC, Option);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static char const *MEOSN_VIDEOSETUP_FRAMELIMIT [] = { "None", "30 fps", "60 fps", "75 fps", "100 fps", "120 fps", "144 fps", "165 fps", "240 fps" };
|
static char const *MEOSN_VIDEOSETUP_FRAMELIMIT [] = { "None", "30 fps", "60 fps", "75 fps", "100 fps", "120 fps", "144 fps", "165 fps", "240 fps" };
|
||||||
static int32_t MEOSV_VIDEOSETUP_FRAMELIMIT [] = { 0, 30, 60, 75, 100, 120, 144, 165, 240 };
|
static int32_t MEOSV_VIDEOSETUP_FRAMELIMIT [] = { 0, 30, 60, 75, 100, 120, 144, 165, 240 };
|
||||||
static MenuOptionSet_t MEOS_VIDEOSETUP_FRAMELIMIT = MAKE_MENUOPTIONSET(MEOSN_VIDEOSETUP_FRAMELIMIT, MEOSV_VIDEOSETUP_FRAMELIMIT, 0x0);
|
static MenuOptionSet_t MEOS_VIDEOSETUP_FRAMELIMIT = MAKE_MENUOPTIONSET(MEOSN_VIDEOSETUP_FRAMELIMIT, MEOSV_VIDEOSETUP_FRAMELIMIT, 0x0);
|
||||||
|
@ -740,6 +747,7 @@ static MenuEntry_t *MEL_VIDEOSETUP[] = {
|
||||||
&ME_VIDEOSETUP_RENDERER,
|
&ME_VIDEOSETUP_RENDERER,
|
||||||
#endif
|
#endif
|
||||||
&ME_VIDEOSETUP_FULLSCREEN,
|
&ME_VIDEOSETUP_FULLSCREEN,
|
||||||
|
&ME_VIDEOSETUP_BORDERLESS,
|
||||||
&ME_VIDEOSETUP_VSYNC,
|
&ME_VIDEOSETUP_VSYNC,
|
||||||
&ME_VIDEOSETUP_FRAMELIMIT,
|
&ME_VIDEOSETUP_FRAMELIMIT,
|
||||||
&ME_VIDEOSETUP_FRAMELIMITOFFSET,
|
&ME_VIDEOSETUP_FRAMELIMITOFFSET,
|
||||||
|
@ -2133,10 +2141,10 @@ static void Menu_Pre(MenuID_t cm)
|
||||||
MenuEntry_DisableOnCondition(&ME_VIDEOSETUP_APPLY,
|
MenuEntry_DisableOnCondition(&ME_VIDEOSETUP_APPLY,
|
||||||
(xres == resolution[nr].xdim && yres == resolution[nr].ydim &&
|
(xres == resolution[nr].xdim && yres == resolution[nr].ydim &&
|
||||||
videoGetRenderMode() == newrendermode && fullscreen == newfullscreen
|
videoGetRenderMode() == newrendermode && fullscreen == newfullscreen
|
||||||
&& vsync == newvsync
|
&& vsync == newvsync && r_borderless == newborderless
|
||||||
)
|
)
|
||||||
|| (newrendermode != REND_CLASSIC && resolution[nr].bppmax <= 8));
|
|| (newrendermode != REND_CLASSIC && resolution[nr].bppmax <= 8));
|
||||||
|
MenuEntry_DisableOnCondition(&ME_VIDEOSETUP_BORDERLESS, newfullscreen);
|
||||||
MenuEntry_DisableOnCondition(&ME_VIDEOSETUP_FRAMELIMITOFFSET, !r_maxfps);
|
MenuEntry_DisableOnCondition(&ME_VIDEOSETUP_FRAMELIMITOFFSET, !r_maxfps);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3229,15 +3237,21 @@ static void Menu_EntryLinkActivate(MenuEntry_t *entry)
|
||||||
resolution_t p = { xres, yres, fullscreen, bpp, 0 };
|
resolution_t p = { xres, yres, fullscreen, bpp, 0 };
|
||||||
int32_t prend = videoGetRenderMode();
|
int32_t prend = videoGetRenderMode();
|
||||||
int32_t pvsync = vsync;
|
int32_t pvsync = vsync;
|
||||||
|
int pborderless = r_borderless;
|
||||||
|
|
||||||
resolution_t n = { resolution[newresolution].xdim, resolution[newresolution].ydim,
|
resolution_t n = { resolution[newresolution].xdim, resolution[newresolution].ydim,
|
||||||
(resolution[newresolution].flags & RES_FS) ? newfullscreen : 0,
|
(resolution[newresolution].flags & RES_FS) ? newfullscreen : 0,
|
||||||
(newrendermode == REND_CLASSIC) ? 8 : resolution[newresolution].bppmax, 0 };
|
(newrendermode == REND_CLASSIC) ? 8 : resolution[newresolution].bppmax, 0 };
|
||||||
int32_t nrend = newrendermode;
|
|
||||||
int32_t nvsync = newvsync;
|
if (r_borderless != newborderless)
|
||||||
|
videoResetMode();
|
||||||
|
|
||||||
|
r_borderless = newborderless;
|
||||||
|
|
||||||
if (videoSetGameMode(n.flags, n.xdim, n.ydim, n.bppmax, upscalefactor) < 0)
|
if (videoSetGameMode(n.flags, n.xdim, n.ydim, n.bppmax, upscalefactor) < 0)
|
||||||
{
|
{
|
||||||
|
r_borderless = pborderless;
|
||||||
|
|
||||||
if (videoSetGameMode(p.flags, p.xdim, p.ydim, p.bppmax, upscalefactor) < 0)
|
if (videoSetGameMode(p.flags, p.xdim, p.ydim, p.bppmax, upscalefactor) < 0)
|
||||||
{
|
{
|
||||||
videoSetRenderMode(prend);
|
videoSetRenderMode(prend);
|
||||||
|
@ -3249,12 +3263,15 @@ static void Menu_EntryLinkActivate(MenuEntry_t *entry)
|
||||||
vsync = videoSetVsync(pvsync);
|
vsync = videoSetVsync(pvsync);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else onvideomodechange(n.bppmax > 8);
|
else
|
||||||
|
{
|
||||||
|
videoSetRenderMode(newrendermode);
|
||||||
|
vsync = videoSetVsync(newvsync);
|
||||||
|
onvideomodechange(n.bppmax > 8);
|
||||||
|
}
|
||||||
|
|
||||||
g_restorePalette = -1;
|
g_restorePalette = -1;
|
||||||
G_UpdateScreenArea();
|
G_UpdateScreenArea();
|
||||||
videoSetRenderMode(nrend);
|
|
||||||
vsync = videoSetVsync(nvsync);
|
|
||||||
ud.setup.fullscreen = fullscreen;
|
ud.setup.fullscreen = fullscreen;
|
||||||
ud.setup.xdim = xres;
|
ud.setup.xdim = xres;
|
||||||
ud.setup.ydim = yres;
|
ud.setup.ydim = yres;
|
||||||
|
|
Loading…
Reference in a new issue