voxels renderer rebuilt, WorldFiles fix

This commit is contained in:
MihailRis 2023-11-02 13:23:52 +03:00 • committed by GitHub
parent 0576316282
commit 754c5b80d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 1141 additions and 524 deletions

View file

@ -18,8 +18,11 @@ Assets::~Assets() {
}
}
Texture* Assets::getTexture(std::string name){
return textures[name];
Texture* Assets::getTexture(std::string name) const {
auto found = textures.find(name);
if (found == textures.end())
return nullptr;
return found->second;
}
void Assets::store(Texture* texture, std::string name){
@ -27,8 +30,11 @@ void Assets::store(Texture* texture, std::string name){
}
Shader* Assets::getShader(std::string name){
return shaders[name];
Shader* Assets::getShader(std::string name) const{
auto found = shaders.find(name);
if (found == shaders.end())
return nullptr;
return found->second;
}
void Assets::store(Shader* shader, std::string name){
@ -36,8 +42,11 @@ void Assets::store(Shader* shader, std::string name){
}
Font* Assets::getFont(std::string name){
return fonts[name];
Font* Assets::getFont(std::string name) const {
auto found = fonts.find(name);
if (found == fonts.end())
return nullptr;
return found->second;
}
void Assets::store(Font* font, std::string name){