aboutsummaryrefslogtreecommitdiff
path: root/src/ui/animations
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/animations')
-rw-r--r--src/ui/animations/animation.cpp10
-rw-r--r--src/ui/animations/animation.hpp10
2 files changed, 13 insertions, 7 deletions
diff --git a/src/ui/animations/animation.cpp b/src/ui/animations/animation.cpp
index 33c743cf..b1f92a3e 100644
--- a/src/ui/animations/animation.cpp
+++ b/src/ui/animations/animation.cpp
@@ -2,6 +2,8 @@
#include <utility>
+#include "application.hpp"
+
namespace cru::ui::animations
{
namespace details
@@ -66,6 +68,14 @@ namespace cru::ui::animations
AnimationTimeUnit current_time_ = AnimationTimeUnit::zero();
};
+ AnimationManager* AnimationManager::GetInstance()
+ {
+ return Application::GetInstance()->ResolveSingleton<AnimationManager>([](auto)
+ {
+ return new AnimationManager{};
+ });
+ }
+
AnimationManager::AnimationManager()
{
diff --git a/src/ui/animations/animation.hpp b/src/ui/animations/animation.hpp
index 99389f33..f25e4699 100644
--- a/src/ui/animations/animation.hpp
+++ b/src/ui/animations/animation.hpp
@@ -3,7 +3,6 @@
#include <unordered_map>
#include "base.hpp"
-#include "application.hpp"
#include "timer.hpp"
namespace cru::ui::animations
@@ -53,13 +52,10 @@ namespace cru::ui::animations
class AnimationManager : public Object
{
public:
- static AnimationManager* GetInstance()
- {
- return Application::GetInstance()->GetAnimationManager();
- }
-
- public:
+ static AnimationManager* GetInstance();
+ private:
AnimationManager();
+ public:
AnimationManager(const AnimationManager& other) = delete;
AnimationManager(AnimationManager&& other) = delete;
AnimationManager& operator=(const AnimationManager& other) = delete;