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:
parent
2c142faaa9
commit
60c7b3aa14
2 changed files with 8 additions and 20 deletions
|
|
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -29,8 +29,14 @@ namespace LuaUi
|
||||||
class ResourceManager
|
class ResourceManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
std::shared_ptr<TextureResource> registerTexture(TextureData data);
|
std::shared_ptr<TextureResource> registerTexture(TextureData data)
|
||||||
void clear();
|
{
|
||||||
|
TextureResources& list = mTextures[data.mPath];
|
||||||
|
list.push_back(std::make_shared<TextureResource>(std::move(data)));
|
||||||
|
return list.back();
|
||||||
|
}
|
||||||
|
|
||||||
|
void clear() { mTextures.clear(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
using TextureResources = std::vector<std::shared_ptr<TextureResource>>;
|
using TextureResources = std::vector<std::shared_ptr<TextureResource>>;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue