mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Use 0 to 260 degree in Angle display, and do not display decimals of speed in debughd
This commit is contained in:
parent
44478b13ba
commit
6e8efa9204
|
@ -37,15 +37,15 @@ void CDebugHud::RenderNetCorrections()
|
|||
|
||||
x = Width - 10.0f;
|
||||
char aBuf[128];
|
||||
str_format(aBuf, sizeof(aBuf), "%.2f Bps", Velspeed / 32);
|
||||
str_format(aBuf, sizeof(aBuf), "%.0f Bps", Velspeed / 32);
|
||||
float w = TextRender()->TextWidth(0, Fontsize, aBuf, -1, -1.0f);
|
||||
TextRender()->Text(0, x - w, y, Fontsize, aBuf, -1.0f);
|
||||
y += LineHeight;
|
||||
str_format(aBuf, sizeof(aBuf), "%.2f Bps", VelspeedX / 32 * Ramp);
|
||||
str_format(aBuf, sizeof(aBuf), "%.0f Bps", VelspeedX / 32 * Ramp);
|
||||
w = TextRender()->TextWidth(0, Fontsize, aBuf, -1, -1.0f);
|
||||
TextRender()->Text(0, x - w, y, Fontsize, aBuf, -1.0f);
|
||||
y += LineHeight;
|
||||
str_format(aBuf, sizeof(aBuf), "%.2f Bps", VelspeedY / 32);
|
||||
str_format(aBuf, sizeof(aBuf), "%.0f Bps", VelspeedY / 32);
|
||||
w = TextRender()->TextWidth(0, Fontsize, aBuf, -1, -1.0f);
|
||||
TextRender()->Text(0, x - w, y, Fontsize, aBuf, -1.0f);
|
||||
y += LineHeight;
|
||||
|
|
|
@ -1390,17 +1390,21 @@ void CHud::RenderMovementInformation(const int ClientID)
|
|||
DisplaySpeedX *= (m_pClient->m_Snap.m_aCharacters[ClientID].m_ExtendedDisplayInfo.m_RampValue / 1000.0f);
|
||||
}
|
||||
|
||||
float Angle = Character->m_Angle / 256.0f;
|
||||
if(Angle > pi)
|
||||
{
|
||||
Angle -= 2.0f * pi;
|
||||
}
|
||||
float Angle = 0.0f;
|
||||
if(m_pClient->m_Snap.m_aCharacters[ClientID].m_HasExtendedDisplayInfo)
|
||||
{
|
||||
// On DDNet servers the more accurate angle is displayed, calculated from the target coordinates
|
||||
CNetObj_DDNetCharacterDisplayInfo *CharacterDisplayInfo = &m_pClient->m_Snap.m_aCharacters[ClientID].m_ExtendedDisplayInfo;
|
||||
Angle = atan2f(CharacterDisplayInfo->m_TargetY, CharacterDisplayInfo->m_TargetX);
|
||||
}
|
||||
else
|
||||
{
|
||||
Angle = Character->m_Angle / 256.0f;
|
||||
}
|
||||
if(Angle < 0)
|
||||
{
|
||||
Angle += 2.0f * pi;
|
||||
}
|
||||
float DisplayAngle = Angle * 180.0f / pi;
|
||||
|
||||
char aBuf[128];
|
||||
|
|
Loading…
Reference in a new issue