Fix redone + add hud fix

This commit is contained in:
Sergeanur
2021-06-24 21:32:44 +03:00
parent cacec36dd1
commit f741101e44
6 changed files with 34 additions and 31 deletions
+8 -2
View File
@@ -18,6 +18,7 @@ bool CTimer::m_UserPause;
bool CTimer::m_CodePause;
#ifdef FIX_BUGS
uint32 CTimer::m_LogicalFrameCounter;
uint32 CTimer::m_LogicalFramesPassed;
#endif
uint32 _nCyclesPerMS = 1;
@@ -54,6 +55,7 @@ void CTimer::Initialise(void)
m_snTimeInMilliseconds = 1;
#ifdef FIX_BUGS
m_LogicalFrameCounter = 0;
m_LogicalFramesPassed = 0;
#endif
#ifdef _WIN32
@@ -109,12 +111,14 @@ void CTimer::Update(void)
frameTime = updInCyclesScaled / (double)_nCyclesPerMS;
#ifdef FIX_BUGS
m_LogicalFramesPassed = 0;
static double frameTimeLogical = 0.0;
frameTimeLogical += ((double)updInCycles / (double)_nCyclesPerMS);
while (frameTimeLogical >= 1000.0 / 30.0) {
frameTimeLogical -= 1000.0 / 30.0;
m_LogicalFrameCounter++;
m_LogicalFramesPassed++;
}
m_LogicalFrameCounter += m_LogicalFramesPassed;
#endif
m_snTimeInMillisecondsPauseMode = m_snTimeInMillisecondsPauseMode + frameTime;
@@ -142,12 +146,14 @@ void CTimer::Update(void)
frameTime = (double)updInMs * ms_fTimeScale;
#ifdef FIX_BUGS
m_LogicalFramesPassed = 0;
static double frameTimeLogical = 0.0;
frameTimeLogical += (double)updInMs;
while(frameTimeLogical >= 1000.0 / 30.0) {
frameTimeLogical -= 1000.0 / 30.0;
m_LogicalFrameCounter++;
m_LogicalFramesPassed++;
}
m_LogicalFrameCounter += m_LogicalFramesPassed;
#endif
oldPcTimer = timer;