1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-12-18 14:43:07 +00:00

Move code from components/lua_ui/resources.cpp to header

This commit is contained in:
elsid 2025-09-07 15:56:34 +02:00
parent 2c142faaa9
commit 60c7b3aa14
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40
2 changed files with 8 additions and 20 deletions

View file

@ -1,18 +0,0 @@
#include "resources.hpp"
#include <components/vfs/pathutil.hpp>
namespace LuaUi
{
std::shared_ptr<TextureResource> ResourceManager::registerTexture(TextureData data)
{
TextureResources& list = mTextures[data.mPath];
list.push_back(std::make_shared<TextureResource>(data));
return list.back();
}
void ResourceManager::clear()
{
mTextures.clear();
}
}

View file

@ -29,8 +29,14 @@ namespace LuaUi
class ResourceManager
{
public:
std::shared_ptr<TextureResource> registerTexture(TextureData data);
void clear();
std::shared_ptr<TextureResource> registerTexture(TextureData data)
{
TextureResources& list = mTextures[data.mPath];
list.push_back(std::make_shared<TextureResource>(std::move(data)));
return list.back();
}
void clear() { mTextures.clear(); }
private:
using TextureResources = std::vector<std::shared_ptr<TextureResource>>;