Exemplo n.º 1
0
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 );
}
Exemplo n.º 2
0
void DefaultStrategos::Archive( Archiver &arc )
{
	Strategos::Archive( arc );

	arc.ArchiveFloat( &_checkYawMin );
	arc.ArchiveFloat( &_checkYawMax );
	arc.ArchiveFloat( &_checkInConeDistMax );
}
//
// 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);
}
Exemplo n.º 4
0
//
// Name:        DoArchive
// Parameters:  Archiver &arc
//              Actor *actor
// Description: Sets the Actor pointer during archiving
//
void PackageManager::DoArchive( Archiver &arc , Actor *actor )
{
	int i;
	BehaviorPackageEntry_t *pEntry;
	BehaviorPackageType_t  *package;
	int numPackages;
	str packageName;

	if ( actor )
		act = actor;
	else 
		gi.Error( ERR_FATAL, "PackageManager::DoArchive -- actor is NULL" );

	if ( arc.Loading() )
	{
		arc.ArchiveInteger( &numPackages );

		for ( i = 1 ; i <= numPackages ; i++ )
		{
			arc.ArchiveString( &packageName );

			RegisterPackage( packageName );

			// The package we just added should always be the last one

			pEntry = &_BehaviorPackages.ObjectAt( _BehaviorPackages.NumObjects() );

			arc.ArchiveFloat( &pEntry->currentScore );
			arc.ArchiveFloat( &pEntry->lastScore );
			arc.ArchiveFloat( &pEntry->lastTimeExecuted );
			arc.ArchiveFloat( &pEntry->priority );
		}

	}
	else
	{
		numPackages = _BehaviorPackages.NumObjects();
		arc.ArchiveInteger( &numPackages );

		for ( i = 1 ; i <= _BehaviorPackages.NumObjects() ; i++ )
		{
			pEntry = &_BehaviorPackages.ObjectAt( i );

			package = PackageList.ObjectAt( pEntry->packageIndex );

			arc.ArchiveString( &package->packageName );

			arc.ArchiveFloat( &pEntry->currentScore );
			arc.ArchiveFloat( &pEntry->lastScore );
			arc.ArchiveFloat( &pEntry->lastTimeExecuted );
			arc.ArchiveFloat( &pEntry->priority );
		}
	}

	arc.ArchiveInteger( &_currentFVarIndex );
	arc.ArchiveFloat( &_currentFVarLastExecuteTime );
	arc.ArchiveInteger( &_currentPackageIndex );
}
Exemplo n.º 5
0
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);
}
//
// Name:        Archive()
// Parameters:  Archiver &arc -- The archiver object
// Description: Archives the class
//
void SensoryPerception::Archive ( Archiver &arc )
{	
	arc.ArchiveInteger ( &_stimuli                   );
	arc.ArchiveInteger ( &_permanent_stimuli         );
	arc.ArchiveVector  ( &_noise_position            );
	arc.ArchiveInteger ( &_last_soundType            );
	arc.ArchiveFloat   ( &_noise_time                );
	arc.ArchiveFloat   ( &_fov                       );
	arc.ArchiveFloat   ( &_fovdot                    );
	arc.ArchiveFloat   ( &_vision_distance           );
	arc.ArchiveFloat   ( &_nextSenseTime	          );
	
	arc.ArchiveInteger( &_lineOfSight.entNum );
	arc.ArchiveFloat( &_lineOfSight.time );
	arc.ArchiveBoolean( &_lineOfSight.inLineOfSight );
}
Exemplo n.º 7
0
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);
}
Exemplo n.º 8
0
inline void WatchEntityEX::Archive(Archiver& arc) {
	Behavior::Archive(arc);

	// Archive Parameters
	arc.ArchiveString(&_stance);
	arc.ArchiveString(&_shuffleAnim);
	arc.ArchiveString(&_torsoAnim);
	arc.ArchiveSafePointer(&_ent);

	// Archive Components	
	arc.ArchiveObject(&_rotateToEntity);

	// Archive Member Vars      
	arc.ArchiveUnsigned(&_state);
	arc.ArchiveFloat(&_time);
	arc.ArchiveFloat(&_turnspeed);

}
Exemplo n.º 9
0
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);
}
Exemplo n.º 10
0
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);
}
Exemplo n.º 11
0
void Entity::Archive( Archiver &arc )
{
	SimpleEntity::Archive( arc );

	arc.ArchiveBoolean( &fShader );

	if( fShader )
	{
		arc.ArchiveString( &shader );

		if( arc.Loading() ) {
			customshader = cgi.R_RegisterShader( shader );
		}
	}

	arc.ArchiveBoolean( &canThink );

	arc.ArchiveFloat( &scale );
	arc.ArchiveInteger( &entnum );
	arc.ArchiveInteger( &renderFx );

	arc.ArchiveString( &model );
}
Exemplo n.º 12
0
void Personality::Archive( Archiver &arc )
{
	int i;
	int j;
	int num;
	str packageName;
	BehaviorPackageType_t  *package;
	PackageTendency_t      *tendency;
	PackageTendency_t      tempTendency;
	
	Tendency_t             tempGeneralTendency;
	Tendency_t             *generalTendency;
	
	tempTendency.packageIndex = 0;
	tempTendency.tendency = 0.0f;
	tempTendency.lastTendencyCheck = 0.0f;
	
	arc.ArchiveFloat( &_aggressiveness );
	arc.ArchiveFloat( &_talkiness );
	
	arc.ArchiveFloat( &_anger );
	arc.ArchiveFloat( &_fear );
	
	if ( arc.Saving() )
	{
		num = _PackageTendencies.NumObjects();
		
		arc.ArchiveInteger( &num );
		
		for ( i = 1 ; i <= num ; i++ )
		{
			tendency = &_PackageTendencies.ObjectAt( i );
			
			package = PackageList.ObjectAt( tendency->packageIndex );
			
			arc.ArchiveString( &package->packageName );
			arc.ArchiveFloat( &tendency->tendency );
			arc.ArchiveFloat( &tendency->lastTendencyCheck );
			
		}
	}
	else
	{
		arc.ArchiveInteger( &num );
		
		_PackageTendencies.ClearObjectList();
		_PackageTendencies.Resize( num );
		
		for ( i = 1 ; i <= num ; i++ )
		{
			_PackageTendencies.AddObject( tempTendency );
			
			tendency = &_PackageTendencies.ObjectAt( i );
			
			arc.ArchiveString( &packageName );
			
			// Find index
			
			tendency->packageIndex = -1;
			
			for ( j = 1 ; j <= PackageList.NumObjects() ; j++ )
			{
				package = PackageList.ObjectAt( j );
				
				if ( stricmp( packageName.c_str() , package->packageName.c_str() ) == 0 )
				{
					tendency->packageIndex = j;
					break;
				}
			}
			
			assert( tendency->packageIndex != -1 );
			
			arc.ArchiveFloat( &tendency->tendency );
			arc.ArchiveFloat( &tendency->lastTendencyCheck );
		}
	}
	
	
	if ( arc.Saving() )
	{
		num = _Tendencies.NumObjects();
		
		arc.ArchiveInteger( &num );
		
		for ( i = 1 ; i <= num ; i++ )
		{
			generalTendency = &_Tendencies.ObjectAt( i );		
			
			arc.ArchiveString( &generalTendency->tendencyName  );
			arc.ArchiveFloat( &generalTendency->tendencyValue  );	
			
		}
	}
	else
	{
		arc.ArchiveInteger( &num );
		
		_Tendencies.ClearObjectList();
		_Tendencies.Resize( num );
		
		for ( i = 1 ; i <= num ; i++ )
		{
			_Tendencies.AddObject( tempGeneralTendency );
			
			generalTendency = &_Tendencies.ObjectAt( i );
			
			arc.ArchiveString( &generalTendency->tendencyName  );
			arc.ArchiveFloat( &generalTendency->tendencyValue  );
		}
	}
}
Exemplo n.º 13
0
void Strategos::Archive( Archiver &arc )
{
	arc.ArchiveFloat( &_sightBasedHate );
	arc.ArchiveFloat( &_nextEvaluateTime );
	arc.ArchiveFloat( &_evaluateInterval );
}
Exemplo n.º 14
0
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 );
}
Exemplo n.º 15
0
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( &currentInstanceNumber );
    //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( &current_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();
	}
	
}