mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
fix Image for non-existing textures in atlas
This commit is contained in:
parent
2dffdf757c
commit
71c754b039
4 changed files with 22 additions and 9 deletions
|
|
@ -34,6 +34,14 @@ const UVRegion& Atlas::get(const std::string& name) const {
|
|||
return regions.at(name);
|
||||
}
|
||||
|
||||
std::optional<UVRegion> Atlas::getIf(const std::string& name) const {
|
||||
const auto& found = regions.find(name);
|
||||
if (found == regions.end()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
return found->second;
|
||||
}
|
||||
|
||||
Texture* Atlas::getTexture() const {
|
||||
return texture.get();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue