Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- fixed auto-scaling for console.
  • Loading branch information
coelckers committed Jun 5, 2022
1 parent e266fb1 commit a59436c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/common/2d/v_draw.cpp
Expand Up @@ -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));
}
Expand Down
6 changes: 4 additions & 2 deletions src/common/2d/v_draw.h
Expand Up @@ -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.

This comment has been minimized.

Copy link
@LordMisfit

LordMisfit Jun 6, 2022

Contributor

So I understand you're trying to port over the scaling from Raze [or someone theorized that], but I do hope con_scale can be restored on top of the new code. Unless I'm missing something you're planning to do with this in the future, based on the new scaling, the new default size for the console text is absurdly small in 1920x1080, and it could cause people to squint (like I did checking it out) to the point of possibly getting headaches to read the console right now. Sorry to bring this up here, but I didn't think posting a topic on the forums would've made sense for one thing still being worked in. x.x

int vscale = drawer->GetHeight() / 720;
int hscale = drawer->GetWidth() / 1280;
return max(1, min(vscale, hscale));
}

#ifdef DrawText
Expand Down
5 changes: 0 additions & 5 deletions src/common/console/c_console.cpp
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions src/gameconfigfile.cpp
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion wadsrc/static/menudef.txt
Expand Up @@ -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"
Expand Down

0 comments on commit a59436c

Please sign in to comment.