UiDocument is an asset now

This commit is contained in:
MihailRis
2024-02-09 09:59:36 +03:00
parent 241d15e349
commit 07adbd04ea
21 changed files with 402 additions and 304 deletions
+12
View File
@@ -4,6 +4,7 @@
#include "../graphics/Shader.h"
#include "../graphics/Atlas.h"
#include "../graphics/Font.h"
#include "../frontend/UiDocument.h"
Assets::~Assets() {
}
@@ -62,6 +63,17 @@ void Assets::store(const TextureAnimation& animation) {
animations.emplace_back(animation);
}
UiDocument* Assets::getLayout(std::string name) const {
auto found = layouts.find(name);
if (found == layouts.end())
return nullptr;
return found->second.get();
}
void Assets::store(UiDocument* layout, std::string name) {
layouts[name].reset(layout);
}
void Assets::extend(const Assets& assets) {
for (auto entry : assets.textures) {
textures[entry.first] = entry.second;