Silence missing placeholder tile textures

This commit is contained in:
2026-06-09 23:41:47 +08:00
parent 51a3776494
commit e1429f3046
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -6,6 +6,7 @@
#include <frostbite2D/graphics/renderer.h>
#include <frostbite2D/graphics/types.h>
#include <frostbite2D/graphics/texture.h>
#include <frostbite2D/resource/asset.h>
namespace ns_game {
@@ -174,6 +175,11 @@ StageRenderer::getTexture(const std::string& texturePath) const {
return existing->second;
}
if (!frostbite2D::Asset::get().exists(texturePath)) {
textureCache_[texturePath] = nullptr;
return nullptr;
}
frostbite2D::Ptr<frostbite2D::Texture> texture =
frostbite2D::Texture::loadFromFile(texturePath);
if (texture) {