From 88bcaf37ab36848479bcfac96220d66361193d67 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 24 Aug 2020 22:02:49 +0200 Subject: [PATCH] - changed the scale range of hud_statscale so that 1 is for fullscreen 320x200. --- source/blood/src/sbar.cpp | 2 +- source/core/gamecvars.cpp | 8 ++++---- source/core/statusbar.cpp | 13 +++++-------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/source/blood/src/sbar.cpp b/source/blood/src/sbar.cpp index 67b7b85f0..79645c5af 100644 --- a/source/blood/src/sbar.cpp +++ b/source/blood/src/sbar.cpp @@ -633,7 +633,7 @@ private: } drawInventory(pPlayer, 166, 200 - tilesiz[2200].y); // Depending on the scale we can lower the stats display. This needs some tweaking but this catches the important default case already. - PrintLevelStats(pPlayer, (hud_statscale <= 2 || hud_scale < 70) && double(xdim)/ydim > 1.6? 28 : 56); + PrintLevelStats(pPlayer, (hud_statscale <= 0.501f || hud_scale < 70) && double(xdim)/ydim > 1.6? 28 : 56); } diff --git a/source/core/gamecvars.cpp b/source/core/gamecvars.cpp index 2f1e9d084..131d68a72 100644 --- a/source/core/gamecvars.cpp +++ b/source/core/gamecvars.cpp @@ -163,7 +163,7 @@ CUSTOM_CVARD(Int, snd_speech, 1, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enables/disabl // HUD -CUSTOM_CVARD(Int, hud_size, Hud_Stbar, CVAR_ARCHIVE | CVAR_NOINITCALL, "Defines the HUD size and style") +CUSTOM_CVARD(Int, hud_size, Hud_Stbar, CVAR_ARCHIVE, "Defines the HUD size and style") { if (self < 0) self = 0; else if (self > Hud_Nothing) self = Hud_Nothing; @@ -212,10 +212,10 @@ CCMD(sizedown) -CUSTOM_CVARD(Float, hud_statscale, 2, CVAR_ARCHIVE, "change the scale of the stats display") +CUSTOM_CVARD(Float, hud_statscale, 0.5, CVAR_ARCHIVE, "change the scale of the stats display") { - if (self < 0.5) self = 0.5; - else if (self > 4) self = 4; + if (self < 0.36) self = 0.36; + else if (self > 1) self = 1; } diff --git a/source/core/statusbar.cpp b/source/core/statusbar.cpp index 27c1a88c2..fbf30c76b 100644 --- a/source/core/statusbar.cpp +++ b/source/core/statusbar.cpp @@ -708,14 +708,11 @@ void DBaseStatusBar::PrintLevelStats(FLevelStats &stats) double spacing = stats.spacing * hud_statscale; if (stats.screenbottomspace < 0) { - double x = 0, w = 0, h = 0; - y = 200 - RelTop; - StatusbarToRealCoords(x, y, w, h); - y -= spacing; + y = 200 - RelTop - spacing; } else { - y = (screen->GetHeight() - stats.screenbottomspace * GetHUDScale().Y) - spacing; + y = 200 - stats.screenbottomspace - spacing; } FString text; @@ -723,7 +720,7 @@ void DBaseStatusBar::PrintLevelStats(FLevelStats &stats) { text.Format(TEXTCOLOR_ESCAPESTR "%cS: " TEXTCOLOR_ESCAPESTR "%c%d/%d", stats.letterColor + 'A', stats.secrets == stats.maxsecrets ? stats.completeColor + 'A' : stats.standardColor + 'A', stats.secrets, stats.maxsecrets); - DrawText(twod, stats.font, CR_UNTRANSLATED, 2 * hud_statscale, y, text, DTA_ScaleX, scale, DTA_ScaleY, scale, TAG_DONE); + DrawText(twod, stats.font, CR_UNTRANSLATED, 2 * hud_statscale, y, text, DTA_FullscreenScale, FSMode_Fit320x200, DTA_KeepRatio, true, DTA_ScaleX, scale, DTA_ScaleY, scale, TAG_DONE); y -= spacing; } @@ -735,12 +732,12 @@ void DBaseStatusBar::PrintLevelStats(FLevelStats &stats) if (text.IsNotEmpty()) { - DrawText(twod, stats.font, CR_UNTRANSLATED, 2 * hud_statscale, y, text, DTA_ScaleX, scale, DTA_ScaleY, scale, TAG_DONE); + DrawText(twod, stats.font, CR_UNTRANSLATED, 2 * hud_statscale, y, text, DTA_FullscreenScale, FSMode_Fit320x200, DTA_KeepRatio, true, DTA_ScaleX, scale, DTA_ScaleY, scale, TAG_DONE); y -= spacing; } text.Format(TEXTCOLOR_ESCAPESTR "%cT: " TEXTCOLOR_ESCAPESTR "%c%d:%02d", stats.letterColor+'A', stats.standardColor + 'A', stats.time / 60000, (stats.time % 60000) / 1000); - DrawText(twod, stats.font, CR_UNTRANSLATED, 2 * hud_statscale, y, text, DTA_ScaleX, scale, DTA_ScaleY, scale, TAG_DONE); + DrawText(twod, stats.font, CR_UNTRANSLATED, 2 * hud_statscale, y, text, DTA_FullscreenScale, FSMode_Fit320x200, DTA_KeepRatio, true, DTA_ScaleX, scale, DTA_ScaleY, scale, TAG_DONE); } //============================================================================