diff --git a/tools/quake3/q3map2/autopk3.c b/tools/quake3/q3map2/autopk3.c index e2095dd4..65ee6741 100644 --- a/tools/quake3/q3map2/autopk3.c +++ b/tools/quake3/q3map2/autopk3.c @@ -345,6 +345,10 @@ int pk3BSPMain( int argc, char **argv ){ } } + for( i = 0; i < numBSPFogs; ++i ){ + res2list( pk3Shaders, bspFogs[i].shader ); + } + //levelshot sprintf( str, "levelshots/%s", nameOFmap ); res2list( pk3Shaders, str ); @@ -1019,6 +1023,10 @@ int repackBSPMain( int argc, char **argv ){ } } + for( i = 0; i < numBSPFogs; ++i ){ + res2list( pk3Shaders, bspFogs[i].shader ); + } + //levelshot sprintf( str, "levelshots/%s", nameOFmap ); res2list( pk3Shaders, str ); @@ -1147,9 +1155,9 @@ int repackBSPMain( int argc, char **argv ){ } if ( numBSPFogs != 0 ) { Sys_Printf( "freed numBSPFogs\n" ); - numBSPFogs = 0; } - if ( numBSPAds != 0 ) { +*/ numBSPFogs = 0; +/* if ( numBSPAds != 0 ) { Sys_Printf( "freed numBSPAds\n" ); numBSPAds = 0; } diff --git a/tools/quake3/q3map2/bspfile_abstract.c b/tools/quake3/q3map2/bspfile_abstract.c index b0cb34ba..6150a62f 100644 --- a/tools/quake3/q3map2/bspfile_abstract.c +++ b/tools/quake3/q3map2/bspfile_abstract.c @@ -162,12 +162,12 @@ void SwapBSPFile( void ){ /* shaders (don't swap the name) */ for ( i = 0; i < numBSPShaders ; i++ ) { - if ( doingBSP ){ - si = ShaderInfoForShader( bspShaders[ i ].shader ); - if ( si->remapShader && si->remapShader[ 0 ] ) { - strcpy( bspShaders[ i ].shader, si->remapShader ); + if ( doingBSP ){ + si = ShaderInfoForShader( bspShaders[ i ].shader ); + if ( si->remapShader && si->remapShader[ 0 ] ) { + strcpy( bspShaders[ i ].shader, si->remapShader ); + } } - } bspShaders[ i ].contentFlags = LittleLong( bspShaders[ i ].contentFlags ); bspShaders[ i ].surfaceFlags = LittleLong( bspShaders[ i ].surfaceFlags ); } @@ -389,6 +389,13 @@ void PartialLoadBSPFile( const char *filename ){ /* drawsurfs */ /* note: rbsp files (and hence q3map2 abstract bsp) have byte lightstyles index arrays, this follows sof2map convention */ SwapBlock( (int*) bspDrawSurfaces, numBSPDrawSurfaces * sizeof( bspDrawSurfaces[ 0 ] ) ); + + /* fogs */ + for ( i = 0; i < numBSPFogs; i++ ) + { + bspFogs[ i ].brushNum = LittleLong( bspFogs[ i ].brushNum ); + bspFogs[ i ].visibleSide = LittleLong( bspFogs[ i ].visibleSide ); + } } /* diff --git a/tools/quake3/q3map2/bspfile_ibsp.c b/tools/quake3/q3map2/bspfile_ibsp.c index b4bd2eb8..b6cba51a 100644 --- a/tools/quake3/q3map2/bspfile_ibsp.c +++ b/tools/quake3/q3map2/bspfile_ibsp.c @@ -536,6 +536,8 @@ void PartialLoadIBSPFile( const char *filename ){ CopyDrawSurfacesLump( header ); + numBSPFogs = CopyLump( (bspHeader_t*) header, LUMP_FOGS, bspFogs, sizeof( bspFog_t ) ); // TODO fix overflow + bspEntDataSize = CopyLump_Allocate( (bspHeader_t*) header, LUMP_ENTITIES, (void **) &bspEntData, 1, &allocatedBSPEntData ); /* free the file buffer */