From e62817b8252974b8a98393275874ee303840bf13 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Fri, 12 May 2017 18:49:50 +0500 Subject: 2017-05-12 --- graphics/AssetManager.hpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'graphics/AssetManager.hpp') diff --git a/graphics/AssetManager.hpp b/graphics/AssetManager.hpp index 81be7c4..b2ff570 100644 --- a/graphics/AssetManager.hpp +++ b/graphics/AssetManager.hpp @@ -2,19 +2,15 @@ #include #include -#include #include #include "../json.hpp" +#include "Texture.hpp" struct Asset { std::string name = ""; std::string hash = ""; union AssetData{ - struct TextureData{ - int width; - int height; - unsigned char *imageData; - } texture; + Texture *texture; } data; size_t size = 0; enum AssetType { @@ -38,12 +34,15 @@ class AssetManager { AssetManager &operator=(const AssetManager &); std::map assets; -public: + static AssetManager &instance() { static AssetManager assetManager; return assetManager; } + static std::string GetPathToAsset(std::string AssetName); +public: + static Asset &GetAsset(std::string AssetName); static void LoadAsset(std::string AssetName); -- cgit v1.2.3