From fac75962d02af4c702c7c23a353708beb53ef8a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 18 Apr 2013 10:16:38 +0200 Subject: [PATCH] SceneGraph: assert that original Object::setClean() is called. --- src/SceneGraph/Object.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/SceneGraph/Object.hpp b/src/SceneGraph/Object.hpp index 15b659aab..8940f51de 100644 --- a/src/SceneGraph/Object.hpp +++ b/src/SceneGraph/Object.hpp @@ -142,7 +142,9 @@ template void Object::setClean() { /* Compose transformation and clean object */ absoluteTransformation = Transformation::compose(absoluteTransformation, o->transformation()); + CORRADE_INTERNAL_ASSERT(o->isDirty()); o->setClean(absoluteTransformation); + CORRADE_ASSERT(!o->isDirty(), "SceneGraph::Object::setClean(): original implementation was not called", ); } } @@ -343,8 +345,11 @@ template void Object::setClean(std::vector std::vector transformations(scene->transformations(objects)); /* Go through all objects and clean them */ - for(std::size_t i = 0; i != objects.size(); ++i) + for(std::size_t i = 0; i != objects.size(); ++i) { + CORRADE_INTERNAL_ASSERT(objects[i]->isDirty()); objects[i]->setClean(transformations[i]); + CORRADE_ASSERT(!objects[i]->isDirty(), "SceneGraph::Object::setClean(): original implementation was not called", ); + } } template void Object::setClean(const typename Transformation::DataType& absoluteTransformation) {