summaryrefslogtreecommitdiffstats
path: root/src/runtime/Qt3DSQmlEngine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/Qt3DSQmlEngine.cpp')
-rw-r--r--src/runtime/Qt3DSQmlEngine.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/runtime/Qt3DSQmlEngine.cpp b/src/runtime/Qt3DSQmlEngine.cpp
index 0bbc2a3..45fafc0 100644
--- a/src/runtime/Qt3DSQmlEngine.cpp
+++ b/src/runtime/Qt3DSQmlEngine.cpp
@@ -1670,7 +1670,23 @@ void CQmlEngineImpl::createMaterials(const QString &subPresId,
case qt3ds::render::NVRenderShaderDataTypes::NVRenderImage2DPtr: {
CRegisteredString regStr;
regStr = strTable.RegisterStr(propValStr);
- setDynamicObjectProperty(*dynObj, propDesc, regStr);
+ if (!regStr.IsValid())
+ break;
+
+ SImage *img = dynGraphObj->getImageByPropertyName(propDesc.m_Name);
+ if (!img) {
+ img = QT3DS_NEW(allocator, qt3ds::render::SImage)();
+ img->m_Id = strTable.RegisterStr(
+ QString::fromLatin1(newMatId.c_str()) + QLatin1Char('_')
+ + QString::fromLatin1(propDesc.m_Name.c_str()));
+ setDynamicObjectProperty(*dynObj, propDesc, img->m_Id);
+ dynGraphObj->setImage(propDesc.m_Name, img);
+ }
+ img->m_ImagePath = regStr;
+ img->m_MagFilter = propDesc.m_MagFilterOp;
+ img->m_MinFilter = propDesc.m_MinFilterOp;
+ img->m_HorizontalTilingMode = img->m_VerticalTilingMode = propDesc.m_CoordOp;
+ img->m_Flags.SetDirty(true);
break;
}
default: