diff --git a/radiant/brush/Brush.cpp b/radiant/brush/Brush.cpp index 725cfdc589..9cc4c18123 100644 --- a/radiant/brush/Brush.cpp +++ b/radiant/brush/Brush.cpp @@ -45,14 +45,13 @@ const std::size_t Brush::CONE_MAX_SIDES = 32; const std::size_t Brush::SPHERE_MIN_SIDES = 3; const std::size_t Brush::SPHERE_MAX_SIDES = 7; -Brush::Brush(BrushNode& owner, const Callback& evaluateTransform) : +Brush::Brush(BrushNode& owner) : _owner(owner), _undoStateSaver(nullptr), _mapFileChangeTracker(nullptr), _faceCentroidPoints(GL_POINTS), _uniqueVertexPoints(GL_POINTS), _uniqueEdgePoints(GL_POINTS), - m_evaluateTransform(evaluateTransform), m_planeChanged(false), m_transformChanged(false), _detailFlag(Structural) @@ -60,14 +59,13 @@ Brush::Brush(BrushNode& owner, const Callback& evaluateTransform) : onFacePlaneChanged(); } -Brush::Brush(BrushNode& owner, const Brush& other, const Callback& evaluateTransform) : +Brush::Brush(BrushNode& owner, const Brush& other) : _owner(owner), _undoStateSaver(nullptr), _mapFileChangeTracker(nullptr), _faceCentroidPoints(GL_POINTS), _uniqueVertexPoints(GL_POINTS), _uniqueEdgePoints(GL_POINTS), - m_evaluateTransform(evaluateTransform), m_planeChanged(false), m_transformChanged(false), _detailFlag(Structural) @@ -230,11 +228,13 @@ void Brush::transformChanged() { onFacePlaneChanged(); } -void Brush::evaluateTransform() { - if(m_transformChanged) { +void Brush::evaluateTransform() +{ + if (m_transformChanged) + { m_transformChanged = false; revertTransform(); - m_evaluateTransform(); + _owner.evaluateTransform(); } } diff --git a/radiant/brush/Brush.h b/radiant/brush/Brush.h index 4ae4a8952e..aceb7a0db2 100644 --- a/radiant/brush/Brush.h +++ b/radiant/brush/Brush.h @@ -2,7 +2,6 @@ #include "editable.h" -#include "generic/callback.h" #include "Face.h" #include "SelectableComponents.h" #include "RenderableWireFrame.h" @@ -123,8 +122,6 @@ class Brush : AABB m_aabb_local; // ---- - Callback m_evaluateTransform; - mutable bool m_planeChanged; // b-rep evaluation required mutable bool m_transformChanged; // transform evaluation required // ---- @@ -165,8 +162,8 @@ class Brush : static double m_maxWorldCoord; // Constructors - Brush(BrushNode& owner, const Callback& evaluateTransform); - Brush(BrushNode& owner, const Brush& other, const Callback& evaluateTransform); + Brush(BrushNode& owner); + Brush(BrushNode& owner, const Brush& other); // Destructor virtual ~Brush(); diff --git a/radiant/brush/BrushNode.cpp b/radiant/brush/BrushNode.cpp index ed77fb4eef..ce2283bf43 100644 --- a/radiant/brush/BrushNode.cpp +++ b/radiant/brush/BrushNode.cpp @@ -13,8 +13,7 @@ BrushNode::BrushNode() : scene::SelectableNode(), m_lightList(&GlobalRenderSystem().attachLitObject(*this)), - m_brush(*this, - Callback(std::bind(&BrushNode::evaluateTransform, this))), + m_brush(*this), _selectedPoints(GL_POINTS), _faceCentroidPointsCulled(GL_POINTS), m_viewChanged(false), @@ -41,8 +40,7 @@ BrushNode::BrushNode(const BrushNode& other) : LitObject(other), Transformable(other), m_lightList(&GlobalRenderSystem().attachLitObject(*this)), - m_brush(*this, other.m_brush, - Callback(std::bind(&BrushNode::evaluateTransform, this))), + m_brush(*this, other.m_brush), _selectedPoints(GL_POINTS), _faceCentroidPointsCulled(GL_POINTS), m_viewChanged(false),