autopacker: use LoadBSPFilePartially
LoadBSPFilePartially: support RBSP
This commit is contained in:
parent
1fe4ab8bd8
commit
44ced506e3
|
|
@ -39,7 +39,8 @@
|
||||||
struct script_t
|
struct script_t
|
||||||
{
|
{
|
||||||
char filename[1024];
|
char filename[1024];
|
||||||
char *buffer,*script_p,*end_p;
|
char *buffer;
|
||||||
|
const char *script_p, *end_p;
|
||||||
int line;
|
int line;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ static void parseBspFile( const char *bspPath, StrList& outShaders, StrList& out
|
||||||
|
|
||||||
/* load the bsp */
|
/* load the bsp */
|
||||||
Sys_Printf( "Loading %s\n", bspPath );
|
Sys_Printf( "Loading %s\n", bspPath );
|
||||||
LoadBSPFile( bspPath );
|
LoadBSPFilePartially( bspPath );
|
||||||
ParseEntities();
|
ParseEntities();
|
||||||
|
|
||||||
{ /* add visible bspShaders */
|
{ /* add visible bspShaders */
|
||||||
|
|
@ -171,18 +171,6 @@ static void parseBspFile( const char *bspPath, StrList& outShaders, StrList& out
|
||||||
res2list( outShaders, s );
|
res2list( outShaders, s );
|
||||||
for( const auto& s : pk3Sounds )
|
for( const auto& s : pk3Sounds )
|
||||||
res2list( outSounds, s );
|
res2list( outSounds, s );
|
||||||
|
|
||||||
/* free partially loaded bsp data */
|
|
||||||
bspDrawSurfaces.clear();
|
|
||||||
|
|
||||||
entities.clear();
|
|
||||||
numBSPEntities = 0;
|
|
||||||
|
|
||||||
bspShaders.clear();
|
|
||||||
|
|
||||||
bspEntData.clear();
|
|
||||||
|
|
||||||
bspFogs.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -204,12 +204,11 @@ void LoadBSPFile( const char *filename ){
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
PartialLoadBSPFile()
|
LoadBSPFilePartially()
|
||||||
partially loads a bsp file into memory
|
loads bsp file parts meaningful for autopacker
|
||||||
for autopacker
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void PartialLoadBSPFile( const char *filename ){
|
void LoadBSPFilePartially( const char *filename ){
|
||||||
/* dummy check */
|
/* dummy check */
|
||||||
if ( g_game == NULL || g_game->load == NULL ) {
|
if ( g_game == NULL || g_game->load == NULL ) {
|
||||||
Error( "LoadBSPFile: unsupported BSP file format" );
|
Error( "LoadBSPFile: unsupported BSP file format" );
|
||||||
|
|
@ -217,7 +216,7 @@ void PartialLoadBSPFile( const char *filename ){
|
||||||
|
|
||||||
/* load it, then byte swap the in-memory version */
|
/* load it, then byte swap the in-memory version */
|
||||||
//g_game->load( filename );
|
//g_game->load( filename );
|
||||||
PartialLoadIBSPFile( filename );
|
LoadIBSPorRBSPFilePartially( filename );
|
||||||
SwapBSPFile();
|
SwapBSPFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -262,11 +262,11 @@ void LoadIBSPFile( const char *filename ){
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
PartialLoadIBSPFile()
|
LoadIBSPorRBSPFilePartially()
|
||||||
loads a part of quake 3 bsp file, required by packer, into memory
|
loads bsp file parts meaningful for autopacker
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void PartialLoadIBSPFile( const char *filename ){
|
void LoadIBSPorRBSPFilePartially( const char *filename ){
|
||||||
ibspHeader_t *header;
|
ibspHeader_t *header;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -286,7 +286,11 @@ void PartialLoadIBSPFile( const char *filename ){
|
||||||
|
|
||||||
/* load/convert lumps */
|
/* load/convert lumps */
|
||||||
CopyLump( (bspHeader_t*) header, LUMP_SHADERS, bspShaders );
|
CopyLump( (bspHeader_t*) header, LUMP_SHADERS, bspShaders );
|
||||||
CopyLump<bspDrawSurface_t, ibspDrawSurface_t>( (bspHeader_t*) header, LUMP_SURFACES, bspDrawSurfaces );
|
if( g_game->load == LoadIBSPFile )
|
||||||
|
CopyLump<bspDrawSurface_t, ibspDrawSurface_t>( (bspHeader_t*) header, LUMP_SURFACES, bspDrawSurfaces );
|
||||||
|
else
|
||||||
|
CopyLump( (bspHeader_t*) header, LUMP_SURFACES, bspDrawSurfaces );
|
||||||
|
|
||||||
CopyLump( (bspHeader_t*) header, LUMP_FOGS, bspFogs );
|
CopyLump( (bspHeader_t*) header, LUMP_FOGS, bspFogs );
|
||||||
CopyLump( (bspHeader_t*) header, LUMP_ENTITIES, bspEntData );
|
CopyLump( (bspHeader_t*) header, LUMP_ENTITIES, bspEntData );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,4 @@
|
||||||
|
|
||||||
void LoadIBSPFile( const char *filename );
|
void LoadIBSPFile( const char *filename );
|
||||||
void WriteIBSPFile( const char *filename );
|
void WriteIBSPFile( const char *filename );
|
||||||
void PartialLoadIBSPFile( const char *filename );
|
void LoadIBSPorRBSPFilePartially( const char *filename );
|
||||||
|
|
|
||||||
|
|
@ -1844,7 +1844,7 @@ shaderInfo_t *ShaderInfoForShaderNull( const char *shader );
|
||||||
void SwapBlock( int *block, int size );
|
void SwapBlock( int *block, int size );
|
||||||
|
|
||||||
void LoadBSPFile( const char *filename );
|
void LoadBSPFile( const char *filename );
|
||||||
void PartialLoadBSPFile( const char *filename );
|
void LoadBSPFilePartially( const char *filename );
|
||||||
void WriteBSPFile( const char *filename );
|
void WriteBSPFile( const char *filename );
|
||||||
void PrintBSPFileSizes( void );
|
void PrintBSPFileSizes( void );
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user