mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
Blocks atlas is auto-assembling now
This commit is contained in:
parent
ea5c117652
commit
fb8d220cca
41 changed files with 622 additions and 75 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue