- HUD scaling for automap HUD.

This commit is contained in:
Christoph Oelckers 2022-06-05 12:16:15 +02:00
parent efaaa3c118
commit 24a275804c

View file

@ -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;