From b3b0d9a2707bbf78a60815def967359c606aa807 Mon Sep 17 00:00:00 2001 From: Lynix Date: Thu, 11 Aug 2016 01:03:53 +0200 Subject: [PATCH] SDK/GraphicsComponent: Fix invalidation slot disconnection in case Detach has been called Former-commit-id: 8962d36d0fa699c6f96e67802fddd0880aab3594 [formerly 3f3f176ef41832cbb474cb9bbd4c96619ad7af1d] [formerly 504be94e13a864f006eb3089970b7eb43abf2b4f [formerly f60ab676eb22a0e31aacbe668e4a9d41312d800e]] Former-commit-id: 7b1f734f447e6797f4f87372c8319f904aa40e1a [formerly cb9ec84e912f0886bc94f4bdd26b25c757d1563c] Former-commit-id: cece1ffceb6a37dc86b61cfa218c0ef9907050a2 --- SDK/include/NDK/Components/GraphicsComponent.hpp | 6 ++++-- SDK/include/NDK/Components/GraphicsComponent.inl | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/SDK/include/NDK/Components/GraphicsComponent.hpp b/SDK/include/NDK/Components/GraphicsComponent.hpp index 92aeeed2f..6e0e78604 100644 --- a/SDK/include/NDK/Components/GraphicsComponent.hpp +++ b/SDK/include/NDK/Components/GraphicsComponent.hpp @@ -35,7 +35,7 @@ namespace Ndk inline void Clear(); - inline void Detach(const Nz::InstancedRenderableRef& renderable); + inline void Detach(const Nz::InstancedRenderable* renderable); inline void EnsureBoundingVolumeUpdate() const; inline void EnsureTransformMatrixUpdate() const; @@ -75,7 +75,8 @@ namespace Ndk Renderable(Renderable&& renderable) noexcept : data(std::move(renderable.data)), renderable(std::move(renderable.renderable)), - dataUpdated(renderable.dataUpdated) + dataUpdated(renderable.dataUpdated), + renderableInvalidationSlot(std::move(renderable.renderableInvalidationSlot)), { } @@ -84,6 +85,7 @@ namespace Ndk data = std::move(r.data); dataUpdated = r.dataUpdated; renderable = std::move(r.renderable); + renderableInvalidationSlot = std::move(r.renderableInvalidationSlot); return *this; } diff --git a/SDK/include/NDK/Components/GraphicsComponent.inl b/SDK/include/NDK/Components/GraphicsComponent.inl index b38ce6dd6..a835c845d 100644 --- a/SDK/include/NDK/Components/GraphicsComponent.inl +++ b/SDK/include/NDK/Components/GraphicsComponent.inl @@ -54,7 +54,7 @@ namespace Ndk InvalidateBoundingVolume(); } - inline void GraphicsComponent::Detach(const Nz::InstancedRenderableRef& renderable) + inline void GraphicsComponent::Detach(const Nz::InstancedRenderable* renderable) { for (auto it = m_renderables.begin(); it != m_renderables.end(); ++it) {