From 45d94ee9932e68a4e3796901ca5bd70a77942636 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sun, 20 Jan 2019 02:45:35 -0500 Subject: [PATCH] - set resolution selector to auto detected resolution at startup, remove the entries from the config file - committing a change for fullscreen sets scaling to 1.0 to guarantee the selected number of pixels are actually used --- src/menu/resolutionmenu.cpp | 5 +++-- src/v_video.cpp | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/menu/resolutionmenu.cpp b/src/menu/resolutionmenu.cpp index 0f05c1a20..77a5648f3 100644 --- a/src/menu/resolutionmenu.cpp +++ b/src/menu/resolutionmenu.cpp @@ -39,8 +39,8 @@ #include "v_video.h" #include "menu/menu.h" -CVAR(Int, menu_resolution_custom_width, 640, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) -CVAR(Int, menu_resolution_custom_height, 480, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) +CVAR(Int, menu_resolution_custom_width, 640, 0) +CVAR(Int, menu_resolution_custom_height, 480, 0) EXTERN_CVAR(Bool, fullscreen) EXTERN_CVAR(Bool, win_maximized) @@ -84,6 +84,7 @@ CCMD (menu_resolution_commit_changes) { fullscreen = true; vid_scalemode = 5; + vid_scalefactor = 1.; vid_scale_customwidth = menu_resolution_custom_width; vid_scale_customheight = menu_resolution_custom_height; vid_scale_customstretched = false; diff --git a/src/v_video.cpp b/src/v_video.cpp index 7c2adec6c..61e79b585 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -68,6 +68,8 @@ #include "version.h" EXTERN_CVAR(Bool, cl_capfps) +EXTERN_CVAR(Int, menu_resolution_custom_width) +EXTERN_CVAR(Int, menu_resolution_custom_height) CVAR(Int, win_x, -1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Int, win_y, -1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) @@ -740,6 +742,10 @@ void V_Init2() Video->SetResolution(); // this only fails via exceptions. Printf ("Resolution: %d x %d\n", SCREENWIDTH, SCREENHEIGHT); + // init these for the scaling menu + menu_resolution_custom_width = SCREENWIDTH; + menu_resolution_custom_height = SCREENHEIGHT; + screen->SetGamma (); FBaseCVar::ResetColors (); C_NewModeAdjust();