2022-02-07 22:37:08 +00:00
|
|
|
#include "resources.hpp"
|
|
|
|
|
2023-05-31 21:11:03 +00:00
|
|
|
#include <components/vfs/pathutil.hpp>
|
2022-02-07 22:37:08 +00:00
|
|
|
|
|
|
|
namespace LuaUi
|
|
|
|
{
|
|
|
|
std::shared_ptr<TextureResource> ResourceManager::registerTexture(TextureData data)
|
|
|
|
{
|
2023-05-31 21:11:03 +00:00
|
|
|
VFS::Path::normalizeFilenameInPlace(data.mPath);
|
2022-03-22 05:41:26 +00:00
|
|
|
|
|
|
|
TextureResources& list = mTextures[data.mPath];
|
2022-02-07 22:37:08 +00:00
|
|
|
list.push_back(std::make_shared<TextureResource>(data));
|
|
|
|
return list.back();
|
|
|
|
}
|
2022-02-26 11:10:55 +00:00
|
|
|
|
|
|
|
void ResourceManager::clear()
|
|
|
|
{
|
|
|
|
mTextures.clear();
|
|
|
|
}
|
2022-02-07 22:37:08 +00:00
|
|
|
}
|