diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2019-06-03 12:29:29 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-06-03 12:29:52 +0200 |
commit | 4eee1ab5a51ac482e2252e2e85c0fe624d5d4bad (patch) | |
tree | 71fb24fc69b2f77e08a57c56011ee5b72f23a52a /src/render/jobs/updateskinningpalettejob.cpp | |
parent | 79aa74b5d9df52605a8833e3853b422ca8e7a651 (diff) | |
parent | 666a645d1edc98dfea92fdaf7eaeed10c86dbc56 (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
src/render/renderers/opengl/renderer/renderer.cpp
tests/auto/render/textures/tst_textures.cpp
Change-Id: I4da0eafe7ddd4dd822c3dcb5f5fa826653a335b4
Diffstat (limited to 'src/render/jobs/updateskinningpalettejob.cpp')
-rw-r--r-- | src/render/jobs/updateskinningpalettejob.cpp | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/src/render/jobs/updateskinningpalettejob.cpp b/src/render/jobs/updateskinningpalettejob.cpp index 1ee9101f9..0f5d3d6d6 100644 --- a/src/render/jobs/updateskinningpalettejob.cpp +++ b/src/render/jobs/updateskinningpalettejob.cpp @@ -79,7 +79,11 @@ void UpdateSkinningPaletteJob::run() // Find all the armature components and update their skinning palettes QVector<HArmature> dirtyArmatures; - findDirtyArmatures(m_root, dirtyArmatures); + m_root->traverse([&dirtyArmatures](Entity *entity) { + const auto armatureHandle = entity->componentHandle<Armature>(); + if (!armatureHandle.isNull() && !dirtyArmatures.contains(armatureHandle)) + dirtyArmatures.push_back(armatureHandle); + }); // Update the skeleton for each dirty armature auto skeletonManager = m_nodeManagers->skeletonManager(); @@ -96,22 +100,6 @@ void UpdateSkinningPaletteJob::run() } } -void UpdateSkinningPaletteJob::findDirtyArmatures(Entity *entity, - QVector<HArmature> &armatures) const -{ - // Just return all enabled armatures found on entities for now - // TODO: Be smarter about limiting which armatures we update. For e.g. only - // those with skeletons that have changed and only those that are within view - // of one or more renderviews. - const auto armatureHandle = entity->componentHandle<Armature>(); - if (!armatureHandle.isNull() && !armatures.contains(armatureHandle)) - armatures.push_back(armatureHandle); - - const auto children = entity->children(); - for (const auto child : children) - findDirtyArmatures(child, armatures); -} - } // namespace Render } // namespace Qt3DRender |