I'll try that since it will save work down the line. Basically, my class loads BSPs like this...
Code:
bool CBSPReader::Open( const char* pszPath )
{
m_pFile = fopen( pszPath, "rb" );
if ( m_pFile != NULL )
{
if ( ReadHeader( ) == true )
{
return true;
}
}
return false;
}
bool CBSPReader::ReadHeader( void )
{
m_pHeader = new dheader_t( );
if ( m_pHeader != NULL )
{
fread( m_pHeader, sizeof( dheader_t ), 1, m_pFile );
return true;
}
return false;
}
bool CBSPReader::LoadData( unsigned int uiBits )
{
if ( uiBits & LOAD_MODELS )
{
m_pModels = new dmodel_t[ MAX_MAP_MODELS ];
if ( m_pModels == NULL )
return false;
ReadLump( LUMP_MODELS, m_pModels );
}
...
...
ect...
Shouldn't be that hard to change since the header is loaded and verified before any other loading takes place.
Actually, the user must specify ( with a bitmask ) what parts of the BSP to load. That should take place after Open returns true.