Browse Source

Fixes required to fix compiler crashes in issue #84

pull/85/head
Bill Robinson 12 years ago
parent
commit
956c1e6e57
  1. 3
      src/Magnum/Platform/ScreenedApplication.hpp
  2. 18
      src/Magnum/SceneGraph/Object.hpp

3
src/Magnum/Platform/ScreenedApplication.hpp

@ -78,7 +78,8 @@ template<class Application> void BasicScreenedApplication<Application>::viewport
/* Call viewport event after all other (because of framebuffer resizing) */
globalViewportEvent(size);
for(BasicScreen<Application>& s: *this) s.viewportEvent(size);
for(BasicScreen<Application>* s = screens().first(); s; s = s->nextFartherScreen())
s->viewportEvent(size);
}
template<class Application> void BasicScreenedApplication<Application>::drawEvent() {

18
src/Magnum/SceneGraph/Object.hpp

@ -166,12 +166,12 @@ template<class Transformation> void Object<Transformation>::setDirty() {
if(flags & Flag::Dirty) return;
/* Make all features dirty */
for(AbstractFeature<Transformation::Dimensions, typename Transformation::Type>& feature: this->features())
feature.markDirty();
for (auto feature = this->features().first(); feature; feature = feature->nextFeature())
feature->markDirty();
/* Make all children dirty */
for(Object<Transformation>& 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<class Transformation> void Object<Transformation>::setCleanInternal(con
MatrixType matrix, invertedMatrix;
/* Clean all features */
for(AbstractFeature<Transformation::Dimensions, typename Transformation::Type>& 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<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<Transformation>::toMatrix(
Implementation::Transformation<Transformation>::inverted(absoluteTransformation));
}
feature.cleanInverted(invertedMatrix);
feature->cleanInverted(invertedMatrix);
}
}

Loading…
Cancel
Save