- fixed coordinates.

This commit is contained in:
Christoph Oelckers 2020-07-03 00:32:10 +02:00
parent e833360b65
commit d2595582d4
3 changed files with 16 additions and 6 deletions

View file

@ -802,11 +802,21 @@ CVAR(Float, hud_statscale, 2, CVAR_ARCHIVE)
void DBaseStatusBar::PrintLevelStats(FLevelStats &stats) void DBaseStatusBar::PrintLevelStats(FLevelStats &stats)
{ {
BeginHUD(320, 200, 1.f, false); double y;
double scale = stats.fontscale * hud_statscale; double scale = stats.fontscale * hud_statscale;
if (stats.spacing <= 0) stats.spacing = stats.font->GetHeight() * stats.fontscale; if (stats.spacing <= 0) stats.spacing = stats.font->GetHeight() * stats.fontscale;
double spacing = stats.spacing * hud_statscale; double spacing = stats.spacing * hud_statscale;
double y = (stats.screenbottomspace < 0 ? RelTop : screen->GetHeight() - stats.screenbottomspace * defaultScale.Y) - spacing; if (stats.screenbottomspace < 0)
{
double x = 0, w = 0, h = 0;
y = 200 - RelTop;
StatusbarToRealCoords(x, y, w, h);
y -= spacing;
}
else
{
y = (screen->GetHeight() - stats.screenbottomspace * GetHUDScale().Y) - spacing;
}
FString text; FString text;
if (stats.maxsecrets > 0) // don't bother if there are no secrets. if (stats.maxsecrets > 0) // don't bother if there are no secrets.

View file

@ -242,7 +242,7 @@ public:
void DrawHud(int snum, int style) void DrawHud(int snum, int style)
{ {
auto p = g_player[snum].ps; auto p = g_player[snum].ps;
BeginHUD(320, 200, 1.f, true); BeginHUD(320, 200, 1.f, false);
if (style == 1) if (style == 1)
{ {
DrawInventory(p, 0, -46, DI_SCREEN_CENTER_BOTTOM); DrawInventory(p, 0, -46, DI_SCREEN_CENTER_BOTTOM);
@ -253,7 +253,7 @@ public:
{ {
DrawInventory(p, (ud.multimode > 1) ? 56 : 65, -28, DI_SCREEN_CENTER_BOTTOM); DrawInventory(p, (ud.multimode > 1) ? 56 : 65, -28, DI_SCREEN_CENTER_BOTTOM);
FullscreenHUD2(p); FullscreenHUD2(p);
PrintLevelStats(tilesiz[HEALTHBOX].y + 2); PrintLevelStats(tilesiz[HEALTHBOX].y + 4);
} }
else else
{ {

View file

@ -219,7 +219,7 @@ public:
void DrawHud(int snum, int style) void DrawHud(int snum, int style)
{ {
auto p = g_player[snum].ps; auto p = g_player[snum].ps;
BeginHUD(320, 200, 1.f, true); BeginHUD(320, 200, 1.f, false);
if (style == 1) if (style == 1)
{ {
double y = -40; double y = -40;
@ -235,7 +235,7 @@ public:
{ {
DrawInventory(p, 56, -20, DI_SCREEN_CENTER_BOTTOM); DrawInventory(p, 56, -20, DI_SCREEN_CENTER_BOTTOM);
FullscreenHUD2(p); FullscreenHUD2(p);
PrintLevelStats(scale * tilesiz[HEALTHBOX].y + 2); PrintLevelStats(scale * tilesiz[HEALTHBOX].y + 4);
} }
else else
{ {