]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Merge commit 'e876e8ef487eeb9123f4906373622ffe3b6ea9d4' into master-merge
authorThomas Debesse <dev@illwieckz.net>
Mon, 20 Jun 2022 02:26:13 +0000 (04:26 +0200)
committerThomas Debesse <dev@illwieckz.net>
Mon, 20 Jun 2022 02:26:13 +0000 (04:26 +0200)
1  2 
Makefile
radiant/csg.cpp
tools/quake3/q3map2/bsp.c
tools/quake3/q3map2/map.c
tools/quake3/q3map2/model.c
tools/quake3/q3map2/q3map2.h
tools/quake3/q3map2/surface.c
tools/quake3/q3map2/surface_foliage.c

diff --cc Makefile
Simple merge
diff --cc radiant/csg.cpp
index f28bdc98d202d0465f8bac6654f4e05b2abbfe4b,9de2dca24f705960f6adc8f5c24b14e0818f093a..2a59d2fec6785eb8cdb96527e3ada8be4b8c3e7b
@@@ -33,7 -46,9 +46,9 @@@ void Face_makeBrush( Face& face, const 
  void Face_makeBrush( Face& face, const Brush& brush, brush_vector_t& out, float offset ){
        if ( face.contributes() ) {
                out.push_back( new Brush( brush ) );
 -              Face* newFace = out.back()->addFace( face );
+               //face.getPlane().offset( -offset );
+               //face.planeChanged();
 +              std::shared_ptr<Face> newFace = out.back()->addFace( face );
                if ( newFace != 0 ) {
                        newFace->flipWinding();
                        newFace->getPlane().offset( offset );
@@@ -416,55 -450,49 +431,55 @@@ bool pre( const scene::Path& path, scen
  }
  
  void post( const scene::Path& path, scene::Instance& instance ) const {
 -      if ( path.top().get().visible() ) {
 +      if ( !path.top().get().visible() ) {
 +              return;
 +      }
 +
-       Brush* brush = Node_getBrush( path.top() );
+               Brush* brush = Node_getBrush( path.top() );
 -              if ( brush != 0
 -                       && Instance_getSelectable( instance )->isSelected() ) {
 +      if ( brush == nullptr || !Instance_getSelectable( instance )->isSelected() ) {
 +              return;
 +      }
 +
-       Plane3 plane( plane3_for_points( m_p0, m_p1, m_p2 ) );
+                       Plane3 plane( plane3_for_points( m_p0, m_p1, m_p2 ) );
 -                      if ( plane3_valid( plane ) ) {
 +      if ( !plane3_valid( plane ) ) {
 +              return;
 +      }
 +
-       brushsplit_t split = Brush_classifyPlane( *brush, m_split == eFront ? plane3_flipped( plane ) : plane );
-       if ( split.counts[ePlaneBack] && split.counts[ePlaneFront] ) {
-               // the plane intersects this brush
-               if ( m_split == eFrontAndBack ) {
-                       NodeSmartReference node( ( new BrushNode() )->node() );
-                       Brush* fragment = Node_getBrush( node );
-                       fragment->copy( *brush );
+                               brushsplit_t split = Brush_classifyPlane( *brush, m_split == eFront ? plane3_flipped( plane ) : plane );
+                               if ( split.counts[ePlaneBack] && split.counts[ePlaneFront] ) {
+                                       // the plane intersects this brush
+                                       if ( m_split == eFrontAndBack ) {
+                                               NodeSmartReference node( ( new BrushNode() )->node() );
+                                               Brush* fragment = Node_getBrush( node );
+                                               fragment->copy( *brush );
 -                                              Face* newFace = fragment->addPlane( m_p0, m_p1, m_p2, m_shader, m_projection );
 +                      std::shared_ptr<Face> newFace =
 +                              fragment->addPlane( m_p0, m_p1, m_p2, m_shader, m_projection );
-                       if ( newFace != 0 && m_split != eFront ) {
-                               newFace->flipWinding();
-                       }
-                       fragment->removeEmptyFaces();
-                       ASSERT_MESSAGE( !fragment->empty(), "brush left with no faces after split" );
+                                               if ( newFace != 0 && m_split != eFront ) {
+                                                       newFace->flipWinding();
+                                               }
+                                               fragment->removeEmptyFaces();
+                                               ASSERT_MESSAGE( !fragment->empty(), "brush left with no faces after split" );
  
-                       Node_getTraversable( path.parent() )->insert( node );
-                       {
-                               scene::Path fragmentPath = path;
-                               fragmentPath.top() = makeReference( node.get() );
-                               selectPath( fragmentPath, true );
-                       }
-               }
+                                               Node_getTraversable( path.parent() )->insert( node );
+                                               {
+                                                       scene::Path fragmentPath = path;
+                                                       fragmentPath.top() = makeReference( node.get() );
+                                                       selectPath( fragmentPath, true );
+                                               }
+                                       }
  
 -                                      Face* newFace = brush->addPlane( m_p0, m_p1, m_p2, m_shader, m_projection );
 +              std::shared_ptr<Face> newFace = brush->addPlane( m_p0, m_p1, m_p2, m_shader, m_projection );
-               if ( newFace != 0 && m_split == eFront ) {
-                       newFace->flipWinding();
-               }
-               brush->removeEmptyFaces();
-               ASSERT_MESSAGE( !brush->empty(), "brush left with no faces after split" );
-       }
-       else
-       // the plane does not intersect this brush
-       if ( m_split != eFrontAndBack && split.counts[ePlaneBack] != 0 ) {
-               // the brush is "behind" the plane
-               Path_deleteTop( path );
+                                       if ( newFace != 0 && m_split == eFront ) {
+                                               newFace->flipWinding();
+                                       }
+                                       brush->removeEmptyFaces();
+                                       ASSERT_MESSAGE( !brush->empty(), "brush left with no faces after split" );
+                               }
+                               else
+                               // the plane does not intersect this brush
+                               if ( m_split != eFrontAndBack && split.counts[ePlaneBack] != 0 ) {
+                                       // the brush is "behind" the plane
+                                       Path_deleteTop( path );
 -                              }
 -                      }
 -              }
        }
  }
  };
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge