* packer, repacker: also handle fogs without drawsurfaces

This commit is contained in:
Garux 2020-11-25 10:29:49 +03:00
parent d346f1ee07
commit f30ee07376
3 changed files with 24 additions and 7 deletions

View File

@ -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;
}

View File

@ -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 );
}
}
/*

View File

@ -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 */