mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 00:13:53 +02:00
Cache renderable model orig texs as QVariantMap
This commit is contained in:
parent
0903e14b06
commit
0e9d696859
2 changed files with 3 additions and 1 deletions
|
@ -103,7 +103,7 @@ int RenderableModelEntityItem::readEntitySubclassDataFromBuffer(const unsigned c
|
|||
QVariantMap RenderableModelEntityItem::parseTexturesToMap(QString textures) {
|
||||
// If textures are unset, revert to original textures
|
||||
if (textures == "") {
|
||||
return parseTexturesToMap(_originalTextures.join(",\n"));
|
||||
return _originalTexturesMap;
|
||||
}
|
||||
|
||||
QString jsonTextures = "{\"" + textures.replace(":\"", "\":\"").replace(",\n", ",\"") + "}";
|
||||
|
@ -129,6 +129,7 @@ void RenderableModelEntityItem::remapTextures() {
|
|||
const QSharedPointer<NetworkGeometry>& networkGeometry = _model->getGeometry();
|
||||
if (networkGeometry) {
|
||||
_originalTextures = networkGeometry->getTextureNames();
|
||||
_originalTexturesMap = parseTexturesToMap(_originalTextures.join(",\n"));
|
||||
_originalTexturesRead = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,6 +92,7 @@ private:
|
|||
EntityTreeRenderer* _myRenderer = nullptr;
|
||||
QString _currentTextures;
|
||||
QStringList _originalTextures;
|
||||
QVariantMap _originalTexturesMap;
|
||||
bool _originalTexturesRead = false;
|
||||
QVector<QVector<glm::vec3>> _points;
|
||||
bool _dimensionsInitialized = true;
|
||||
|
|
Loading…
Reference in a new issue