don't write the bsp twice when pseudo compiling
authorRudolf Polzer <divverent@alientrap.org>
Sat, 9 Oct 2010 19:29:15 +0000 (21:29 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 9 Oct 2010 19:29:15 +0000 (21:29 +0200)
tools/quake3/q3map2/bsp.c
tools/quake3/q3map2/main.c
tools/quake3/q3map2/q3map2.h
tools/quake3/q3map2/writebsp.c

index f0763eb..7901979 100644 (file)
@@ -978,7 +978,7 @@ int BSPMain( int argc, char **argv )
        ProcessAdvertisements();
 
        /* finish and write bsp */
-       EndBSPFile();
+       EndBSPFile(qtrue);
        
        /* remove temp map source file if appropriate */
        if( strlen( tempSource ) > 0)
index a7f9432..0789723 100644 (file)
@@ -1511,7 +1511,7 @@ void PseudoCompileBSP(qboolean need_tree)
                EmitBrushes(entity->brushes, &entity->firstBrush, &entity->numBrushes );
                EndModel(entity, node);
        }
-       EndBSPFile();
+       EndBSPFile(qfalse);
 }
 
 /*
index 28a94a3..bf0d5c6 100644 (file)
@@ -1615,7 +1615,7 @@ void                                              SetLightStyles( void );
 int                                                    EmitShader( const char *shader, int *contentFlags, int *surfaceFlags );
 
 void                                           BeginBSPFile( void );
-void                                           EndBSPFile( void );
+void                                           EndBSPFile( qboolean do_write );
 void                                           EmitBrushes( brush_t *brushes, int *firstBrush, int *numBrushes );
 void                                           EmitFogs( void );
 
index 2ef8962..2e6e67a 100644 (file)
@@ -399,7 +399,7 @@ EndBSPFile()
 finishes a new bsp and writes to disk
 */
 
-void EndBSPFile( void )
+void EndBSPFile(qboolean do_write)
 {
        char    path[ 1024 ];
        
@@ -411,13 +411,16 @@ void EndBSPFile( void )
        numBSPEntities = numEntities;
        UnparseEntities();
        
-       /* write the surface extra file */
-       WriteSurfaceExtraFile( source );
-       
-       /* write the bsp */
-       sprintf( path, "%s.bsp", source );
-       Sys_Printf( "Writing %s\n", path );
-       WriteBSPFile( path );
+       if(do_write)
+       {
+               /* write the surface extra file */
+               WriteSurfaceExtraFile( source );
+
+               /* write the bsp */
+               sprintf( path, "%s.bsp", source );
+               Sys_Printf( "Writing %s\n", path );
+               WriteBSPFile( path );
+       }
 }