Rudimentary support for separate fullscreen/windowed resolutions.

This commit is contained in:
spherallic 2022-01-31 14:40:41 +01:00
parent f5d4eb3e7a
commit 020ce6a1dd
3 changed files with 13 additions and 1 deletions

View file

@ -872,6 +872,10 @@ void D_RegisterClientCommands(void)
CV_RegisterVar(&cv_scr_width);
CV_RegisterVar(&cv_scr_height);
CV_RegisterVar(&cv_usewindowedres);
CV_RegisterVar(&cv_scr_width_w);
CV_RegisterVar(&cv_scr_height_w);
CV_RegisterVar(&cv_soundtest);
CV_RegisterVar(&cv_perfstats);

View file

@ -69,6 +69,10 @@ consvar_t cv_scr_height = CVAR_INIT ("scr_height", "800", CV_SAVE, CV_Unsigned,
consvar_t cv_scr_depth = CVAR_INIT ("scr_depth", "16 bits", CV_SAVE, scr_depth_cons_t, NULL);
consvar_t cv_renderview = CVAR_INIT ("renderview", "On", 0, CV_OnOff, NULL);
consvar_t cv_usewindowedres = CVAR_INIT ("usewindowedres", "No", CV_SAVE, CV_YesNo, NULL);
consvar_t cv_scr_width_w = CVAR_INIT ("scr_width_w", "640", CV_SAVE, CV_Unsigned, NULL);
consvar_t cv_scr_height_w = CVAR_INIT ("scr_height_w", "400", CV_SAVE, CV_Unsigned, NULL);
CV_PossibleValue_t cv_renderer_t[] = {
{1, "Software"},
#ifdef HWRENDER
@ -405,7 +409,10 @@ void SCR_ChangeFullscreen(void)
if (graphics_started)
{
VID_PrepareModeList();
setmodeneeded = VID_GetModeForSize(vid.width, vid.height) + 1;
if (cv_usewindowedres.value == 1 && cv_fullscreen.value == 0)
setmodeneeded = VID_GetModeForSize(cv_scr_width_w.value, cv_scr_height_w.value) + 1;
else
setmodeneeded = VID_GetModeForSize(cv_scr_width.value, cv_scr_height.value) + 1;
}
return;
#endif

View file

@ -190,6 +190,7 @@ extern INT32 scr_bpp;
extern UINT8 *scr_borderpatch; // patch used to fill the view borders
extern consvar_t cv_scr_width, cv_scr_height, cv_scr_depth, cv_renderview, cv_renderer, cv_fullscreen;
extern consvar_t cv_scr_width_w, cv_scr_height_w, cv_usewindowedres;
// wait for page flipping to end or not
extern consvar_t cv_vidwait;