From 956c1e6e5786fa9b393c8d09acf3657147430cc6 Mon Sep 17 00:00:00 2001 From: Bill Robinson Date: Wed, 14 Jan 2015 12:48:36 +0000 Subject: [PATCH] Fixes required to fix compiler crashes in issue #84 --- src/Magnum/Platform/ScreenedApplication.hpp | 3 ++- src/Magnum/SceneGraph/Object.hpp | 18 +++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/Magnum/Platform/ScreenedApplication.hpp b/src/Magnum/Platform/ScreenedApplication.hpp index f7bad77d4..62a3b1317 100644 --- a/src/Magnum/Platform/ScreenedApplication.hpp +++ b/src/Magnum/Platform/ScreenedApplication.hpp @@ -78,7 +78,8 @@ template void BasicScreenedApplication::viewport /* Call viewport event after all other (because of framebuffer resizing) */ globalViewportEvent(size); - for(BasicScreen& s: *this) s.viewportEvent(size); + for(BasicScreen* s = screens().first(); s; s = s->nextFartherScreen()) + s->viewportEvent(size); } template void BasicScreenedApplication::drawEvent() { diff --git a/src/Magnum/SceneGraph/Object.hpp b/src/Magnum/SceneGraph/Object.hpp index 1914059ee..cc838daaf 100644 --- a/src/Magnum/SceneGraph/Object.hpp +++ b/src/Magnum/SceneGraph/Object.hpp @@ -166,12 +166,12 @@ template void Object::setDirty() { if(flags & Flag::Dirty) return; /* Make all features dirty */ - for(AbstractFeature& feature: this->features()) - feature.markDirty(); + for (auto feature = this->features().first(); feature; feature = feature->nextFeature()) + feature->markDirty(); /* Make all children dirty */ - for(Object& child: children()) - child.setDirty(); + for(auto child = children().first(); child; child = child->nextSibling()) + child->setDirty(); /* Mark object as dirty */ flags |= Flag::Dirty; @@ -508,28 +508,28 @@ template void Object::setCleanInternal(con MatrixType matrix, invertedMatrix; /* Clean all features */ - for(AbstractFeature& feature: this->features()) { + for (auto feature = this->features().first(); feature; feature = feature->nextFeature()) { /* Cached absolute transformation, compute it if it wasn't computed already */ - if(feature.cachedTransformations() & CachedTransformation::Absolute) { + if(feature->cachedTransformations() & CachedTransformation::Absolute) { if(!(cached & CachedTransformation::Absolute)) { cached |= CachedTransformation::Absolute; matrix = Implementation::Transformation::toMatrix(absoluteTransformation); } - feature.clean(matrix); + feature->clean(matrix); } /* Cached inverse absolute transformation, compute it if it wasn't computed already */ - if(feature.cachedTransformations() & CachedTransformation::InvertedAbsolute) { + if(feature->cachedTransformations() & CachedTransformation::InvertedAbsolute) { if(!(cached & CachedTransformation::InvertedAbsolute)) { cached |= CachedTransformation::InvertedAbsolute; invertedMatrix = Implementation::Transformation::toMatrix( Implementation::Transformation::inverted(absoluteTransformation)); } - feature.cleanInverted(invertedMatrix); + feature->cleanInverted(invertedMatrix); } }