mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
26 lines
610 B
C++
26 lines
610 B
C++
#include "Assets.hpp"
|
|
#include "AssetsLoader.hpp"
|
|
#include "io/path.hpp"
|
|
|
|
Assets::Assets(util::ObjectsKeeper* vault) : vault(vault), assetsLoadInfo(std::make_unique<AssetsLoadInfo>()) {
|
|
}
|
|
|
|
Assets::~Assets() {
|
|
if (vault == nullptr) {
|
|
return;
|
|
}
|
|
for (auto& [_, map] : assets) {
|
|
for (auto& [__, asset] : map) {
|
|
vault->keepAlive(std::move(asset));
|
|
}
|
|
map.clear();
|
|
}
|
|
}
|
|
|
|
const std::vector<TextureAnimation>& Assets::getAnimations() {
|
|
return animations;
|
|
}
|
|
|
|
void Assets::store(const TextureAnimation& animation) {
|
|
animations.emplace_back(animation);
|
|
}
|