diff options
author | Janne Kangas <janne.kangas@qt.io> | 2019-10-08 12:32:11 +0300 |
---|---|---|
committer | Janne Kangas <janne.kangas@qt.io> | 2019-11-20 16:09:24 +0200 |
commit | 3f979b61f06bb536875b24bb149fc6216555e830 (patch) | |
tree | 11705bb316190eaf080c3a64da336329a5b6849c | |
parent | 23146bfe5641cb35eb73235f9dddfba99ebfaf76 (diff) |
Always handle datainput-driven activity changes
Handle datainput-driven eyeball (activity) change always regardless of
element activation status in activation manager.
Task-id: QT3DS-4003
Change-Id: I6ca0ec834d2ccbc3850c0b2849caee058b2d778d
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r-- | src/runtime/Qt3DSActivationManager.cpp | 6 | ||||
-rw-r--r-- | src/runtime/Qt3DSElementSystem.cpp | 7 | ||||
-rw-r--r-- | src/runtime/Qt3DSKernelTypes.h | 2 |
3 files changed, 11 insertions, 4 deletions
diff --git a/src/runtime/Qt3DSActivationManager.cpp b/src/runtime/Qt3DSActivationManager.cpp index 6d35f4d..8025121 100644 --- a/src/runtime/Qt3DSActivationManager.cpp +++ b/src/runtime/Qt3DSActivationManager.cpp @@ -591,7 +591,11 @@ struct STimeContext if (activateChange) { HandleActivationChange(*theScanNode, activateBuffer, deactivateBuffer, scriptBuffer, inElementAccessMutex, scriptBufferRequiresSort, isActive); - } else if (isControlledByDi) { + } else if (isControlledByDi + && (theScanNode->IsGlobalActive(parentActive) + != theScanNode->IsControlledActive())) { + // Notify only if datainput control actually disagreed with activity value + // coming from activity manager. qCInfo(TRACE_INFO) << "Element" << theScanNode->m_Name.c_str() << "visibility persistently controlled by datainput."; } diff --git a/src/runtime/Qt3DSElementSystem.cpp b/src/runtime/Qt3DSElementSystem.cpp index 81a27b1..27bca95 100644 --- a/src/runtime/Qt3DSElementSystem.cpp +++ b/src/runtime/Qt3DSElementSystem.cpp @@ -794,9 +794,12 @@ void SElement::SetDirty() void SElement::SetFlag(Q3DStudio::EElementFlag inFlag, bool inValue) { bool existing = m_Flags & inFlag; - if (existing != inValue && HasActivityZone()) { + // Always handle datainput-driven visibility changes. + if ((existing != inValue && HasActivityZone()) + || inFlag == Q3DStudio::ELEMENTFLAG_CONTROLLED_ACTIVE) { m_Flags.clearOrSet(inValue, inFlag); - if (inFlag == Q3DStudio::ELEMENTFLAG_EXPLICITACTIVE) { + if (inFlag == Q3DStudio::ELEMENTFLAG_EXPLICITACTIVE + || inFlag == Q3DStudio::ELEMENTFLAG_CONTROLLED_ACTIVE) { GetActivityZone().UpdateItemInfo(*this); if (IsComponent()) { SElement *parent = m_Parent; diff --git a/src/runtime/Qt3DSKernelTypes.h b/src/runtime/Qt3DSKernelTypes.h index bc13230..6af4ab7 100644 --- a/src/runtime/Qt3DSKernelTypes.h +++ b/src/runtime/Qt3DSKernelTypes.h @@ -143,7 +143,7 @@ enum EElementFlag { // Flags used by the activation manager ELEMENTFLAG_AMGR_TIMEACTIVE = 1 << 13, ///< Is the element alive according to time information - ELEMENTFLAG_CONTROLLED_ACTIVE = 1 << 14 + ELEMENTFLAG_CONTROLLED_ACTIVE = 1 << 14 ///< Is the element alive based on datainput control }; // Four byte aligned time unit structure. |