From a59436c4c28609b9434456e5b99c1099d8346add Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 5 Jun 2022 12:34:22 +0200 Subject: [PATCH] - fixed auto-scaling for console. --- src/common/2d/v_draw.cpp | 2 +- src/common/2d/v_draw.h | 6 ++++-- src/common/console/c_console.cpp | 5 ----- src/gameconfigfile.cpp | 2 -- wadsrc/static/menudef.txt | 1 - 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/common/2d/v_draw.cpp b/src/common/2d/v_draw.cpp index 1ff348bc785..b784b60e2a6 100644 --- a/src/common/2d/v_draw.cpp +++ b/src/common/2d/v_draw.cpp @@ -163,7 +163,7 @@ int GetConScale(F2DDrawer* drawer, int altval) else if (uiscale == 0) { // Default should try to scale to 640x400 - int vscale = drawer->GetHeight() / 800; + int vscale = drawer->GetHeight() / 720; int hscale = drawer->GetWidth() / 1280; scaleval = max(1, min(vscale, hscale)); } diff --git a/src/common/2d/v_draw.h b/src/common/2d/v_draw.h index fecfc3d9edb..673460848bd 100644 --- a/src/common/2d/v_draw.h +++ b/src/common/2d/v_draw.h @@ -247,11 +247,13 @@ int GetUIScale(F2DDrawer* drawer, int altval); int GetConScale(F2DDrawer* drawer, int altval); EXTERN_CVAR(Int, uiscale); -EXTERN_CVAR(Int, con_scale); inline int active_con_scale(F2DDrawer *drawer) { - return GetConScale(drawer, con_scale); + // this sets the threshold for upscaling the console font to 2560 x 1440. + int vscale = drawer->GetHeight() / 720; + int hscale = drawer->GetWidth() / 1280; + return max(1, min(vscale, hscale)); } #ifdef DrawText diff --git a/src/common/console/c_console.cpp b/src/common/console/c_console.cpp index 483f9a3789e..3d54e6adb39 100644 --- a/src/common/console/c_console.cpp +++ b/src/common/console/c_console.cpp @@ -128,11 +128,6 @@ static GameAtExit *ExitCmdList; static char *work = NULL; static int worklen = 0; -CUSTOM_CVAR(Int, con_scale, 0, CVAR_ARCHIVE) -{ - if (self < 0) self = 0; -} - CUSTOM_CVAR(Float, con_alpha, 0.75f, CVAR_ARCHIVE) { if (self < 0.f) self = 0.f; diff --git a/src/gameconfigfile.cpp b/src/gameconfigfile.cpp index 17898f3ae30..21f29c58ce6 100644 --- a/src/gameconfigfile.cpp +++ b/src/gameconfigfile.cpp @@ -374,8 +374,6 @@ void FGameConfigFile::DoGlobalSetup () if (var != NULL) var->ResetToDefault(); var = FindCVar("hud_althudscale", NULL); if (var != NULL) var->ResetToDefault(); - var = FindCVar("con_scale", NULL); - if (var != NULL) var->ResetToDefault(); var = FindCVar("con_scaletext", NULL); if (var != NULL) var->ResetToDefault(); var = FindCVar("uiscale", NULL); diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 095c0c3c942..00c8d977a13 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -1081,7 +1081,6 @@ OptionMenu "ScalingOptions" protected // These will need a new control type. StaticText "$SCALEMNU_OVERRIDE", 1 ScaleSlider "$SCALEMNU_MESSAGES", "con_scaletext", 0.0, 8.0, 1.0, "$SCALEMNU_USEUI" - ScaleSlider "$SCALEMNU_CONSOLE", "con_scale", 0.0, 8.0, 1.0, "$SCALEMNU_USEUI" ScaleSlider "$SCALEMNU_STATBAR", "st_scale", -1.0, 8.0, 1.0, "$SCALEMNU_USEUI", "$SCALEMNU_USEFS" ScaleSlider "$SCALEMNU_HUD", "hud_scale", -1.0, 8.0, 1.0, "$SCALEMNU_USEUI", "$SCALEMNU_USEFS" ScaleSlider "$SCALEMNU_ALTHUD", "hud_althudscale", 0.0, 8.0, 1.0, "$SCALEMNU_USEUI"