This commit is contained in:
Christoph Oelckers 2016-02-05 01:49:12 +01:00
commit c995158d52
26 changed files with 40 additions and 10 deletions

View file

@ -57,6 +57,9 @@ class AWeapon;
void ST_SetNeedRefresh(); void ST_SetNeedRefresh();
bool ST_IsTimeVisible();
bool ST_IsLatencyVisible();
// HUD Message base object -------------------------------------------------- // HUD Message base object --------------------------------------------------
class DHUDMessage : public DObject class DHUDMessage : public DObject

View file

@ -59,6 +59,7 @@
EXTERN_CVAR(Bool,am_follow) EXTERN_CVAR(Bool,am_follow)
EXTERN_CVAR (Int, con_scaletext) EXTERN_CVAR (Int, con_scaletext)
EXTERN_CVAR (Bool, idmypos) EXTERN_CVAR (Bool, idmypos)
EXTERN_CVAR (Int, screenblocks)
EXTERN_CVAR (Bool, am_showtime) EXTERN_CVAR (Bool, am_showtime)
EXTERN_CVAR (Bool, am_showtotaltime) EXTERN_CVAR (Bool, am_showtotaltime)
@ -868,7 +869,7 @@ static void DrawCoordinates(player_t * CPlayer)
static void DrawTime() static void DrawTime()
{ {
if (hud_showtime <= 0 || hud_showtime > 9) if (!ST_IsTimeVisible())
{ {
return; return;
} }
@ -935,6 +936,21 @@ static void DrawTime()
DrawHudText(SmallFont, hud_timecolor, timeString, hudwidth - width, height, FRACUNIT); 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 // Draw in-game latency
@ -943,9 +959,7 @@ static void DrawTime()
static void DrawLatency() static void DrawLatency()
{ {
if (hud_showlag <= 0 || if (!ST_IsLatencyVisible())
(hud_showlag == 1 && !netgame) ||
hud_showlag > 2)
{ {
return; return;
} }
@ -975,11 +989,19 @@ static void DrawLatency()
const int characterCount = (int)strlen(tempstr); const int characterCount = (int)strlen(tempstr);
const int width = SmallFont->GetCharWidth('0') * characterCount + 2; // small offset from screen's border 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); DrawHudText(SmallFont, color, tempstr, hudwidth - width, height, FRACUNIT);
} }
bool ST_IsLatencyVisible()
{
return IsAltHUDTextVisible()
&& (hud_showlag > 0)
&& (hud_showlag != 1 || netgame)
&& (hud_showlag <= 2);
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //

View file

@ -1533,9 +1533,12 @@ void DBaseStatusBar::DrawPowerups ()
// Each icon gets a 32x32 block to draw itself in. // Each icon gets a 32x32 block to draw itself in.
int x, y; int x, y;
AInventory *item; AInventory *item;
const int yshift = SmallFont->GetHeight();
x = -20; x = -20;
y = 17; y = 17
+ (ST_IsTimeVisible() ? yshift : 0)
+ (ST_IsLatencyVisible() ? yshift : 0);
for (item = CPlayer->mo->Inventory; item != NULL; item = item->Inventory) for (item = CPlayer->mo->Inventory; item != NULL; item = item->Inventory)
{ {
if (item->DrawPowerup (x, y)) if (item->DrawPowerup (x, y))

View file

@ -158,8 +158,10 @@ void P_SetPsprite (player_t *player, int position, FState *state, bool nofunctio
} }
if (sv_fastweapons >= 2 && position == ps_weapon) if (sv_fastweapons == 2 && position == ps_weapon)
psp->tics = state->ActionFunc == NULL? 0 : 1; psp->tics = state->ActionFunc == NULL ? 0 : 1;
else if (sv_fastweapons == 3)
psp->tics = (state->GetTics() != 0);
else if (sv_fastweapons) else if (sv_fastweapons)
psp->tics = 1; // great for producing decals :) psp->tics = 1; // great for producing decals :)
else else

View file

@ -858,8 +858,8 @@ void DFrameBuffer::DrawRateStuff ()
int rate_x; int rate_x;
chars = mysnprintf (fpsbuff, countof(fpsbuff), "%2u ms (%3u fps)", howlong, LastCount); chars = mysnprintf (fpsbuff, countof(fpsbuff), "%2u ms (%3u fps)", howlong, LastCount);
rate_x = Width - chars * 8; rate_x = Width - ConFont->StringWidth(&fpsbuff[0]);
Clear (rate_x, 0, Width, 8, GPalette.BlackIndex, 0); Clear (rate_x, 0, Width, ConFont->GetHeight(), GPalette.BlackIndex, 0);
DrawText (ConFont, CR_WHITE, rate_x, 0, (char *)&fpsbuff[0], TAG_DONE); DrawText (ConFont, CR_WHITE, rate_x, 0, (char *)&fpsbuff[0], TAG_DONE);
DWORD thisSec = ms/1000; DWORD thisSec = ms/1000;