aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/resource_manager.h
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-10-02 15:57:59 +0200
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-10-02 15:57:59 +0200
commitde2c2593f9f272c5151d74af4ff846fdd70a9bc7 (patch)
tree4001a60809734a60b75e39da5c994d9381b6efe2 /src/crepe/api/resource_manager.h
parent41bd601ef62d967c80cc0591eaf6b4290baae425 (diff)
working resource manager and textures and sprite to new standard
Diffstat (limited to 'src/crepe/api/resource_manager.h')
-rw-r--r--src/crepe/api/resource_manager.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/crepe/api/resource_manager.h b/src/crepe/api/resource_manager.h
index 5b0e0e1..a646d95 100644
--- a/src/crepe/api/resource_manager.h
+++ b/src/crepe/api/resource_manager.h
@@ -7,19 +7,17 @@
#include <unordered_map>
#include <utility>
+#include "api/baseResource.h"
-#include "Resource.h"
-#include "fabricator/resource_fabricator.h"
-
- namespace crepe::api{
+namespace crepe::api{
class ResourceManager{
private:
- std::unordered_map< std::string, std::unique_ptr<api::Resource>> m_resources;
+ std::unordered_map< std::string, std::unique_ptr<BaseResource>> m_resources;
protected:
@@ -44,10 +42,10 @@ public:
return static_cast<T*>(m_resources[file_path].get());
}
- std::unique_ptr<api::Resource> resource = ResourceFactory::create_resource<T>(file_path);
+ auto resource = std::make_unique<T>(file_path.c_str());
if (resource) {
m_resources[file_path] = std::move(resource);
- return static_cast<T*>(m_resources[file_path].get() );
+ return static_cast<T*>(m_resources[file_path].get() );
}
return nullptr;