summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-02-01 16:22:56 +0100
committerSergeanur <s.anureev@yandex.ua>2020-02-01 16:22:56 +0100
commite2f8ad983d83b09b8ec12d87ff946c6387b5ffc6 (patch)
treeefa664a4845f9c193b75e9805226d0095e560370 /src
parentFix CTheScripts::AddToInvisibilitySwapArray (diff)
downloadre3-e2f8ad983d83b09b8ec12d87ff946c6387b5ffc6.tar
re3-e2f8ad983d83b09b8ec12d87ff946c6387b5ffc6.tar.gz
re3-e2f8ad983d83b09b8ec12d87ff946c6387b5ffc6.tar.bz2
re3-e2f8ad983d83b09b8ec12d87ff946c6387b5ffc6.tar.lz
re3-e2f8ad983d83b09b8ec12d87ff946c6387b5ffc6.tar.xz
re3-e2f8ad983d83b09b8ec12d87ff946c6387b5ffc6.tar.zst
re3-e2f8ad983d83b09b8ec12d87ff946c6387b5ffc6.zip
Diffstat (limited to 'src')
-rw-r--r--src/control/OnscreenTimer.cpp3
-rw-r--r--src/render/Hud.cpp6
2 files changed, 5 insertions, 4 deletions
diff --git a/src/control/OnscreenTimer.cpp b/src/control/OnscreenTimer.cpp
index 489d8077..12aa2923 100644
--- a/src/control/OnscreenTimer.cpp
+++ b/src/control/OnscreenTimer.cpp
@@ -151,9 +151,6 @@ void COnscreenTimerEntry::ProcessForDisplayClock() {
void COnscreenTimerEntry::ProcessForDisplayCounter() {
uint32 counter = *(uint32*)&CTheScripts::ScriptSpace[m_nCounterOffset];
-
- assert(!m_nType || counter <= 100);
-
sprintf(m_bCounterBuffer, "%d", counter);
}
diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp
index 4d1a857a..1d6a6474 100644
--- a/src/render/Hud.cpp
+++ b/src/render/Hud.cpp
@@ -702,8 +702,12 @@ 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(atoi(CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterBuffer) / 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));
+ 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 {
AsciiToUnicode(CUserDisplay::OnscnTimer.m_sEntries[0].m_bCounterBuffer, sTimer);
CFont::SetPropOn();