diff options
Diffstat (limited to 'src/helpers')
| -rw-r--r-- | src/helpers/AnimatedVariable.cpp | 3 | ||||
| -rw-r--r-- | src/helpers/Timer.cpp | 4 | ||||
| -rw-r--r-- | src/helpers/Timer.hpp | 7 |
3 files changed, 11 insertions, 3 deletions
diff --git a/src/helpers/AnimatedVariable.cpp b/src/helpers/AnimatedVariable.cpp index 2961439d..450826f9 100644 --- a/src/helpers/AnimatedVariable.cpp +++ b/src/helpers/AnimatedVariable.cpp @@ -82,8 +82,11 @@ float CAnimatedVariable::getCurveValue() { } void CAnimatedVariable::connectToActive() { + g_pAnimationManager->scheduleTick(); // otherwise the animation manager will never pick this up + if (!m_bIsConnectedToActive) g_pAnimationManager->m_vActiveAnimatedVariables.push_back(this); + m_bIsConnectedToActive = true; } diff --git a/src/helpers/Timer.cpp b/src/helpers/Timer.cpp index 33162d30..6847567a 100644 --- a/src/helpers/Timer.cpp +++ b/src/helpers/Timer.cpp @@ -14,4 +14,8 @@ int CTimer::getMillis() { float CTimer::getSeconds() { return std::chrono::duration_cast<std::chrono::milliseconds>(getDuration()).count() / 1000.f; +} + +const std::chrono::system_clock::time_point& CTimer::chrono() const { + return m_tpLastReset; }
\ No newline at end of file diff --git a/src/helpers/Timer.hpp b/src/helpers/Timer.hpp index 7b5bfc9d..4ab0d294 100644 --- a/src/helpers/Timer.hpp +++ b/src/helpers/Timer.hpp @@ -4,9 +4,10 @@ class CTimer { public: - void reset(); - float getSeconds(); - int getMillis(); + void reset(); + float getSeconds(); + int getMillis(); + const std::chrono::system_clock::time_point& chrono() const; private: std::chrono::system_clock::time_point m_tpLastReset; |
