diff --git a/src/common/2d/v_draw.h b/src/common/2d/v_draw.h index 53794b6010..7b1dfa9b69 100644 --- a/src/common/2d/v_draw.h +++ b/src/common/2d/v_draw.h @@ -247,13 +247,11 @@ 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) { - // 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)); + return GetConScale(drawer, con_scale); } #ifdef DrawText diff --git a/src/common/console/c_console.cpp b/src/common/console/c_console.cpp index bb7018a139..fb7fe077d2 100644 --- a/src/common/console/c_console.cpp +++ b/src/common/console/c_console.cpp @@ -128,6 +128,11 @@ 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 21f29c58ce..17898f3ae3 100644 --- a/src/gameconfigfile.cpp +++ b/src/gameconfigfile.cpp @@ -374,6 +374,8 @@ 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 00c8d977a1..095c0c3c94 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -1081,6 +1081,7 @@ 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"