summaryrefslogtreecommitdiffstats
path: root/src/Timer.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-05-31 19:18:18 +0200
committerGitHub <noreply@github.com>2019-05-31 19:18:18 +0200
commit7eee450a698cf3cee5e21da45477d7a308668e1c (patch)
tree392a32b7c35ad574879564487f52ed14d6d4ea5c /src/Timer.cpp
parentmore high level functions (diff)
parentrw skeleton (diff)
downloadre3-7eee450a698cf3cee5e21da45477d7a308668e1c.tar
re3-7eee450a698cf3cee5e21da45477d7a308668e1c.tar.gz
re3-7eee450a698cf3cee5e21da45477d7a308668e1c.tar.bz2
re3-7eee450a698cf3cee5e21da45477d7a308668e1c.tar.lz
re3-7eee450a698cf3cee5e21da45477d7a308668e1c.tar.xz
re3-7eee450a698cf3cee5e21da45477d7a308668e1c.tar.zst
re3-7eee450a698cf3cee5e21da45477d7a308668e1c.zip
Diffstat (limited to 'src/Timer.cpp')
-rw-r--r--src/Timer.cpp21
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;
}
}