mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 20:33:27 +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
libraries/entities-renderer/src
|
@ -143,11 +143,17 @@ void RenderableModelEntityItem::remapTextures() {
|
|||
_currentTextures = _originalTextures;
|
||||
}
|
||||
|
||||
auto textures = parseTexturesToMap(getTextures());
|
||||
auto textures = getTextures();
|
||||
if (textures == _lastTextures) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (textures != _currentTextures) {
|
||||
geometry->setTextures(textures);
|
||||
_currentTextures = textures;
|
||||
_lastTextures = textures;
|
||||
auto newTextures = parseTexturesToMap(textures);
|
||||
|
||||
if (newTextures != _currentTextures) {
|
||||
geometry->setTextures(newTextures);
|
||||
_currentTextures = newTextures;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -90,6 +90,7 @@ private:
|
|||
bool _needsInitialSimulation = true;
|
||||
bool _needsModelReload = true;
|
||||
EntityTreeRenderer* _myRenderer = nullptr;
|
||||
QString _lastTextures;
|
||||
QVariantMap _currentTextures;
|
||||
QVariantMap _originalTextures;
|
||||
bool _originalTexturesRead = false;
|
||||
|
|
Loading…
Reference in a new issue