X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=blobdiff_plain;f=radiant%2Fbrush.h;h=c20f03cbd36f4d22d9f8dddc703dc345329ac556;hp=21988f370d82f85e8989c34611e4f991495c462d;hb=644aa914b3ca91e5a778bf5c1cbf6c018758993d;hpb=6352fbdd7968d7dffa2ba4c57ee5cade250e04ed diff --git a/radiant/brush.h b/radiant/brush.h index 21988f37..c20f03cb 100644 --- a/radiant/brush.h +++ b/radiant/brush.h @@ -307,7 +307,6 @@ class FaceShaderObserver { public: virtual void realiseShader() = 0; - virtual void unrealiseShader() = 0; }; @@ -656,6 +655,8 @@ static bool isDoom3Plane(){ return FacePlane::m_type == eBrushTypeDoom3 || FacePlane::m_type == eBrushTypeQuake4; } + FacePlane& operator=(const FacePlane&) = default; + class SavedState { public: @@ -869,11 +870,8 @@ class FaceObserver { public: virtual void planeChanged() = 0; - virtual void connectivityChanged() = 0; - virtual void shaderChanged() = 0; - virtual void evaluateTransform() = 0; }; @@ -1411,8 +1409,7 @@ inline bool plane3_inside( const Plane3& self, const Plane3& other, bool selfIsL return true; } -typedef SmartPointer FaceSmartPointer; -typedef std::vector Faces; +typedef std::vector> Faces; /// \brief Returns the unique-id of the edge adjacent to \p faceVertex in the edge-pair for the set of \p faces. inline FaceVertexId next_edge( const Faces& faces, FaceVertexId faceVertex ){ @@ -1494,25 +1491,15 @@ class BrushObserver { public: virtual void reserve( std::size_t size ) = 0; - virtual void clear() = 0; - virtual void push_back( Face& face ) = 0; - virtual void pop_back() = 0; - virtual void erase( std::size_t index ) = 0; - virtual void connectivityChanged() = 0; - virtual void edge_clear() = 0; - virtual void edge_push_back( SelectableEdge& edge ) = 0; - virtual void vertex_clear() = 0; - virtual void vertex_push_back( SelectableVertex& vertex ) = 0; - virtual void DEBUG_verify() const = 0; }; @@ -1901,24 +1888,24 @@ bool isDetail(){ } /// \brief Appends a copy of \p face to the end of the face list. -Face* addFace( const Face& face ){ + std::shared_ptr addFace( const Face& face ){ if ( m_faces.size() == c_brush_maxFaces ) { return 0; } undoSave(); - push_back( FaceSmartPointer( new Face( face, this ) ) ); + push_back( std::make_shared( face, this ) ); m_faces.back()->setDetail( isDetail() ); planeChanged(); return m_faces.back(); } /// \brief Appends a new face constructed from the parameters to the end of the face list. -Face* addPlane( const Vector3& p0, const Vector3& p1, const Vector3& p2, const char* shader, const TextureProjection& projection ){ + std::shared_ptr addPlane( const Vector3& p0, const Vector3& p1, const Vector3& p2, const char* shader, const TextureProjection& projection ){ if ( m_faces.size() == c_brush_maxFaces ) { return 0; } undoSave(); - push_back( FaceSmartPointer( new Face( p0, p1, p2, shader, projection, this ) ) ); + push_back( std::make_shared( p0, p1, p2, shader, projection, this ) ); m_faces.back()->setDetail( isDetail() ); planeChanged(); return m_faces.back(); @@ -1962,11 +1949,11 @@ const_iterator end() const { return m_faces.end(); } -Face* back(){ + std::shared_ptr back(){ return m_faces.back(); } -const Face* back() const { + const std::shared_ptr back() const { return m_faces.back(); } @@ -3199,6 +3186,7 @@ TransformModifier m_transform; BrushInstance( const BrushInstance& other ); // NOT COPYABLE BrushInstance& operator=( const BrushInstance& other ); // NOT ASSIGNABLE + public: static Counter* m_counter;