From cf1b60d899d45708890fd5e9317ea8dd698f71c6 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sat, 9 Oct 2010 21:29:15 +0200 Subject: [PATCH] don't write the bsp twice when pseudo compiling --- tools/quake3/q3map2/bsp.c | 2 +- tools/quake3/q3map2/main.c | 2 +- tools/quake3/q3map2/q3map2.h | 2 +- tools/quake3/q3map2/writebsp.c | 19 +++++++++++-------- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/tools/quake3/q3map2/bsp.c b/tools/quake3/q3map2/bsp.c index f0763eb..7901979 100644 --- a/tools/quake3/q3map2/bsp.c +++ b/tools/quake3/q3map2/bsp.c @@ -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) diff --git a/tools/quake3/q3map2/main.c b/tools/quake3/q3map2/main.c index a7f9432..0789723 100644 --- a/tools/quake3/q3map2/main.c +++ b/tools/quake3/q3map2/main.c @@ -1511,7 +1511,7 @@ void PseudoCompileBSP(qboolean need_tree) EmitBrushes(entity->brushes, &entity->firstBrush, &entity->numBrushes ); EndModel(entity, node); } - EndBSPFile(); + EndBSPFile(qfalse); } /* diff --git a/tools/quake3/q3map2/q3map2.h b/tools/quake3/q3map2/q3map2.h index 28a94a3..bf0d5c6 100644 --- a/tools/quake3/q3map2/q3map2.h +++ b/tools/quake3/q3map2/q3map2.h @@ -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 ); diff --git a/tools/quake3/q3map2/writebsp.c b/tools/quake3/q3map2/writebsp.c index 2ef8962..2e6e67a 100644 --- a/tools/quake3/q3map2/writebsp.c +++ b/tools/quake3/q3map2/writebsp.c @@ -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 ); + } } -- 2.39.2