#ifndef OPENMW_LUAUI_RESOURCES #define OPENMW_LUAUI_RESOURCES #include #include #include #include #include namespace VFS { class Manager; } namespace LuaUi { struct TextureData { std::string mPath; osg::Vec2f mOffset; osg::Vec2f mSize; }; class TextureResource { public: TextureResource(TextureData data) : mData(data) {} const TextureData& data() { return mData; } private: TextureData mData; }; class ResourceManager { public: ResourceManager(const VFS::Manager* vfs) : mVfs(vfs) {} std::shared_ptr registerTexture(TextureData data); protected: const VFS::Manager* vfs() const { return mVfs; } private: const VFS::Manager* mVfs; using TextureResources = std::vector>; std::unordered_map mTextures; }; } #endif // OPENMW_LUAUI_LAYERS