fix: util::get_texture_region
This commit is contained in:
parent
d3c45fbabc
commit
761afe51a5
@ -9,7 +9,11 @@ util::TextureRegion util::get_texture_region(
|
|||||||
) {
|
) {
|
||||||
size_t sep = name.find(':');
|
size_t sep = name.find(':');
|
||||||
if (sep == std::string::npos) {
|
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 {
|
} else {
|
||||||
auto atlas = assets.get<Atlas>(name.substr(0, sep));
|
auto atlas = assets.get<Atlas>(name.substr(0, sep));
|
||||||
if (atlas) {
|
if (atlas) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user