mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 00:44:38 +02:00
Avoid JSON parsing texs every render cycle
This commit is contained in:
parent
54b8a9278d
commit
01db2be6b8
2 changed files with 11 additions and 4 deletions
|
@ -143,11 +143,17 @@ void RenderableModelEntityItem::remapTextures() {
|
||||||
_currentTextures = _originalTextures;
|
_currentTextures = _originalTextures;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto textures = parseTexturesToMap(getTextures());
|
auto textures = getTextures();
|
||||||
|
if (textures == _lastTextures) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (textures != _currentTextures) {
|
_lastTextures = textures;
|
||||||
geometry->setTextures(textures);
|
auto newTextures = parseTexturesToMap(textures);
|
||||||
_currentTextures = textures;
|
|
||||||
|
if (newTextures != _currentTextures) {
|
||||||
|
geometry->setTextures(newTextures);
|
||||||
|
_currentTextures = newTextures;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,7 @@ private:
|
||||||
bool _needsInitialSimulation = true;
|
bool _needsInitialSimulation = true;
|
||||||
bool _needsModelReload = true;
|
bool _needsModelReload = true;
|
||||||
EntityTreeRenderer* _myRenderer = nullptr;
|
EntityTreeRenderer* _myRenderer = nullptr;
|
||||||
|
QString _lastTextures;
|
||||||
QVariantMap _currentTextures;
|
QVariantMap _currentTextures;
|
||||||
QVariantMap _originalTextures;
|
QVariantMap _originalTextures;
|
||||||
bool _originalTexturesRead = false;
|
bool _originalTexturesRead = false;
|
||||||
|
|
Loading…
Reference in a new issue