From 24a275804c4ac8e29722de5c70f9b95981bc6b07 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 5 Jun 2022 12:16:15 +0200 Subject: [PATCH] - HUD scaling for automap HUD. --- src/g_statusbar/shared_sbar.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/g_statusbar/shared_sbar.cpp b/src/g_statusbar/shared_sbar.cpp index d4b94f3a4..297af8bea 100644 --- a/src/g_statusbar/shared_sbar.cpp +++ b/src/g_statusbar/shared_sbar.cpp @@ -86,7 +86,6 @@ EXTERN_CVAR (Bool, am_showitems) EXTERN_CVAR (Bool, am_showtime) EXTERN_CVAR (Bool, am_showtotaltime) EXTERN_CVAR (Bool, noisedebug) -EXTERN_CVAR(Bool, vid_fps) EXTERN_CVAR(Bool, inter_subtitles) EXTERN_CVAR(Bool, ui_screenborder_classic_scaling) @@ -548,11 +547,12 @@ void FormatMapName(FLevelLocals *self, int cr, FString *result); void DBaseStatusBar::DoDrawAutomapHUD(int crdefault, int highlight) { - auto scale = GetUIScale(twod, hud_scale); + auto scalev = GetHUDScale(); + int vwidth = int(twod->GetWidth() / scalev.X); + int vheight = int(twod->GetHeight() / scalev.Y); + auto font = generic_ui ? NewSmallFont : SmallFont; auto font2 = font; - auto vwidth = twod->GetWidth() / scale; - auto vheight = twod->GetHeight() / scale; auto fheight = font->GetHeight(); FString textbuffer; int sec; @@ -568,7 +568,6 @@ void DBaseStatusBar::DoDrawAutomapHUD(int crdefault, int highlight) if (am_showtime) { - if (vid_fps) y += (NewConsoleFont->GetHeight() * active_con_scale(twod) + 5) / scale; sec = Tics2Seconds(primaryLevel->time); textbuffer.Format("%02d:%02d:%02d", sec / 3600, (sec % 3600) / 60, sec % 60); DrawText(twod, font, crdefault, vwidth - zerowidth * 8 - textdist, y, textbuffer, DTA_VirtualWidth, vwidth, DTA_VirtualHeight, vheight, @@ -630,7 +629,7 @@ void DBaseStatusBar::DoDrawAutomapHUD(int crdefault, int highlight) IFVIRTUAL(DStatusBarCore, GetProtrusion) { int prot = 0; - VMValue params[] = { this, double(finalwidth * scale / w) }; + VMValue params[] = { this, double(finalwidth * scalev.X / w) }; VMReturn ret(&prot); VMCall(func, params, 2, &ret, 1); h = prot;