inline void PuzzleObject::Archive( Archiver &arc ) { Entity::Archive( arc ); arc.ArchiveString( &_itemToUse ); arc.ArchiveString( &_itemUsedThread ); arc.ArchiveString( &_failedThread ); arc.ArchiveString( &_solvedThread ); arc.ArchiveString( &_canceledThread ); ArchiveEnum( _puzzleState, PuzzleState ); ArchiveEnum( _saveState, PuzzleState ); arc.ArchiveFloat( &_openDistance ); arc.ArchiveBool( &_timed ); arc.ArchiveFloat( &_timeToUse ); arc.ArchiveFloat( &_lastTimeUsed ); arc.ArchiveFloat( &_usedTime ); arc.ArchiveBool( &_hudOn ); arc.ArchiveFloat( &_nextNeedToUseTime ); arc.ArchiveString( &_hudName ); arc.ArchiveInteger( &_minSkill ); }
inline void type_t::Archive( Archiver &arc ) { int i; Class::Archive( arc ); ArchiveEnum( type, etype_t ); if ( arc.Loading() ) { bool onList; arc.ArchiveBool( &onList ); if ( !onList ) { def = new def_t; arc.ArchiveObject( ( Class * )def ); } else { arc.ArchiveObjectPointer( ( Class ** )&def ); } } else { arc.ArchiveBool( &def->_onDefList ); if ( !def->_onDefList ) { arc.ArchiveObject( ( Class * )def ); } else { arc.ArchiveObjectPointer( ( Class ** )&def ); } } /* if ( arc.Loading() ) def = new def_t; arc.ArchiveObject( ( Class * )def ); */ arc.ArchiveObjectPointer( ( Class ** )&def ); arc.ArchiveObjectPointer( ( Class ** )&aux_type ); arc.ArchiveInteger( &num_parms ); arc.ArchiveInteger( &min_parms ); for ( i = 0; i < num_parms; i++ ) arc.ArchiveObjectPointer( ( Class ** )&parm_types[i] ); }
inline void def_t::Archive( Archiver &arc ) { Class::Archive( arc ); arc.ArchiveObjectPointer( ( Class ** )&type ); arc.ArchiveString( &name ); // arc.ArchiveObjectPointer( ( Class ** )&next ); arc.ArchiveInteger( &ofs ); arc.ArchiveInteger( &localofs ); arc.ArchiveObjectPointer( ( Class ** )&scope ); arc.ArchiveInteger( &initialized ); arc.ArchiveBool( &caseSensitive ); arc.ArchiveBool( &_onDefList ); //arc.ArchiveObjectPointer( ( Class ** )&type ); }
// // Name: Archive() // Parameters: Archiver &arc // Description: Archives Class Data // void CombatSubsystem::Archive(Archiver& arc) { _activeWeapon.Archive(arc); arc.ArchiveFloat(&_nextTimeTracedToTarget); arc.ArchiveFloat(&_traceInterval); arc.ArchiveBool(&_canShootTarget); arc.ArchiveFloat(&_yawDiff); }
inline void MoveRandomDirection::Archive(Archiver& arc) { Behavior::Archive(arc); // Archive Parameters arc.ArchiveString(&anim); // Archive Components arc.ArchiveObject(&_chase); // Archive Member Vars arc.ArchiveVector(&_destination); arc.ArchiveUnsigned(&_mode); arc.ArchiveFloat(&_dist); arc.ArchiveFloat(&_minDistance); arc.ArchiveFloat(&_nextChangeTime); arc.ArchiveBool(&_foundGoodDestination); arc.ArchiveBool(&_forever); arc.ArchiveBool(&_faceEnemy); arc.ArchiveString(&_torsoAnim); }
inline void Talk::Archive(Archiver& arc) { Behavior::Archive(arc); arc.ArchiveObject(&turnto); arc.ArchiveSafePointer(&ent_listening); arc.ArchiveSafePointer(&last_headwatch_target); arc.ArchiveFloat(&original_yaw); arc.ArchiveFloat(&yaw); arc.ArchiveInteger(&mode); arc.ArchiveBoolean(&move_allowed); arc.ArchiveBool(&animDone); arc.ArchiveString(&oldAnimName); }
inline void WatchEntity::Archive(Archiver& arc) { Behavior::Archive(arc); // Archive Parameters arc.ArchiveFloat(&_time); arc.ArchiveFloat(&_turnspeed); arc.ArchiveFloat(&_oldTurnSpeed); arc.ArchiveString(&_anim); arc.ArchiveSafePointer(&_ent); arc.ArchiveUnsigned(&_waitForAnim); arc.ArchiveString(&_holdAnim); arc.ArchiveBool(&_forcePlayer); // Archive Member Vars arc.ArchiveUnsigned(&_state); arc.ArchiveUnsigned(&_animDone); }
inline void Work::Archive(Archiver& arc) { Behavior::Archive(arc); // Archive Parameters arc.ArchiveString(&_gotoWorkAnimName); arc.ArchiveFloat(&_maxDistance); // Archive Components arc.ArchiveObject(&_gotoHelperNode); // Archive Member Vars arc.ArchiveSafePointer(&_node); arc.ArchiveUnsigned(&_state); arc.ArchiveBool(&_animDone); arc.ArchiveFloat(&_endTime); arc.ArchiveObjectPointer((Class**)&_self); }
inline void Program::Archive( Archiver &arc ) { int i, num; type_t *curtype, *newtype; def_t *curdef, *newdef; Class::Archive( arc ); /* // Force all of the defs to have indexes forceDefSave = &def_void; arc.ArchiveObjectPointer( ( Class ** )&forceDefSave ); forceDefSave = &def_string; arc.ArchiveObjectPointer( ( Class ** )&forceDefSave ); forceDefSave = &def_float; arc.ArchiveObjectPointer( ( Class ** )&forceDefSave ); forceDefSave = &def_vector; arc.ArchiveObjectPointer( ( Class ** )&forceDefSave ); forceDefSave = &def_entity; arc.ArchiveObjectPointer( ( Class ** )&forceDefSave ); forceDefSave = &def_function; arc.ArchiveObjectPointer( ( Class ** )&forceDefSave ); // Force all of the types to have indexes forceTypeSave = &type_void; arc.ArchiveObjectPointer( ( Class ** )&forceTypeSave ); forceTypeSave = &type_string; arc.ArchiveObjectPointer( ( Class ** )&forceTypeSave ); forceTypeSave = &type_float; arc.ArchiveObjectPointer( ( Class ** )&forceTypeSave ); forceTypeSave = &type_vector; arc.ArchiveObjectPointer( ( Class ** )&forceTypeSave ); forceTypeSave = &type_entity; arc.ArchiveObjectPointer( ( Class ** )&forceTypeSave ); forceTypeSave = &type_function; arc.ArchiveObjectPointer( ( Class ** )&forceTypeSave ); */ // NOTE: must archive global data for pointer fixups arc.ArchiveObject( &def_void ); arc.ArchiveObject( &def_string ); arc.ArchiveObject( &def_float ); arc.ArchiveObject( &def_vector ); arc.ArchiveObject( &def_entity ); arc.ArchiveObject( &def_function ); arc.ArchiveObject( &def_ret ); arc.ArchiveObject( &junkdef ); arc.ArchiveObject( &type_void ); arc.ArchiveObject( &type_string ); arc.ArchiveObject( &type_float ); arc.ArchiveObject( &type_vector ); arc.ArchiveObject( &type_entity ); arc.ArchiveObject( &type_function ); arc.ArchiveInteger( &numpr_globals ); if ( arc.Loading() ) { memset( pr_globals, 0, sizeof( pr_globals[0] ) * MAX_REGS ); } arc.ArchiveRaw( pr_globals, sizeof( pr_globals[0] ) * numpr_globals ); arc.ArchiveInteger( &locals_start ); arc.ArchiveInteger( &locals_end ); for ( i = 0; i < MAX_STRINGS; i++ ) { arc.ArchiveBool( &strings[i].inuse ); if ( strings[i].inuse ) { arc.ArchiveString( &strings[i].s ); } else { strings[i].s = ""; } } arc.ArchiveInteger( &numstatements ); arc.ArchiveRaw( statements, sizeof( statements[0] ) * numstatements ); arc.ArchiveInteger( &numfunctions ); for ( i = 0; i < numfunctions; i++ ) arc.ArchiveObject( ( Class * )&functions[i] ); // archive types if ( arc.Saving() ) { for ( curtype = types, num = 0; curtype; curtype = curtype->next ) { num++; } // Don't count type_function num--; } arc.ArchiveInteger( &num ); if ( arc.Saving() ) { for ( curtype = types; curtype; curtype = curtype->next ) { // Skip type_function (we archive it seperately above) if ( curtype == &type_function ) continue; arc.ArchiveObject( ( Class * )curtype ); } } else { curtype = types; for ( i = 0; i < num; i++ ) { newtype = new type_t; arc.ArchiveObject( ( Class * )newtype ); newtype->next = NULL; curtype->next = newtype; curtype = newtype; } } // archive defs if ( arc.Saving() ) { for ( curdef = def_head.next, num = 0; curdef; curdef = curdef->next ) num++; } arc.ArchiveInteger( &num ); if ( arc.Saving() ) { for ( curdef = def_head.next; curdef; curdef = curdef->next ) arc.ArchiveObject( ( Class * )curdef ); } else { def_tail = &def_head; curdef = def_tail; for ( i = 0; i < num; i++ ) { newdef = new def_t; arc.ArchiveObject( ( Class * )newdef ); newdef->next = NULL; curdef->next = newdef; curdef = newdef; } } arc.ArchiveInteger( &pr_error_count ); filenames.Archive( arc ); arc.ArchiveString( &s_file ); if ( arc.Loading() ) { memset( pr_global_defs, 0, sizeof( pr_global_defs ) ); } for ( i = 0; i < numpr_globals; i++ ) { arc.ArchiveObjectPointer( ( Class ** )&pr_global_defs[i] ); } }
void World::Archive( Archiver &arc ) { int i; int num; TargetList *tempTargetList; Entity::Archive( arc ); if ( arc.Loading() ) { FreeTargetList(); } if ( arc.Saving() ) num = targetList.NumObjects(); arc.ArchiveInteger( &num ); for ( i = 1; i <= num; i++ ) { if ( arc.Saving() ) { tempTargetList = targetList.ObjectAt( i ); } else { tempTargetList = new TargetList; targetList.AddObject( tempTargetList ); } arc.ArchiveObject( ( Class * )tempTargetList ); } _brokenThings.Archive( arc ); _availableViewModes.Archive( arc ); arc.ArchiveBoolean( &world_dying ); arc.ArchiveString( &skipthread ); arc.ArchiveFloat( &farplane_distance ); arc.ArchiveVector( &farplane_color ); arc.ArchiveBoolean( &farplane_cull ); arc.ArchiveBoolean( &farplane_fog ); arc.ArchiveBoolean( &terrain_global ); arc.ArchiveFloat( &terrain_global_min ); arc.ArchiveFloat( &entity_fade_dist ); for( i = 0 ; i < MAX_LIGHTING_GROUPS ; i++ ) dynamic_lights[ i ].Archive( arc ); wind.Archive( arc ); weather.Archive( arc ); arc.ArchiveFloat( &time_scale ); arc.ArchiveFloat( &sky_alpha ); arc.ArchiveBoolean( &sky_portal ); for ( i = 0 ; i < WORLD_PHYSICS_TOTAL_NUMBER ; i++ ) { arc.ArchiveFloat( &_physicsInfo[ i ] ); } arc.ArchiveBool( &_canShakeCamera ); if ( arc.Loading() ) { UpdateConfigStrings(); UpdateFog(); UpdateTerrain(); UpdateSky(); UpdateDynamicLights(); UpdateWindDirection(); UpdateWindIntensity(); UpdateWeather(); UpdateTimeScale(); } // Archive groupcoordinator (not part of world but this is a good place) if ( arc.Loading() ) { if ( groupcoordinator ) delete groupcoordinator; groupcoordinator = new GroupCoordinator; } groupcoordinator->Archive( arc ); }
void Level::Archive( Archiver &arc ) { int num; int i; Class::Archive( arc ); if ( arc.Saving() ) { SafePtr<Earthquake> ent; num = _earthquakes.NumObjects(); arc.ArchiveInteger( &num ); for ( i = 1 ; i <= num ; i++ ) { ent = _earthquakes.ObjectAt( i ); arc.ArchiveSafePointer( &ent ); } } else { SafePtr<Earthquake> ent; SafePtr<Earthquake> *entityPointer; arc.ArchiveInteger( &num ); _earthquakes.ClearObjectList(); _earthquakes.Resize( num ); for ( i = 1 ; i <= num ; i++ ) { _earthquakes.AddObject( ent ); entityPointer = &_earthquakes.ObjectAt( i ); arc.ArchiveSafePointer( entityPointer ); } } arc.ArchiveInteger( &_totalEnemiesSpawned ); // Don't archive these //const char *current_map; //const char *current_entities; //int spawn_entnum; arc.ArchiveInteger( ¤tInstanceNumber ); //int spawnflags; arc.ArchiveInteger( &framenum ); arc.ArchiveInteger( &inttime ); arc.ArchiveFloat( &time ); arc.ArchiveFloat( &timeInLevel ); arc.ArchiveFloat( &frametime ); arc.ArchiveFloat( &fixedframetime ); arc.ArchiveInteger( &startTime ); arc.ArchiveString( &level_name ); arc.ArchiveString( &mapname ); arc.ArchiveString( &spawnpoint ); arc.ArchiveString( &nextmap ); arc.ArchiveBoolean( &restart ); arc.ArchiveBoolean( &started ); arc.ArchiveBoolean( &playerfrozen ); arc.ArchiveFloat( &intermissiontime ); arc.ArchiveInteger( &exitintermission ); arc.ArchiveFloat( &intermission_advancetime ); arc.ArchiveBool( &_showIntermission ); arc.ArchiveBool( &_saveOrientation ); // Don't archive //gentity_s *next_edict; arc.ArchiveInteger( &total_secrets ); arc.ArchiveInteger( &found_secrets ); arc.ArchiveInteger( &total_specialItems ); arc.ArchiveInteger( &found_specialItems ); arc.ArchiveString( &game_script ); // Don't archive //trace_t impact_trace; arc.ArchiveBoolean( &cinematic ); arc.ArchiveBoolean( &ai_on ); arc.ArchiveBoolean( &mission_failed ); arc.ArchiveBoolean( &died_already ); arc.ArchiveBoolean( &near_exit ); arc.ArchiveVector( &water_color ); arc.ArchiveFloat( &water_alpha ); arc.ArchiveVector( &slime_color ); arc.ArchiveFloat( &slime_alpha ); arc.ArchiveVector( &lava_color ); arc.ArchiveFloat( &lava_alpha ); arc.ArchiveString( ¤t_soundtrack ); arc.ArchiveString( &saved_soundtrack ); arc.ArchiveObjectPointer( ( Class ** )&consoleThread ); arc.ArchiveVector( &m_fade_color ); arc.ArchiveFloat( &m_fade_alpha ); arc.ArchiveFloat( &m_fade_time ); arc.ArchiveFloat( & m_fade_time_start ); ArchiveEnum( m_fade_type, fadetype_t ); ArchiveEnum( m_fade_style, fadestyle_t ); arc.ArchiveFloat( &m_letterbox_fraction ); arc.ArchiveFloat( &m_letterbox_time ); arc.ArchiveFloat( &m_letterbox_time_start ); ArchiveEnum( m_letterbox_dir, letterboxdir_t ); arc.ArchiveBool( &_cleanup ); arc.ArchiveString( &_playerDeathThread ); arc.ArchiveObjectPointer( ( Class ** )&hNodeController ); // Don't archive, will already be setup from camera code // Container<Camera *> automatic_cameras; arc.ArchiveVector( & m_intermission_origin ); arc.ArchiveVector( & m_intermission_angle ); if ( arc.Loading() ) { str temp_soundtrack; // Change the sound track to the one just loaded temp_soundtrack = saved_soundtrack; ChangeSoundtrack( current_soundtrack.c_str() ); saved_soundtrack = temp_soundtrack; // not archived since we can't save mid-frame next_edict = NULL; // not archived since we can't save mid-frame memset( &impact_trace, 0, sizeof( impact_trace ) ); loadLevelStrings(); } }