aboutsummaryrefslogtreecommitdiff
path: root/src/render/Hud.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-02-01 18:40:54 +0200
committerSergeanur <s.anureev@yandex.ua>2020-02-01 18:40:54 +0200
commit3d69148497d9d6415b2a67348fac4531a5952adf (patch)
tree870248f43478e8f768271f41672b3de4d6f58e92 /src/render/Hud.cpp
parente2f8ad983d83b09b8ec12d87ff946c6387b5ffc6 (diff)
Added enum to OnscreenTimer, fixed mistakes in CCarCtrl::SteerAIBoatWithPhysicsHeadingForTarget
Diffstat (limited to 'src/render/Hud.cpp')
-rw-r--r--src/render/Hud.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp
index 1d6a6474..be7329e2 100644
--- a/src/render/Hud.cpp
+++ b/src/render/Hud.cpp
@@ -701,14 +701,7 @@ void CHud::Draw()
}
if (CTimer::GetFrameCounter() & 4 || !CounterFlashTimer) {
- if (CUserDisplay::OnscnTimer.m_sEntries[0].m_nType) {
- int counter = atoi(CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterBuffer);
-#ifdef FIX_BUGS
- counter = min(counter, 100);
-#endif
- CSprite2d::DrawRect(CRect(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2 + SCREEN_SCALE_X(4.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(8.0f), SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + SCREEN_SCALE_X(4.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(11.0f) + SCREEN_SCALE_Y(8.0f)), CRGBA(0, 106, 164, 80));
- CSprite2d::DrawRect(CRect(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2 + SCREEN_SCALE_X(4.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(8.0f), SCREEN_SCALE_X(counter) / 2.0f + SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET + 50.0f) + SCREEN_SCALE_X(4.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(11.0f) + SCREEN_SCALE_Y(8.0f)), CRGBA(0, 106, 164, 255));
- } else {
+ if (CUserDisplay::OnscnTimer.m_sEntries[0].m_nType == COUNTER_DISPLAY_NUMBER) {
AsciiToUnicode(CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterBuffer, sTimer);
CFont::SetPropOn();
@@ -728,6 +721,13 @@ void CHud::Draw()
CFont::SetColor(CRGBA(0, 106, 164, 255));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET), SCREEN_SCALE_Y(132.0f), sTimer);
+ } else {
+ int counter = atoi(CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterBuffer);
+#ifdef FIX_BUGS
+ counter = min(counter, 100);
+#endif
+ CSprite2d::DrawRect(CRect(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2 + SCREEN_SCALE_X(4.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(8.0f), SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) + SCREEN_SCALE_X(4.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(11.0f) + SCREEN_SCALE_Y(8.0f)), CRGBA(0, 106, 164, 80));
+ CSprite2d::DrawRect(CRect(SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET) - SCREEN_SCALE_X(100.0f) / 2 + SCREEN_SCALE_X(4.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(8.0f), SCREEN_SCALE_X(counter) / 2.0f + SCREEN_SCALE_FROM_RIGHT(TIMER_RIGHT_OFFSET + 50.0f) + SCREEN_SCALE_X(4.0f), SCREEN_SCALE_Y(132.0f) + SCREEN_SCALE_Y(11.0f) + SCREEN_SCALE_Y(8.0f)), CRGBA(0, 106, 164, 255));
}
if (CUserDisplay::OnscnTimer.m_sEntries[0].m_aCounterText[0]) {