diff options
author | Antti Määttä <antti.maatta@qt.io> | 2020-09-24 12:45:10 +0300 |
---|---|---|
committer | Antti Määttä <antti.maatta@qt.io> | 2020-10-14 12:25:54 +0300 |
commit | ef7e3400211d275077596dd848898adb876efb6e (patch) | |
tree | f712f9c28502deb6794e70e2ca6fd77e4d938703 /src/runtime | |
parent | 830d97fda90783e278c0e0ea99ec286e6e7b96e2 (diff) |
Use images with dynamic object textures
Task-number: QT3DS-4063
Change-Id: Ia07f21be65ebda9733773504eb2e0ddce4009fab
Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src/runtime')
-rw-r--r-- | src/runtime/Qt3DSElementSystem.cpp | 15 | ||||
-rw-r--r-- | src/runtime/Qt3DSElementSystem.h | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/runtime/Qt3DSElementSystem.cpp b/src/runtime/Qt3DSElementSystem.cpp index 8954ae4..3234e09 100644 --- a/src/runtime/Qt3DSElementSystem.cpp +++ b/src/runtime/Qt3DSElementSystem.cpp @@ -44,6 +44,8 @@ #include "foundation/IOStreams.h" #include "foundation/Qt3DSIndexableLinkedList.h" #include "Qt3DSAnimationSystem.h" +#include "Qt3DSRenderRuntimeBindingImpl.h" +#include "Qt3DSRenderGraphObject.h" using namespace qt3ds::runtime::element; using namespace qt3ds; @@ -474,6 +476,19 @@ struct SElementAllocator : public qt3ds::runtime::IElementAllocator return NULL; } + SElement *FindElementById(CRegisteredString elementId) override + { + auto iter = m_HandleToElements.begin(); + auto end = m_HandleToElements.end(); + for (; iter != end; iter++) { + SElement *elem = iter->second; + auto *translator = static_cast<Qt3DSTranslator *>(elem->GetAssociation()); + if (translator && translator->RenderObject().m_Id == elementId) + return elem; + } + return nullptr; + } + // Returns an element pointer that when added to the return value of load will be a valid // element. SElement *GetRemappedElementAddress(SElement *inElement) const override diff --git a/src/runtime/Qt3DSElementSystem.h b/src/runtime/Qt3DSElementSystem.h index d8790d7..6eb95a9 100644 --- a/src/runtime/Qt3DSElementSystem.h +++ b/src/runtime/Qt3DSElementSystem.h @@ -657,6 +657,7 @@ namespace runtime { CRegisteredString inName) = 0; virtual element::SElement *FindElementByHandle(QT3DSU32 inElementHandle) = 0; + virtual element::SElement *FindElementById(CRegisteredString elementId) = 0; // Returns an element pointer that when added to the return value of load will be a valid // element. virtual element::SElement * |