/* ================ 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 }
/* ================ 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 ); }
/* ================ 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 }
/* ================ idSaveGame::WriteStaticObject ================ */ void idSaveGame::WriteStaticObject( const idClass &obj ) { CallSave_r( obj.GetType(), &obj ); }