diff --git a/src/g_shared/sbar.h b/src/g_shared/sbar.h index b8416dd5d7..764e427d34 100644 --- a/src/g_shared/sbar.h +++ b/src/g_shared/sbar.h @@ -57,6 +57,9 @@ class AWeapon; void ST_SetNeedRefresh(); +bool ST_IsTimeVisible(); +bool ST_IsLatencyVisible(); + // HUD Message base object -------------------------------------------------- class DHUDMessage : public DObject diff --git a/src/g_shared/shared_hud.cpp b/src/g_shared/shared_hud.cpp index 0fe8a4588e..344f5b0ec7 100644 --- a/src/g_shared/shared_hud.cpp +++ b/src/g_shared/shared_hud.cpp @@ -59,6 +59,7 @@ EXTERN_CVAR(Bool,am_follow) EXTERN_CVAR (Int, con_scaletext) EXTERN_CVAR (Bool, idmypos) +EXTERN_CVAR (Int, screenblocks) EXTERN_CVAR (Bool, am_showtime) EXTERN_CVAR (Bool, am_showtotaltime) @@ -868,7 +869,7 @@ static void DrawCoordinates(player_t * CPlayer) static void DrawTime() { - if (hud_showtime <= 0 || hud_showtime > 9) + if (!ST_IsTimeVisible()) { return; } @@ -935,6 +936,21 @@ static void DrawTime() DrawHudText(SmallFont, hud_timecolor, timeString, hudwidth - width, height, FRACUNIT); } +static bool IsAltHUDTextVisible() +{ + return hud_althud + && !automapactive + && (SCREENHEIGHT == viewheight) + && (11 == screenblocks); +} + +bool ST_IsTimeVisible() +{ + return IsAltHUDTextVisible() + && (hud_showtime > 0) + && (hud_showtime <= 9); +} + //--------------------------------------------------------------------------- // // Draw in-game latency @@ -943,9 +959,7 @@ static void DrawTime() static void DrawLatency() { - if (hud_showlag <= 0 || - (hud_showlag == 1 && !netgame) || - hud_showlag > 2) + if (!ST_IsLatencyVisible()) { return; } @@ -975,11 +989,19 @@ static void DrawLatency() const int characterCount = (int)strlen(tempstr); const int width = SmallFont->GetCharWidth('0') * characterCount + 2; // small offset from screen's border - const int height = SmallFont->GetHeight() * 2; + const int height = SmallFont->GetHeight() * (ST_IsTimeVisible() ? 2 : 1); DrawHudText(SmallFont, color, tempstr, hudwidth - width, height, FRACUNIT); } +bool ST_IsLatencyVisible() +{ + return IsAltHUDTextVisible() + && (hud_showlag > 0) + && (hud_showlag != 1 || netgame) + && (hud_showlag <= 2); +} + //--------------------------------------------------------------------------- // diff --git a/src/g_shared/shared_sbar.cpp b/src/g_shared/shared_sbar.cpp index bd2946f2a2..0c74f52b72 100644 --- a/src/g_shared/shared_sbar.cpp +++ b/src/g_shared/shared_sbar.cpp @@ -1533,9 +1533,12 @@ void DBaseStatusBar::DrawPowerups () // Each icon gets a 32x32 block to draw itself in. int x, y; AInventory *item; + const int yshift = SmallFont->GetHeight(); x = -20; - y = 17; + y = 17 + + (ST_IsTimeVisible() ? yshift : 0) + + (ST_IsLatencyVisible() ? yshift : 0); for (item = CPlayer->mo->Inventory; item != NULL; item = item->Inventory) { if (item->DrawPowerup (x, y)) diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index 0ced8f004b..ca629fe1b2 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -158,8 +158,10 @@ void P_SetPsprite (player_t *player, int position, FState *state, bool nofunctio } - if (sv_fastweapons >= 2 && position == ps_weapon) - psp->tics = state->ActionFunc == NULL? 0 : 1; + if (sv_fastweapons == 2 && position == ps_weapon) + psp->tics = state->ActionFunc == NULL ? 0 : 1; + else if (sv_fastweapons == 3) + psp->tics = (state->GetTics() != 0); else if (sv_fastweapons) psp->tics = 1; // great for producing decals :) else diff --git a/src/v_video.cpp b/src/v_video.cpp index 042469193c..37cc3163d1 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -858,8 +858,8 @@ void DFrameBuffer::DrawRateStuff () int rate_x; chars = mysnprintf (fpsbuff, countof(fpsbuff), "%2u ms (%3u fps)", howlong, LastCount); - rate_x = Width - chars * 8; - Clear (rate_x, 0, Width, 8, GPalette.BlackIndex, 0); + rate_x = Width - ConFont->StringWidth(&fpsbuff[0]); + Clear (rate_x, 0, Width, ConFont->GetHeight(), GPalette.BlackIndex, 0); DrawText (ConFont, CR_WHITE, rate_x, 0, (char *)&fpsbuff[0], TAG_DONE); DWORD thisSec = ms/1000; diff --git a/wadsrc/static/graphics/stcfn191.lmp b/wadsrc/static/filter/game-doom/graphics/stcfn191.lmp similarity index 100% rename from wadsrc/static/graphics/stcfn191.lmp rename to wadsrc/static/filter/game-doom/graphics/stcfn191.lmp diff --git a/wadsrc/static/graphics/stcfn193.lmp b/wadsrc/static/filter/game-doom/graphics/stcfn193.lmp similarity index 100% rename from wadsrc/static/graphics/stcfn193.lmp rename to wadsrc/static/filter/game-doom/graphics/stcfn193.lmp diff --git a/wadsrc/static/graphics/stcfn196.lmp b/wadsrc/static/filter/game-doom/graphics/stcfn196.lmp similarity index 100% rename from wadsrc/static/graphics/stcfn196.lmp rename to wadsrc/static/filter/game-doom/graphics/stcfn196.lmp diff --git a/wadsrc/static/graphics/stcfn197.lmp b/wadsrc/static/filter/game-doom/graphics/stcfn197.lmp similarity index 100% rename from wadsrc/static/graphics/stcfn197.lmp rename to wadsrc/static/filter/game-doom/graphics/stcfn197.lmp diff --git a/wadsrc/static/graphics/stcfn201.lmp b/wadsrc/static/filter/game-doom/graphics/stcfn201.lmp similarity index 100% rename from wadsrc/static/graphics/stcfn201.lmp rename to wadsrc/static/filter/game-doom/graphics/stcfn201.lmp diff --git a/wadsrc/static/graphics/stcfn205.lmp b/wadsrc/static/filter/game-doom/graphics/stcfn205.lmp similarity index 100% rename from wadsrc/static/graphics/stcfn205.lmp rename to wadsrc/static/filter/game-doom/graphics/stcfn205.lmp diff --git a/wadsrc/static/graphics/stcfn209.lmp b/wadsrc/static/filter/game-doom/graphics/stcfn209.lmp similarity index 100% rename from wadsrc/static/graphics/stcfn209.lmp rename to wadsrc/static/filter/game-doom/graphics/stcfn209.lmp diff --git a/wadsrc/static/graphics/stcfn211.lmp b/wadsrc/static/filter/game-doom/graphics/stcfn211.lmp similarity index 100% rename from wadsrc/static/graphics/stcfn211.lmp rename to wadsrc/static/filter/game-doom/graphics/stcfn211.lmp diff --git a/wadsrc/static/graphics/stcfn214.lmp b/wadsrc/static/filter/game-doom/graphics/stcfn214.lmp similarity index 100% rename from wadsrc/static/graphics/stcfn214.lmp rename to wadsrc/static/filter/game-doom/graphics/stcfn214.lmp diff --git a/wadsrc/static/graphics/stcfn218.lmp b/wadsrc/static/filter/game-doom/graphics/stcfn218.lmp similarity index 100% rename from wadsrc/static/graphics/stcfn218.lmp rename to wadsrc/static/filter/game-doom/graphics/stcfn218.lmp diff --git a/wadsrc/static/graphics/stcfn220.lmp b/wadsrc/static/filter/game-doom/graphics/stcfn220.lmp similarity index 100% rename from wadsrc/static/graphics/stcfn220.lmp rename to wadsrc/static/filter/game-doom/graphics/stcfn220.lmp diff --git a/wadsrc/static/graphics/stcfn223.lmp b/wadsrc/static/filter/game-doom/graphics/stcfn223.lmp similarity index 100% rename from wadsrc/static/graphics/stcfn223.lmp rename to wadsrc/static/filter/game-doom/graphics/stcfn223.lmp diff --git a/wadsrc/static/graphics/fonta164.lmp b/wadsrc/static/filter/game-raven/graphics/fonta164.lmp similarity index 100% rename from wadsrc/static/graphics/fonta164.lmp rename to wadsrc/static/filter/game-raven/graphics/fonta164.lmp diff --git a/wadsrc/static/graphics/fonta165.lmp b/wadsrc/static/filter/game-raven/graphics/fonta165.lmp similarity index 100% rename from wadsrc/static/graphics/fonta165.lmp rename to wadsrc/static/filter/game-raven/graphics/fonta165.lmp diff --git a/wadsrc/static/graphics/fonta182.lmp b/wadsrc/static/filter/game-raven/graphics/fonta182.lmp similarity index 100% rename from wadsrc/static/graphics/fonta182.lmp rename to wadsrc/static/filter/game-raven/graphics/fonta182.lmp diff --git a/wadsrc/static/graphics/fonta188.lmp b/wadsrc/static/filter/game-raven/graphics/fonta188.lmp similarity index 100% rename from wadsrc/static/graphics/fonta188.lmp rename to wadsrc/static/filter/game-raven/graphics/fonta188.lmp diff --git a/wadsrc/static/graphics/fonta191.lmp b/wadsrc/static/filter/game-raven/graphics/fonta191.lmp similarity index 100% rename from wadsrc/static/graphics/fonta191.lmp rename to wadsrc/static/filter/game-raven/graphics/fonta191.lmp diff --git a/wadsrc/static/graphics/fonta60.lmp b/wadsrc/static/filter/game-raven/graphics/fonta60.lmp similarity index 100% rename from wadsrc/static/graphics/fonta60.lmp rename to wadsrc/static/filter/game-raven/graphics/fonta60.lmp diff --git a/wadsrc/static/graphics/fonta61.lmp b/wadsrc/static/filter/game-raven/graphics/fonta61.lmp similarity index 100% rename from wadsrc/static/graphics/fonta61.lmp rename to wadsrc/static/filter/game-raven/graphics/fonta61.lmp diff --git a/wadsrc/static/graphics/fonta62.lmp b/wadsrc/static/filter/game-raven/graphics/fonta62.lmp similarity index 100% rename from wadsrc/static/graphics/fonta62.lmp rename to wadsrc/static/filter/game-raven/graphics/fonta62.lmp diff --git a/wadsrc/static/graphics/fonta63.lmp b/wadsrc/static/filter/game-raven/graphics/fonta63.lmp similarity index 100% rename from wadsrc/static/graphics/fonta63.lmp rename to wadsrc/static/filter/game-raven/graphics/fonta63.lmp