예제 #1
0
/*
================
idSaveGame::Close
================
*/
void idSaveGame::Close()
{
	WriteSoundCommands();
	
	// read trace models
	idClipModel::SaveTraceModels( this );
	
	for( int i = 1; i < objects.Num(); i++ )
	{
		CallSave_r( objects[ i ]->GetType(), objects[ i ] );
	}
	
	objects.Clear();
	
	// Save out the string table at the end of the file
	for( int i = 0; i < stringTable.Num(); ++i )
	{
		stringFile->WriteString( stringTable[i].string );
	}
	
	stringHash.Free();
	stringTable.Clear();
	
	if( file->Length() > MIN_SAVEGAME_SIZE_BYTES || stringFile->Length() > MAX_SAVEGAME_STRING_TABLE_SIZE )
	{
		idLib::FatalError( "OVERFLOWED SAVE GAME FILE BUFFER" );
	}
	
#ifdef ID_DEBUG_MEMORY
	idStr gameState = file->GetName();
	gameState.StripFileExtension();
	WriteGameState_f( idCmdArgs( va( "test %s_save", gameState.c_str() ), false ) );
#endif
}
예제 #2
0
/*
================
idSaveGame::CallSave_r
================
*/
void idSaveGame::CallSave_r( const idTypeInfo *cls, const idClass *obj ) {
	if( cls->super ) {
		CallSave_r( cls->super, obj );
		if( cls->super->Save == cls->Save ) {
			// don't call save on this inheritance level since the function was called in the super class
			return;
		}
	}
	( obj->*cls->Save )( this );
}
예제 #3
0
/*
================
idSaveGame::Close
================
*/
void idSaveGame::Close( void ) {
	int i;
	WriteSoundCommands();
	// read trace models
	idClipModel::SaveTraceModels( this );
	for( i = 1; i < objects.Num(); i++ ) {
		CallSave_r( objects[ i ]->GetType(), objects[ i ] );
	}
	objects.Clear();
#ifdef ID_DEBUG_MEMORY
	idStr gameState = file->GetName();
	gameState.StripFileExtension();
	WriteGameState_f( idCmdArgs( va( "test %s_save", gameState.c_str() ), false ) );
#endif
}
예제 #4
0
/*
================
idSaveGame::WriteStaticObject
================
*/
void idSaveGame::WriteStaticObject( const idClass &obj ) {
	CallSave_r( obj.GetType(), &obj );
}