2022-02-07 23:37:08 +01:00
|
|
|
#include "resources.hpp"
|
|
|
|
|
|
|
|
#include <components/vfs/manager.hpp>
|
2022-02-21 15:57:40 +01:00
|
|
|
#include <components/misc/stringops.hpp>
|
2022-02-07 23:37:08 +01:00
|
|
|
|
|
|
|
namespace LuaUi
|
|
|
|
{
|
|
|
|
std::shared_ptr<TextureResource> ResourceManager::registerTexture(TextureData data)
|
|
|
|
{
|
2022-03-22 05:41:26 +00:00
|
|
|
data.mPath = mVfs->normalizeFilename(data.mPath);
|
|
|
|
|
|
|
|
TextureResources& list = mTextures[data.mPath];
|
2022-02-07 23:37:08 +01:00
|
|
|
list.push_back(std::make_shared<TextureResource>(data));
|
|
|
|
return list.back();
|
|
|
|
}
|
2022-02-26 12:10:55 +01:00
|
|
|
|
|
|
|
void ResourceManager::clear()
|
|
|
|
{
|
|
|
|
mTextures.clear();
|
|
|
|
}
|
2022-02-07 23:37:08 +01:00
|
|
|
}
|