]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/instancelib.h
allow undo “make detail/structural”, <3 @SpiKe, thanks @Garux, fix #76
[xonotic/netradiant.git] / libs / instancelib.h
index 913288b6a9b127b90566412d78f96f3f13ad5c70..af9dd2bba31a181f3eb6b4e7c24f7e4c93cf8ed1 100644 (file)
@@ -135,14 +135,14 @@ void transformChanged(){
                ( *i ).second->transformChanged();
        }
 }
-typedef MemberCaller<InstanceSet, &InstanceSet::transformChanged> TransformChangedCaller;
+typedef MemberCaller<InstanceSet, void(), &InstanceSet::transformChanged> TransformChangedCaller;
 void boundsChanged(){
        for ( InstanceMap::iterator i = m_instances.begin(); i != m_instances.end(); ++i )
        {
                ( *i ).second->boundsChanged();
        }
 }
-typedef MemberCaller<InstanceSet, &InstanceSet::boundsChanged> BoundsChangedCaller;
+typedef MemberCaller<InstanceSet, void(), &InstanceSet::boundsChanged> BoundsChangedCaller;
 };
 
 template<typename Functor>
@@ -153,23 +153,16 @@ inline void InstanceSet_forEach( InstanceSet& instances, const Functor& functor
        }
 }
 
-template<typename Type>
-class InstanceEvaluateTransform
-{
-public:
-inline void operator()( scene::Instance& instance ) const {
-       InstanceTypeCast<Type>::cast( instance )->evaluateTransform();
-}
-};
-
 template<typename Type>
 class InstanceSetEvaluateTransform
 {
 public:
 static void apply( InstanceSet& instances ){
-       InstanceSet_forEach( instances, InstanceEvaluateTransform<Type>() );
+       InstanceSet_forEach(instances, [&](scene::Instance &instance) {
+               InstanceTypeCast<Type>::cast(instance)->evaluateTransform();
+       });
 }
-typedef ReferenceCaller<InstanceSet, &InstanceSetEvaluateTransform<Type>::apply> Caller;
+typedef ReferenceCaller<InstanceSet, void(), &InstanceSetEvaluateTransform<Type>::apply> Caller;
 };
 
 #endif