summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-05-29 13:31:37 +0200
committerSergeanur <s.anureev@yandex.ua>2021-06-24 20:32:44 +0200
commitb90784da9060b6847d09bd18a15c690065b65214 (patch)
treebcfac29eeb04074cc9fc75d9df6ae45ff1f2a56a
parentFix redone + add hud fix (diff)
downloadre3-b90784da9060b6847d09bd18a15c690065b65214.tar
re3-b90784da9060b6847d09bd18a15c690065b65214.tar.gz
re3-b90784da9060b6847d09bd18a15c690065b65214.tar.bz2
re3-b90784da9060b6847d09bd18a15c690065b65214.tar.lz
re3-b90784da9060b6847d09bd18a15c690065b65214.tar.xz
re3-b90784da9060b6847d09bd18a15c690065b65214.tar.zst
re3-b90784da9060b6847d09bd18a15c690065b65214.zip
-rw-r--r--src/core/Timer.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/core/Timer.cpp b/src/core/Timer.cpp
index 5771274a..0c1875e9 100644
--- a/src/core/Timer.cpp
+++ b/src/core/Timer.cpp
@@ -121,16 +121,31 @@ void CTimer::Update(void)
m_LogicalFrameCounter += m_LogicalFramesPassed;
#endif
+#ifdef FIX_BUGS
+ static double frameTimeDouble = 0.0;
+ frameTimeDouble += frameTime;
+
+ m_snTimeInMillisecondsPauseMode += uint32(frameTimeDouble);
+#else
m_snTimeInMillisecondsPauseMode = m_snTimeInMillisecondsPauseMode + frameTime;
+#endif
if ( GetIsPaused() )
ms_fTimeStep = 0.0f;
else
{
+#ifdef FIX_BUGS
+ m_snTimeInMilliseconds += uint32(frameTimeDouble);
+ m_snTimeInMillisecondsNonClipped += uint32(frameTimeDouble);
+#else
m_snTimeInMilliseconds = m_snTimeInMilliseconds + frameTime;
m_snTimeInMillisecondsNonClipped = m_snTimeInMillisecondsNonClipped + frameTime;
+#endif
ms_fTimeStep = frameTime / 1000.0f * 50.0f;
}
+#ifdef FIX_BUGS
+ frameTimeDouble -= uint32(frameTimeDouble);
+#endif
}
else
#endif
@@ -158,16 +173,31 @@ void CTimer::Update(void)
oldPcTimer = timer;
+#ifdef FIX_BUGS
+ static double frameTimeDouble = 0.0;
+ frameTimeDouble += frameTime;
+
+ m_snTimeInMillisecondsPauseMode += uint32(frameTimeDouble);
+#else
m_snTimeInMillisecondsPauseMode = m_snTimeInMillisecondsPauseMode + frameTime;
+#endif
if ( GetIsPaused() )
ms_fTimeStep = 0.0f;
else
{
+#ifdef FIX_BUGS
+ m_snTimeInMilliseconds += uint32(frameTimeDouble);
+ m_snTimeInMillisecondsNonClipped += uint32(frameTimeDouble);
+#else
m_snTimeInMilliseconds = m_snTimeInMilliseconds + frameTime;
m_snTimeInMillisecondsNonClipped = m_snTimeInMillisecondsNonClipped + frameTime;
+#endif
ms_fTimeStep = frameTime / 1000.0f * 50.0f;
}
+#ifdef FIX_BUGS
+ frameTimeDouble -= uint32(frameTimeDouble);
+#endif
}
if ( ms_fTimeStep < 0.01f && !GetIsPaused() )