fix: util::get_texture_region

This commit is contained in:
MihailRis 2025-05-24 19:26:57 +03:00
parent d3c45fbabc
commit 761afe51a5

View File

@ -9,7 +9,11 @@ util::TextureRegion util::get_texture_region(
) {
size_t sep = name.find(':');
if (sep == std::string::npos) {
return {assets.get<Texture>(name), UVRegion(0,0,1,1)};
auto texture = assets.get<Texture>(name);
if (texture == nullptr && !fallback.empty()) {
return util::get_texture_region(assets, fallback, "");
}
return {texture, UVRegion(0,0,1,1)};
} else {
auto atlas = assets.get<Atlas>(name.substr(0, sep));
if (atlas) {