mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
fix: util::get_texture_region
This commit is contained in:
parent
d3c45fbabc
commit
761afe51a5
1 changed files with 5 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue