diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-03-03 12:15:59 +0000 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-03-03 12:15:59 +0000 |
| commit | 66b8629964e6a5db214f582047e88ec70cf080a8 (patch) | |
| tree | b2fbd3e7ed19e11c433bb480f379f68d0b150aab /src/managers | |
| parent | 9e028d56c01aacc51904890bd5442ade3a2c7cdd (diff) | |
Update the debug overlay
Diffstat (limited to 'src/managers')
| -rw-r--r-- | src/managers/AnimationManager.cpp | 4 | ||||
| -rw-r--r-- | src/managers/AnimationManager.hpp | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp index c2708038..6a6fc799 100644 --- a/src/managers/AnimationManager.cpp +++ b/src/managers/AnimationManager.cpp @@ -35,6 +35,10 @@ void CAnimationManager::addBezierWithName(std::string name, const Vector2D& p1, void CAnimationManager::tick() { + static std::chrono::time_point lastTick = std::chrono::high_resolution_clock::now(); + m_fLastTickTime = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now() - lastTick).count() / 1000.0; + lastTick = std::chrono::high_resolution_clock::now(); + bool animGlobalDisabled = false; static auto* const PANIMENABLED = &g_pConfigManager->getConfigValuePtr("animations:enabled")->intValue; diff --git a/src/managers/AnimationManager.hpp b/src/managers/AnimationManager.hpp index 635d51eb..db7055c8 100644 --- a/src/managers/AnimationManager.hpp +++ b/src/managers/AnimationManager.hpp @@ -6,6 +6,7 @@ #include "../helpers/AnimatedVariable.hpp" #include "../helpers/BezierCurve.hpp" #include "../Window.hpp" +#include "../helpers/Timer.hpp" class CAnimationManager { public: @@ -28,6 +29,8 @@ class CAnimationManager { wl_event_source* m_pAnimationTick; + float m_fLastTickTime; // in ms + private: bool deltaSmallToFlip(const Vector2D& a, const Vector2D& b); bool deltaSmallToFlip(const CColor& a, const CColor& b); |
