diff options
author | Fire-Head <Fire-Head@users.noreply.github.com> | 2019-05-31 19:02:26 +0200 |
---|---|---|
committer | Fire-Head <Fire-Head@users.noreply.github.com> | 2019-05-31 19:02:26 +0200 |
commit | 28fce310d5cb9a3a81e0f038192a39abd688d1bd (patch) | |
tree | 392a32b7c35ad574879564487f52ed14d6d4ea5c /src/Timer.cpp | |
parent | more high level functions (diff) | |
download | re3-28fce310d5cb9a3a81e0f038192a39abd688d1bd.tar re3-28fce310d5cb9a3a81e0f038192a39abd688d1bd.tar.gz re3-28fce310d5cb9a3a81e0f038192a39abd688d1bd.tar.bz2 re3-28fce310d5cb9a3a81e0f038192a39abd688d1bd.tar.lz re3-28fce310d5cb9a3a81e0f038192a39abd688d1bd.tar.xz re3-28fce310d5cb9a3a81e0f038192a39abd688d1bd.tar.zst re3-28fce310d5cb9a3a81e0f038192a39abd688d1bd.zip |
Diffstat (limited to 'src/Timer.cpp')
-rw-r--r-- | src/Timer.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/Timer.cpp b/src/Timer.cpp index 69dd2881..c4609d7f 100644 --- a/src/Timer.cpp +++ b/src/Timer.cpp @@ -26,13 +26,6 @@ LARGE_INTEGER perfSuspendCounter; UInt32 suspendDepth; -_TODO("We need skeleton.c for RsTimer()"); - -RwUInt32 RsTimer(void) -{ - return ((RwUInt32 (__cdecl *)())0x584890)(); -} - void CTimer::Initialise(void) { debug("Initialising CTimer...\n"); @@ -86,7 +79,7 @@ void CTimer::Update(void) LARGE_INTEGER pc; QueryPerformanceCounter(&pc); - Int64 updInCycles = (pc.LowPart - _oldPerfCounter.LowPart) & 0x7FFFFFFF; + Int32 updInCycles = (pc.LowPart - _oldPerfCounter.LowPart) & 0x7FFFFFFF; _oldPerfCounter = pc; @@ -94,14 +87,14 @@ void CTimer::Update(void) Double upd = updInCyclesScaled / (Double)_nCyclesPerMS; - m_snTimeInMillisecondsPauseMode += Int64(upd); + m_snTimeInMillisecondsPauseMode = (Int64)(m_snTimeInMillisecondsPauseMode + upd); if ( GetIsPaused() ) ms_fTimeStep = 0.0f; else { - m_snTimeInMilliseconds = Int64(upd); - m_snTimeInMillisecondsNonClipped += Int64(upd); + m_snTimeInMilliseconds = (Int64)(m_snTimeInMilliseconds + upd); + m_snTimeInMillisecondsNonClipped = (Int64)(m_snTimeInMillisecondsNonClipped + upd); ms_fTimeStep = updInCyclesScaled / (Double)_nCyclesPerMS / 20.0; } } @@ -115,14 +108,14 @@ void CTimer::Update(void) oldPcTimer = timer; - m_snTimeInMillisecondsPauseMode += Int64(upd); + m_snTimeInMillisecondsPauseMode = (Int64)(m_snTimeInMillisecondsPauseMode + upd); if ( GetIsPaused() ) ms_fTimeStep = 0.0f; else { - m_snTimeInMilliseconds += Int64(upd); - m_snTimeInMillisecondsNonClipped += Int64(upd); + m_snTimeInMilliseconds = (Int64)(m_snTimeInMilliseconds + upd); + m_snTimeInMillisecondsNonClipped = (Int64)(m_snTimeInMillisecondsNonClipped + upd); ms_fTimeStep = upd / 1000.0f * 50.0f; } } |