diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-03-28 13:24:55 +0100 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-03-28 13:24:55 +0100 |
commit | 9fb101fdd96c82f73f8b09a75a2f248e1ccc0f18 (patch) | |
tree | 6e220fddfcabc63c477335fb1ddccefe7b6d5e0d /src/core/Timer.h | |
parent | garages part 1 (diff) | |
parent | remove include <new> from common.h (diff) | |
download | re3-9fb101fdd96c82f73f8b09a75a2f248e1ccc0f18.tar re3-9fb101fdd96c82f73f8b09a75a2f248e1ccc0f18.tar.gz re3-9fb101fdd96c82f73f8b09a75a2f248e1ccc0f18.tar.bz2 re3-9fb101fdd96c82f73f8b09a75a2f248e1ccc0f18.tar.lz re3-9fb101fdd96c82f73f8b09a75a2f248e1ccc0f18.tar.xz re3-9fb101fdd96c82f73f8b09a75a2f248e1ccc0f18.tar.zst re3-9fb101fdd96c82f73f8b09a75a2f248e1ccc0f18.zip |
Diffstat (limited to 'src/core/Timer.h')
-rw-r--r-- | src/core/Timer.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/Timer.h b/src/core/Timer.h index 89c4a430..ef525be7 100644 --- a/src/core/Timer.h +++ b/src/core/Timer.h @@ -2,7 +2,7 @@ class CTimer { -public: + static uint32 &m_snTimeInMilliseconds; static uint32 &m_snTimeInMillisecondsPauseMode; static uint32 &m_snTimeInMillisecondsNonClipped; @@ -11,19 +11,20 @@ public: static float &ms_fTimeScale; static float &ms_fTimeStep; static float &ms_fTimeStepNonClipped; +public: static bool &m_UserPause; static bool &m_CodePause; - static float GetTimeStep(void) { return ms_fTimeStep; } + static const float &GetTimeStep(void) { return ms_fTimeStep; } static void SetTimeStep(float ts) { ms_fTimeStep = ts; } static float GetTimeStepInSeconds() { return ms_fTimeStep / 50.0f; } static float GetTimeStepInMilliseconds() { return ms_fTimeStep / 50.0f * 1000.0f; } - static float GetTimeStepNonClipped(void) { return ms_fTimeStepNonClipped; } + static const float &GetTimeStepNonClipped(void) { return ms_fTimeStepNonClipped; } static float GetTimeStepNonClippedInSeconds(void) { return ms_fTimeStepNonClipped / 50.0f; } static void SetTimeStepNonClipped(float ts) { ms_fTimeStepNonClipped = ts; } - static uint32 GetFrameCounter(void) { return m_FrameCounter; } + static const uint32 &GetFrameCounter(void) { return m_FrameCounter; } static void SetFrameCounter(uint32 fc) { m_FrameCounter = fc; } - static uint32 GetTimeInMilliseconds(void) { return m_snTimeInMilliseconds; } + static const uint32 &GetTimeInMilliseconds(void) { return m_snTimeInMilliseconds; } static void SetTimeInMilliseconds(uint32 t) { m_snTimeInMilliseconds = t; } static uint32 GetTimeInMillisecondsNonClipped(void) { return m_snTimeInMillisecondsNonClipped; } static void SetTimeInMillisecondsNonClipped(uint32 t) { m_snTimeInMillisecondsNonClipped = t; } @@ -31,7 +32,7 @@ public: static void SetTimeInMillisecondsPauseMode(uint32 t) { m_snTimeInMillisecondsPauseMode = t; } static uint32 GetPreviousTimeInMilliseconds(void) { return m_snPreviousTimeInMilliseconds; } static void SetPreviousTimeInMilliseconds(uint32 t) { m_snPreviousTimeInMilliseconds = t; } - static float GetTimeScale(void) { return ms_fTimeScale; } + static const float &GetTimeScale(void) { return ms_fTimeScale; } static void SetTimeScale(float ts) { ms_fTimeScale = ts; } static bool GetIsPaused() { return m_UserPause || m_CodePause; } |