* packer, repacker: also handle fogs without drawsurfaces
This commit is contained in:
parent
d346f1ee07
commit
f30ee07376
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user