mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 14:47:19 +02:00
Avoid setting null texs on uncaching models
This commit is contained in:
parent
d899d7d696
commit
fc19b60f8a
2 changed files with 3 additions and 2 deletions
|
@ -232,7 +232,7 @@ std::shared_ptr<NetworkGeometry> ModelCache::getGeometry(const QUrl& url, const
|
|||
GeometryExtra geometryExtra = { mapping, textureBaseUrl };
|
||||
GeometryResource::Pointer resource = getResource(url, QUrl(), true, &geometryExtra).staticCast<GeometryResource>();
|
||||
if (resource) {
|
||||
if (resource->isLoaded() && !resource->hasTextures()) {
|
||||
if (resource->isLoaded() && resource->shouldSetTextures()) {
|
||||
resource->setTextures();
|
||||
}
|
||||
return std::make_shared<NetworkGeometry>(resource);
|
||||
|
|
|
@ -107,7 +107,8 @@ protected:
|
|||
friend class GeometryMappingResource;
|
||||
|
||||
// Geometries may not hold onto textures while cached - that is for the texture cache
|
||||
bool hasTextures() const { return !_materials.empty(); }
|
||||
// Instead, these methods clear and reset textures from the geometry when caching/loading
|
||||
bool shouldSetTextures() const { return _geometry && _materials.empty(); }
|
||||
void setTextures();
|
||||
void resetTextures();
|
||||
|
||||
|
|
Loading…
Reference in a new issue