Blocks atlas is auto-assembling now
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "../graphics/Texture.h"
|
||||
#include "../graphics/Shader.h"
|
||||
#include "../graphics/Atlas.h"
|
||||
#include "../graphics/Font.h"
|
||||
|
||||
Assets::~Assets() {
|
||||
@@ -16,6 +17,10 @@ Assets::~Assets() {
|
||||
for (auto& iter : fonts){
|
||||
delete iter.second;
|
||||
}
|
||||
|
||||
for (auto& iter : atlases) {
|
||||
delete iter.second;
|
||||
}
|
||||
}
|
||||
|
||||
Texture* Assets::getTexture(std::string name) const {
|
||||
@@ -52,3 +57,14 @@ Font* Assets::getFont(std::string name) const {
|
||||
void Assets::store(Font* font, std::string name){
|
||||
fonts[name] = font;
|
||||
}
|
||||
|
||||
Atlas* Assets::getAtlas(std::string name) const {
|
||||
auto found = atlases.find(name);
|
||||
if (found == atlases.end())
|
||||
return nullptr;
|
||||
return found->second;
|
||||
}
|
||||
|
||||
void Assets::store(Atlas* atlas, std::string name){
|
||||
atlases[name] = atlas;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user