mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 18:36:45 +02:00
Get remap textures through getter
This commit is contained in:
parent
b72c28854c
commit
e4f12c81e0
1 changed files with 3 additions and 4 deletions
|
@ -117,12 +117,11 @@ QVariantMap RenderableModelEntityItem::parseTexturesToMap(QString textures) {
|
||||||
QJsonParseError error;
|
QJsonParseError error;
|
||||||
QJsonDocument texturesJson = QJsonDocument::fromJson(textures.toUtf8(), &error);
|
QJsonDocument texturesJson = QJsonDocument::fromJson(textures.toUtf8(), &error);
|
||||||
if (error.error != QJsonParseError::NoError) {
|
if (error.error != QJsonParseError::NoError) {
|
||||||
qCWarning(entitiesrenderer) << "Could not evaluate textures property value:" << _textures;
|
qCWarning(entitiesrenderer) << "Could not evaluate textures property value:" << textures;
|
||||||
return _originalTextures;
|
return _originalTextures;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto parsed = texturesJson.toVariant();
|
return texturesJson.toVariant().toMap();
|
||||||
return parsed.toMap();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderableModelEntityItem::remapTextures() {
|
void RenderableModelEntityItem::remapTextures() {
|
||||||
|
@ -144,7 +143,7 @@ void RenderableModelEntityItem::remapTextures() {
|
||||||
_currentTextures = _originalTextures;
|
_currentTextures = _originalTextures;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto textures = parseTexturesToMap(_textures);
|
auto textures = parseTexturesToMap(getTextures());
|
||||||
|
|
||||||
if (textures != _currentTextures) {
|
if (textures != _currentTextures) {
|
||||||
geometry->setTextures(textures);
|
geometry->setTextures(textures);
|
||||||
|
|
Loading…
Reference in a new issue