diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-08 19:49:41 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-08 19:49:41 +0100 |
commit | 519cc5d16e65ff501d330c03eeb35d2d095ead29 (patch) | |
tree | 3c7c3a64c922ec248f4136d1282530a6ec6647ac /src/crepe/manager | |
parent | 63bcd54e0e0ea64cfef5950568b4253d5dae5c1e (diff) |
made sdlcontext not a singleton anymore
Diffstat (limited to 'src/crepe/manager')
-rw-r--r-- | src/crepe/manager/Mediator.h | 4 | ||||
-rw-r--r-- | src/crepe/manager/ResourceManager.hpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/crepe/manager/Mediator.h b/src/crepe/manager/Mediator.h index 6a9e113..bb51d6b 100644 --- a/src/crepe/manager/Mediator.h +++ b/src/crepe/manager/Mediator.h @@ -5,7 +5,6 @@ // TODO: remove these singletons: #include "EventManager.h" #include "SaveManager.h" -#include "api/LoopTimer.h" namespace crepe { @@ -13,6 +12,7 @@ class ComponentManager; class SceneManager; class ResourceManager; class SDLContext; +class LoopTimer; /** * Struct to pass references to classes that would otherwise need to be singletons down to @@ -33,7 +33,7 @@ struct Mediator { OptionalRef<SaveManager> save_manager = SaveManager::get_instance(); OptionalRef<EventManager> event_manager = EventManager::get_instance(); OptionalRef<ResourceManager> resource_manager; - OptionalRef<LoopTimer> timer = LoopTimer::get_instance(); + OptionalRef<LoopTimer> timer; }; } // namespace crepe diff --git a/src/crepe/manager/ResourceManager.hpp b/src/crepe/manager/ResourceManager.hpp index 5167d71..cf5c949 100644 --- a/src/crepe/manager/ResourceManager.hpp +++ b/src/crepe/manager/ResourceManager.hpp @@ -13,7 +13,7 @@ T & ResourceManager::get(const Asset & asset) { "cache must recieve a derivative class of Resource"); CacheEntry & entry = this->get_entry(asset); - if (entry.resource == nullptr) entry.resource = make_unique<T>(asset); + if (entry.resource == nullptr) entry.resource = make_unique<T>(asset, this->mediator); T * concrete_resource = dynamic_cast<T *>(entry.resource.get()); if (concrete_resource == nullptr) |