diff --git a/tools/quake3/q3map2/bsp.cpp b/tools/quake3/q3map2/bsp.cpp index 3d817b0d..d47b470c 100644 --- a/tools/quake3/q3map2/bsp.cpp +++ b/tools/quake3/q3map2/bsp.cpp @@ -350,7 +350,7 @@ static void ProcessWorldModel( entity_t& e ){ AddEntitySurfaceModels( e ); /* generate bsp brushes from map brushes */ - EmitBrushes( e.brushes, &e.firstBrush, &e.numBrushes ); + EmitBrushes( e ); /* add references to the detail brushes */ FilterDetailBrushesIntoTree( e, tree ); @@ -472,7 +472,7 @@ static void ProcessSubModel( entity_t& e ){ AddEntitySurfaceModels( e ); /* generate bsp brushes from map brushes */ - EmitBrushes( e.brushes, &e.firstBrush, &e.numBrushes ); + EmitBrushes( e ); /* just put all the brushes in headnode */ tree.headnode->brushlist = e.brushes; diff --git a/tools/quake3/q3map2/convert_bsp.cpp b/tools/quake3/q3map2/convert_bsp.cpp index 23ed77b6..7879d7af 100644 --- a/tools/quake3/q3map2/convert_bsp.cpp +++ b/tools/quake3/q3map2/convert_bsp.cpp @@ -1003,7 +1003,7 @@ static void PseudoCompileBSP( bool need_tree ){ FilterStructuralBrushesIntoTree( entity, tree ); FilterDetailBrushesIntoTree( entity, tree ); - EmitBrushes( entity.brushes, &entity.firstBrush, &entity.numBrushes ); + EmitBrushes( entity ); EndModel( entity, tree.headnode ); } EndBSPFile( false ); diff --git a/tools/quake3/q3map2/q3map2.h b/tools/quake3/q3map2/q3map2.h index 37b192c1..7b637755 100644 --- a/tools/quake3/q3map2/q3map2.h +++ b/tools/quake3/q3map2/q3map2.h @@ -1616,7 +1616,7 @@ int EmitShader( const char *shader, const int *contentFl void BeginBSPFile(); void EndBSPFile( bool do_write ); -void EmitBrushes( brushlist_t& brushes, int *firstBrush, int *numBrushes ); +void EmitBrushes( entity_t& e ); void EmitFogs(); void BeginModel( const entity_t& e ); diff --git a/tools/quake3/q3map2/writebsp.cpp b/tools/quake3/q3map2/writebsp.cpp index b76ccc31..0e5b469e 100644 --- a/tools/quake3/q3map2/writebsp.cpp +++ b/tools/quake3/q3map2/writebsp.cpp @@ -350,42 +350,31 @@ void EndBSPFile( bool do_write ){ /* EmitBrushes() - writes the brush list to the bsp + writes the entity brush list to the bsp */ -void EmitBrushes( brushlist_t& brushes, int *firstBrush, int *numBrushes ){ +void EmitBrushes( entity_t& e ){ /* set initial brush */ - if ( firstBrush != nullptr ) { - *firstBrush = bspBrushes.size(); - } - if ( numBrushes != nullptr ) { - *numBrushes = 0; - } + e.firstBrush = bspBrushes.size(); + e.numBrushes = e.brushes.size(); /* walk list of brushes */ - for ( brush_t& b : brushes ) + for ( brush_t& b : e.brushes ) { /* get bsp brush */ b.outputNum = bspBrushes.size(); bspBrush_t& db = bspBrushes.emplace_back(); - if ( numBrushes != nullptr ) { - ( *numBrushes )++; - } db.shaderNum = EmitShader( b.contentShader->shader, &b.contentShader->contentFlags, &b.contentShader->surfaceFlags ); db.firstSide = bspBrushSides.size(); + db.numSides = b.sides.size(); /* walk sides */ - db.numSides = 0; for ( side_t& side : b.sides ) { - /* set output number to bogus initially */ - side.outputNum = -1; - /* emit side */ side.outputNum = bspBrushSides.size(); bspBrushSide_t& cp = bspBrushSides.emplace_back(); - db.numSides++; cp.planeNum = side.planenum; /* emit shader */