2922: Don't show wrong decisecs in game time in HUD r=heinrich5991 a=def-

I think .me' reported this to me 7 years ago and I've been noticing that they're wrong since then. Time to remove I guess, they don't seem useful anyway.

Co-authored-by: def <dennis@felsin9.de>
This commit is contained in:
bors[bot] 2020-10-02 16:16:55 +00:00 committed by GitHub
commit 2a76cddb4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 27 deletions

View file

@ -288,7 +288,6 @@ MACRO_CONFIG_INT(ClRaceGhostServerControl, cl_race_ghost_server_control, 1, 0, 1
MACRO_CONFIG_INT(ClRaceShowGhost, cl_race_show_ghost, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show ghost") MACRO_CONFIG_INT(ClRaceShowGhost, cl_race_show_ghost, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show ghost")
MACRO_CONFIG_INT(ClRaceSaveGhost, cl_race_save_ghost, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Save ghost") MACRO_CONFIG_INT(ClRaceSaveGhost, cl_race_save_ghost, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Save ghost")
MACRO_CONFIG_INT(ClDDRaceScoreBoard, cl_ddrace_scoreboard, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Enable DDRace Scoreboard") MACRO_CONFIG_INT(ClDDRaceScoreBoard, cl_ddrace_scoreboard, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Enable DDRace Scoreboard")
MACRO_CONFIG_INT(ClShowDecisecs, cl_show_decisecs, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Show deciseconds in game time")
MACRO_CONFIG_INT(SvResetPickups, sv_reset_pickups, 0, 0, 1, CFGFLAG_SERVER | CFGFLAG_GAME, "Whether the weapons are reset on passing the start tile or not") MACRO_CONFIG_INT(SvResetPickups, sv_reset_pickups, 0, 0, 1, CFGFLAG_SERVER | CFGFLAG_GAME, "Whether the weapons are reset on passing the start tile or not")
MACRO_CONFIG_INT(ClShowOthers, cl_show_others, 0, 0, 2, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show players in other teams (2 to show own team only)") MACRO_CONFIG_INT(ClShowOthers, cl_show_others, 0, 0, 2, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show players in other teams (2 to show own team only)")
MACRO_CONFIG_INT(ClShowOthersAlpha, cl_show_others_alpha, 40, 0, 100, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show players in other teams (alpha value, 0 invisible, 100 fully visible)") MACRO_CONFIG_INT(ClShowOthersAlpha, cl_show_others_alpha, 40, 0, 100, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show players in other teams (alpha value, 0 invisible, 100 fully visible)")

View file

@ -70,7 +70,6 @@ void CHud::OnReset()
m_DDRaceTime = 0; m_DDRaceTime = 0;
m_LastReceivedTimeTick = 0; m_LastReceivedTimeTick = 0;
m_CheckpointTick = 0; m_CheckpointTick = 0;
m_DDRaceTick = 0;
m_FinishTime = false; m_FinishTime = false;
m_DDRaceTimeReceived = false; m_DDRaceTimeReceived = false;
m_ServerRecord = -1.0f; m_ServerRecord = -1.0f;
@ -122,18 +121,20 @@ void CHud::RenderGameTimer()
else else
Time = (Client()->GameTick(g_Config.m_ClDummy) - m_pClient->m_Snap.m_pGameInfoObj->m_RoundStartTick) / Client()->GameTickSpeed(); Time = (Client()->GameTick(g_Config.m_ClDummy) - m_pClient->m_Snap.m_pGameInfoObj->m_RoundStartTick) / Client()->GameTickSpeed();
if(Time <= 0 && g_Config.m_ClShowDecisecs) if(Time <= 0)
str_format(aBuf, sizeof(aBuf), "00:00.0");
else if(Time <= 0)
str_format(aBuf, sizeof(aBuf), "00:00"); str_format(aBuf, sizeof(aBuf), "00:00");
else if(g_Config.m_ClShowDecisecs) else if(Time >= 3600 * 24)
str_format(aBuf, sizeof(aBuf), "%02d:%02d.%d", Time / 60, Time % 60, m_DDRaceTick / 10); str_format(aBuf, sizeof(aBuf), "%dd %02d:%02d:%02d", Time / (3600 * 24), (Time % (3600 * 24)) / 3600, (Time % 3600) / 60, Time % 60);
else if(Time >= 3600)
str_format(aBuf, sizeof(aBuf), "%02d:%02d:%02d", Time / 3600, (Time % 3600) / 60, Time % 60);
else else
str_format(aBuf, sizeof(aBuf), "%02d:%02d", Time / 60, Time % 60); str_format(aBuf, sizeof(aBuf), "%02d:%02d", Time / 60, Time % 60);
float FontSize = 10.0f; float FontSize = 10.0f;
float w; float w;
if(g_Config.m_ClShowDecisecs) if(Time >= 3600 * 24)
w = TextRender()->TextWidth(0, 12, "00:00.0", -1, -1.0f); w = TextRender()->TextWidth(0, 12, "00d 00:00:00", -1, -1.0f);
else if(Time >= 3600)
w = TextRender()->TextWidth(0, 12, "00:00:00", -1, -1.0f);
else else
w = TextRender()->TextWidth(0, 12, "00:00", -1, -1.0f); w = TextRender()->TextWidth(0, 12, "00:00", -1, -1.0f);
// last 60 sec red, last 10 sec blink // last 60 sec red, last 10 sec blink
@ -804,16 +805,6 @@ void CHud::OnRender()
RenderRecord(); RenderRecord();
} }
RenderCursor(); RenderCursor();
static int LastChangeTick = 0;
if(LastChangeTick != Client()->PredGameTick(g_Config.m_ClDummy))
{
m_DDRaceTick += 100 / Client()->GameTickSpeed();
LastChangeTick = Client()->PredGameTick(g_Config.m_ClDummy);
}
if(m_DDRaceTick >= 100)
m_DDRaceTick = 0;
} }
void CHud::OnMessage(int MsgType, void *pRawMsg) void CHud::OnMessage(int MsgType, void *pRawMsg)
@ -825,7 +816,6 @@ void CHud::OnMessage(int MsgType, void *pRawMsg)
CNetMsg_Sv_DDRaceTime *pMsg = (CNetMsg_Sv_DDRaceTime *)pRawMsg; CNetMsg_Sv_DDRaceTime *pMsg = (CNetMsg_Sv_DDRaceTime *)pRawMsg;
m_DDRaceTime = pMsg->m_Time; m_DDRaceTime = pMsg->m_Time;
m_DDRaceTick = 0;
m_LastReceivedTimeTick = Client()->GameTick(g_Config.m_ClDummy); m_LastReceivedTimeTick = Client()->GameTick(g_Config.m_ClDummy);
@ -856,7 +846,6 @@ void CHud::OnMessage(int MsgType, void *pRawMsg)
m_DDRaceTimeReceived = true; m_DDRaceTimeReceived = true;
m_DDRaceTime = pMsg->m_ServerTimeBest; // First value: m_Time m_DDRaceTime = pMsg->m_ServerTimeBest; // First value: m_Time
m_DDRaceTick = 0;
m_LastReceivedTimeTick = Client()->GameTick(g_Config.m_ClDummy); m_LastReceivedTimeTick = Client()->GameTick(g_Config.m_ClDummy);
@ -915,11 +904,6 @@ void CHud::RenderDDRaceEffects()
TextRender()->TextColor(1, 1, 1, 1); TextRender()->TextColor(1, 1, 1, 1);
} }
} }
/*else if(m_DDRaceTimeReceived)
{
str_format(aBuf, sizeof(aBuf), "%02d:%02d.%d", m_DDRaceTime/60, m_DDRaceTime%60, m_DDRaceTick/10);
TextRender()->Text(0, 150*Graphics()->ScreenAspect()-TextRender()->TextWidth(0, 12, "00:00.0", -1, -1.0f)/2, 20, 12, aBuf, -1.0f); // use fixed value for text width so its not shaky
}*/
} }
void CHud::RenderRecord() void CHud::RenderRecord()

View file

@ -84,7 +84,6 @@ private:
int m_DDRaceTime; int m_DDRaceTime;
int m_LastReceivedTimeTick; int m_LastReceivedTimeTick;
int m_CheckpointTick; int m_CheckpointTick;
int m_DDRaceTick;
bool m_FinishTime; bool m_FinishTime;
bool m_DDRaceTimeReceived; bool m_DDRaceTimeReceived;
}; };