diff --git a/components/lua_ui/resources.cpp b/components/lua_ui/resources.cpp index 421375f9cb..92318a8a46 100644 --- a/components/lua_ui/resources.cpp +++ b/components/lua_ui/resources.cpp @@ -1,6 +1,7 @@ #include "resources.hpp" #include +#include namespace LuaUi { @@ -9,9 +10,7 @@ namespace LuaUi std::string normalizedPath = vfs()->normalizeFilename(data.mPath); if (!vfs()->exists(normalizedPath)) { - std::string error("Texture with path \""); - error += data.mPath; - error += "\" doesn't exist"; + auto error = Misc::StringUtils::format("Texture with path \"%s\" doesn't exist", data.mPath); throw std::logic_error(error); } data.mPath = normalizedPath; diff --git a/components/lua_ui/resources.hpp b/components/lua_ui/resources.hpp index 6bad0b0337..da9d566273 100644 --- a/components/lua_ui/resources.hpp +++ b/components/lua_ui/resources.hpp @@ -27,14 +27,16 @@ namespace LuaUi public: TextureResource(TextureData data) : mData(data) - {} + {} const TextureData& data() { return mData; } + private: TextureData mData; }; - class ResourceManager { + class ResourceManager + { public: ResourceManager(const VFS::Manager* vfs) : mVfs(vfs) @@ -42,10 +44,9 @@ namespace LuaUi std::shared_ptr registerTexture(TextureData data); - protected: + private: const VFS::Manager* vfs() const { return mVfs; } - private: const VFS::Manager* mVfs; using TextureResources = std::vector>; std::unordered_map mTextures;