#include "resources.hpp" #include #include namespace LuaUi { std::shared_ptr ResourceManager::registerTexture(TextureData data) { std::string normalizedPath = vfs()->normalizeFilename(data.mPath); if (!vfs()->exists(normalizedPath)) { auto error = Misc::StringUtils::format("Texture with path \"%s\" doesn't exist", data.mPath); throw std::logic_error(error); } data.mPath = normalizedPath; TextureResources& list = mTextures[normalizedPath]; list.push_back(std::make_shared(data)); return list.back(); } }