From 577defa7b0664ca547ef6708a9e0b832670aec78 Mon Sep 17 00:00:00 2001 From: Mike Krus Date: Wed, 18 Sep 2019 20:00:05 +0100 Subject: Enable syncing on animation aspect Change-Id: I4333cb98d4339fa9dc02ebb27231aad748fdb3c2 Reviewed-by: Paul Lemire --- src/animation/backend/backendnode.cpp | 9 +++++++++ src/animation/backend/backendnode_p.h | 2 ++ src/animation/frontend/qanimationaspect.cpp | 6 ++++++ src/animation/frontend/qanimationaspect_p.h | 2 ++ 4 files changed, 19 insertions(+) (limited to 'src/animation') diff --git a/src/animation/backend/backendnode.cpp b/src/animation/backend/backendnode.cpp index 6ea7f89c7..f44836a67 100644 --- a/src/animation/backend/backendnode.cpp +++ b/src/animation/backend/backendnode.cpp @@ -38,6 +38,8 @@ ****************************************************************************/ #include "backendnode_p.h" +#include +#include QT_BEGIN_NAMESPACE @@ -65,6 +67,13 @@ void BackendNode::setDirty(Handler::DirtyFlag flag) m_handler->setDirty(flag, peerId()); } +void BackendNode::syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) +{ + Q_UNUSED(firstTime) + + d_ptr->setEnabled(frontEnd->isEnabled()); +} + } // namespace Animation } // namespace Qt3DAnimation diff --git a/src/animation/backend/backendnode_p.h b/src/animation/backend/backendnode_p.h index d7842517a..4e450b6ec 100644 --- a/src/animation/backend/backendnode_p.h +++ b/src/animation/backend/backendnode_p.h @@ -68,6 +68,8 @@ public: void setHandler(Handler *handler); + virtual void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime); + protected: void setDirty(Handler::DirtyFlag flag); Handler *m_handler; diff --git a/src/animation/frontend/qanimationaspect.cpp b/src/animation/frontend/qanimationaspect.cpp index a25eb533e..b44ceaef4 100644 --- a/src/animation/frontend/qanimationaspect.cpp +++ b/src/animation/frontend/qanimationaspect.cpp @@ -69,6 +69,12 @@ QAnimationAspectPrivate::QAnimationAspectPrivate() { } +void QAnimationAspectPrivate::syncDirtyFrontEndNode(QNode *node, QBackendNode *backend, bool firstTime) const +{ + Animation::BackendNode *renderBackend = static_cast(backend); + renderBackend->syncFromFrontEnd(node, firstTime); +} + /*! \class Qt3DAnimation::QAnimationAspect \inherits Qt3DCore::QAbstractAspect diff --git a/src/animation/frontend/qanimationaspect_p.h b/src/animation/frontend/qanimationaspect_p.h index 2ecc8fdb8..203acd386 100644 --- a/src/animation/frontend/qanimationaspect_p.h +++ b/src/animation/frontend/qanimationaspect_p.h @@ -70,6 +70,8 @@ public: Q_DECLARE_PUBLIC(QAnimationAspect) + void syncDirtyFrontEndNode(Qt3DCore::QNode *node, Qt3DCore::QBackendNode *backend, bool firstTime) const override; + QScopedPointer m_handler; }; -- cgit v1.2.3