Fix all whitespace errors

Excluding 3rd party files.
This commit is contained in:
dhewg 2011-12-06 19:20:15 +01:00 committed by Daniel Gibson
parent eac3112d2d
commit c7c187e4dc
424 changed files with 5695 additions and 5729 deletions

View file

@ -1261,7 +1261,7 @@ void idAF::RemoveBindConstraints( void ) {
name.Strip( "bindConstraint " ); name.Strip( "bindConstraint " );
if ( physicsObj.GetConstraint( name ) ) { if ( physicsObj.GetConstraint( name ) ) {
physicsObj.DeleteConstraint( name ); physicsObj.DeleteConstraint( name );
} }
kv = args.MatchPrefix( "bindConstraint ", kv ); kv = args.MatchPrefix( "bindConstraint ", kv );

View file

@ -3116,7 +3116,7 @@ idRenderModel *idGameEdit::AF_CreateMesh( const idDict &args, idVec3 &meshOrigin
modifiedAxis[ jointNum ] = ( bodyAxis[i] * originalJoints[jointNum].ToMat3().Transpose() ).Transpose() * ( newBodyAxis[i] * meshAxis.Transpose() ); modifiedAxis[ jointNum ] = ( bodyAxis[i] * originalJoints[jointNum].ToMat3().Transpose() ).Transpose() * ( newBodyAxis[i] * meshAxis.Transpose() );
// FIXME: calculate correct modifiedOrigin // FIXME: calculate correct modifiedOrigin
modifiedOrigin[ jointNum ] = originalJoints[ jointNum ].ToVec3(); modifiedOrigin[ jointNum ] = originalJoints[ jointNum ].ToVec3();
} }
} }
// apply joint modifications to the skeleton // apply joint modifications to the skeleton

View file

@ -627,7 +627,7 @@ void idActor::Spawn( void ) {
int headAnim = headAnimator->GetAnim( "def_head" ); int headAnim = headAnimator->GetAnim( "def_head" );
if ( headAnim ) { if ( headAnim ) {
if ( headEnt ) { if ( headEnt ) {
headAnimator->CycleAnim( ANIMCHANNEL_ALL, headAnim, gameLocal.time, 0 ); headAnimator->CycleAnim( ANIMCHANNEL_ALL, headAnim, gameLocal.time, 0 );
} else { } else {
headAnimator->CycleAnim( ANIMCHANNEL_HEAD, headAnim, gameLocal.time, 0 ); headAnimator->CycleAnim( ANIMCHANNEL_HEAD, headAnim, gameLocal.time, 0 );
} }
@ -3268,7 +3268,7 @@ void idActor::Event_NextEnemy( idEntity *ent ) {
} }
} }
idThread::ReturnEntity( NULL ); idThread::ReturnEntity( NULL );
} }
/* /*

View file

@ -416,7 +416,7 @@ bool idBrittleFracture::UpdateRenderEntity( renderEntity_s *renderEntity, const
} }
packedColor = PackColor( idVec4( renderEntity->shaderParms[ SHADERPARM_RED ] * fade, packedColor = PackColor( idVec4( renderEntity->shaderParms[ SHADERPARM_RED ] * fade,
renderEntity->shaderParms[ SHADERPARM_GREEN ] * fade, renderEntity->shaderParms[ SHADERPARM_GREEN ] * fade,
renderEntity->shaderParms[ SHADERPARM_BLUE ] * fade, renderEntity->shaderParms[ SHADERPARM_BLUE ] * fade,
fade ) ); fade ) );
const idWinding &winding = shards[i]->winding; const idWinding &winding = shards[i]->winding;
@ -946,7 +946,7 @@ void idBrittleFracture::DropFloatingIslands( const idVec3 &point, const idVec3 &
continue; continue;
} }
queueStart = 0; queueStart = 0;
queueEnd = 1; queueEnd = 1;
queue[0] = shards[i]; queue[0] = shards[i];
shards[i]->islandNum = numIslands+1; shards[i]->islandNum = numIslands+1;

View file

@ -63,4 +63,3 @@ private:
void Event_Trigger( idEntity *activator ); void Event_Trigger( idEntity *activator );
}; };

View file

@ -160,8 +160,8 @@ ABSTRACT_DECLARATION( idClass, idEntity )
EVENT( EV_GetMins, idEntity::Event_GetMins) EVENT( EV_GetMins, idEntity::Event_GetMins)
EVENT( EV_GetMaxs, idEntity::Event_GetMaxs ) EVENT( EV_GetMaxs, idEntity::Event_GetMaxs )
EVENT( EV_Touches, idEntity::Event_Touches ) EVENT( EV_Touches, idEntity::Event_Touches )
EVENT( EV_SetGuiParm, idEntity::Event_SetGuiParm ) EVENT( EV_SetGuiParm, idEntity::Event_SetGuiParm )
EVENT( EV_SetGuiFloat, idEntity::Event_SetGuiFloat ) EVENT( EV_SetGuiFloat, idEntity::Event_SetGuiFloat )
EVENT( EV_GetNextKey, idEntity::Event_GetNextKey ) EVENT( EV_GetNextKey, idEntity::Event_GetNextKey )
EVENT( EV_SetKey, idEntity::Event_SetKey ) EVENT( EV_SetKey, idEntity::Event_SetKey )
EVENT( EV_GetKey, idEntity::Event_GetKey ) EVENT( EV_GetKey, idEntity::Event_GetKey )
@ -2429,7 +2429,7 @@ void idEntity::JoinTeam( idEntity *teammember ) {
ent->teamChain->teamMaster = master; ent->teamChain->teamMaster = master;
} }
prev->teamChain = this; prev->teamChain = this;
ent->teamChain = next; ent->teamChain = next;
} }
@ -2959,9 +2959,9 @@ explosions and melee attacks.
============ ============
*/ */
bool idEntity::CanDamage( const idVec3 &origin, idVec3 &damagePoint ) const { bool idEntity::CanDamage( const idVec3 &origin, idVec3 &damagePoint ) const {
idVec3 dest; idVec3 dest;
trace_t tr; trace_t tr;
idVec3 midpoint; idVec3 midpoint;
// use the midpoint of the bounds instead of the origin, because // use the midpoint of the bounds instead of the origin, because
// bmodels may have their origin at 0,0,0 // bmodels may have their origin at 0,0,0
@ -4499,9 +4499,9 @@ void idEntity::Event_RestorePosition( void ) {
if ( spawnArgs.GetMatrix( "rotation", "1 0 0 0 1 0 0 0 1", axis ) ) { if ( spawnArgs.GetMatrix( "rotation", "1 0 0 0 1 0 0 0 1", axis ) ) {
angles = axis.ToAngles(); angles = axis.ToAngles();
} else { } else {
angles[ 0 ] = 0; angles[ 0 ] = 0;
angles[ 1 ] = spawnArgs.GetFloat( "angle" ); angles[ 1 ] = spawnArgs.GetFloat( "angle" );
angles[ 2 ] = 0; angles[ 2 ] = 0;
} }
Teleport( org, angles, NULL ); Teleport( org, angles, NULL );

View file

@ -536,12 +536,12 @@ protected:
private: private:
void Event_GetJointHandle( const char *jointname ); void Event_GetJointHandle( const char *jointname );
void Event_ClearAllJoints( void ); void Event_ClearAllJoints( void );
void Event_ClearJoint( jointHandle_t jointnum ); void Event_ClearJoint( jointHandle_t jointnum );
void Event_SetJointPos( jointHandle_t jointnum, jointModTransform_t transform_type, const idVec3 &pos ); void Event_SetJointPos( jointHandle_t jointnum, jointModTransform_t transform_type, const idVec3 &pos );
void Event_SetJointAngle( jointHandle_t jointnum, jointModTransform_t transform_type, const idAngles &angles ); void Event_SetJointAngle( jointHandle_t jointnum, jointModTransform_t transform_type, const idAngles &angles );
void Event_GetJointPos( jointHandle_t jointnum ); void Event_GetJointPos( jointHandle_t jointnum );
void Event_GetJointAngle( jointHandle_t jointnum ); void Event_GetJointAngle( jointHandle_t jointnum );
}; };

View file

@ -43,7 +43,7 @@ const idEventDef EV_Fx_KillFx( "_killfx" );
const idEventDef EV_Fx_Action( "_fxAction", "e" ); // implemented by subclasses const idEventDef EV_Fx_Action( "_fxAction", "e" ); // implemented by subclasses
CLASS_DECLARATION( idEntity, idEntityFx ) CLASS_DECLARATION( idEntity, idEntityFx )
EVENT( EV_Activate, idEntityFx::Event_Trigger ) EVENT( EV_Activate, idEntityFx::Event_Trigger )
EVENT( EV_Fx_KillFx, idEntityFx::Event_ClearFx ) EVENT( EV_Fx_KillFx, idEntityFx::Event_ClearFx )
END_CLASS END_CLASS

View file

@ -241,7 +241,7 @@ public:
// Animation system calls for non-game based skeletal rendering. // Animation system calls for non-game based skeletal rendering.
virtual idRenderModel * ANIM_GetModelFromEntityDef( const char *classname ); virtual idRenderModel * ANIM_GetModelFromEntityDef( const char *classname );
virtual const idVec3 &ANIM_GetModelOffsetFromEntityDef( const char *classname ); virtual const idVec3 &ANIM_GetModelOffsetFromEntityDef( const char *classname );
virtual idRenderModel * ANIM_GetModelFromEntityDef( const idDict *args ); virtual idRenderModel * ANIM_GetModelFromEntityDef( const idDict *args );
virtual idRenderModel * ANIM_GetModelFromName( const char *modelName ); virtual idRenderModel * ANIM_GetModelFromName( const char *modelName );
virtual const idMD5Anim * ANIM_GetAnimFromEntityDef( const char *classname, const char *animname ); virtual const idMD5Anim * ANIM_GetAnimFromEntityDef( const char *classname, const char *animname );

View file

@ -176,7 +176,7 @@ void idDragEntity::Update( idPlayer *player ) {
player->GetViewPos( viewPoint, viewAxis ); player->GetViewPos( viewPoint, viewAxis );
// if no entity selected for dragging // if no entity selected for dragging
if ( !dragEnt.GetEntity() ) { if ( !dragEnt.GetEntity() ) {
if ( player->usercmd.buttons & BUTTON_ATTACK ) { if ( player->usercmd.buttons & BUTTON_ATTACK ) {
@ -470,7 +470,7 @@ idEditEntities::RemoveSelectedEntity
============== ==============
*/ */
void idEditEntities::RemoveSelectedEntity( idEntity *ent ) { void idEditEntities::RemoveSelectedEntity( idEntity *ent ) {
if ( selectedEntities.Find( ent ) ) { if ( selectedEntities.Find( ent ) ) {
selectedEntities.Remove( ent ); selectedEntities.Remove( ent );
} }
} }

View file

@ -2240,7 +2240,7 @@ bool idGameLocal::InPlayerPVS( idEntity *ent ) const {
if ( playerPVS.i == -1 ) { if ( playerPVS.i == -1 ) {
return false; return false;
} }
return pvs.InCurrentPVS( playerPVS, ent->GetPVSAreas(), ent->GetNumPVSAreas() ); return pvs.InCurrentPVS( playerPVS, ent->GetPVSAreas(), ent->GetNumPVSAreas() );
} }
/* /*
@ -2254,7 +2254,7 @@ bool idGameLocal::InPlayerConnectedArea( idEntity *ent ) const {
if ( playerConnectedAreas.i == -1 ) { if ( playerConnectedAreas.i == -1 ) {
return false; return false;
} }
return pvs.InCurrentPVS( playerConnectedAreas, ent->GetPVSAreas(), ent->GetNumPVSAreas() ); return pvs.InCurrentPVS( playerConnectedAreas, ent->GetPVSAreas(), ent->GetNumPVSAreas() );
} }
/* /*
@ -2269,7 +2269,7 @@ void idGameLocal::UpdateGravity( void ) {
if ( g_gravity.GetFloat() == 0.0f ) { if ( g_gravity.GetFloat() == 0.0f ) {
g_gravity.SetFloat( 1.0f ); g_gravity.SetFloat( 1.0f );
} }
gravity.Set( 0, 0, -g_gravity.GetFloat() ); gravity.Set( 0, 0, -g_gravity.GetFloat() );
// update all physics objects // update all physics objects
for( ent = spawnedEntities.Next(); ent != NULL; ent = ent->spawnNode.Next() ) { for( ent = spawnedEntities.Next(); ent != NULL; ent = ent->spawnNode.Next() ) {
@ -3575,7 +3575,7 @@ int idGameLocal::GetTargets( const idDict &args, idList< idEntityPtr<idEntity> >
ent = FindEntity( arg->GetValue() ); ent = FindEntity( arg->GetValue() );
if ( ent ) { if ( ent ) {
idEntityPtr<idEntity> &entityPtr = list.Alloc(); idEntityPtr<idEntity> &entityPtr = list.Alloc();
entityPtr = ent; entityPtr = ent;
} }
} }
} }
@ -3844,7 +3844,7 @@ void idGameLocal::RadiusDamage( const idVec3 &origin, idEntity *inflictor, idEnt
idEntity * entityList[ MAX_GENTITIES ]; idEntity * entityList[ MAX_GENTITIES ];
int numListedEntities; int numListedEntities;
idBounds bounds; idBounds bounds;
idVec3 v, damagePoint, dir; idVec3 v, damagePoint, dir;
int i, e, damage, radius, push; int i, e, damage, radius, push;
const idDict *damageDef = FindEntityDefDict( damageDefName, false ); const idDict *damageDef = FindEntityDefDict( damageDefName, false );
@ -4983,4 +4983,3 @@ idGameLocal::GetMapLoadingGUI
=============== ===============
*/ */
void idGameLocal::GetMapLoadingGUI( char gui[ MAX_STRING_CHARS ] ) { } void idGameLocal::GetMapLoadingGUI( char gui[ MAX_STRING_CHARS ] ) { }

View file

@ -461,7 +461,7 @@ int idGrabber::Update( idPlayer *player, bool hide ) {
owner = player; owner = player;
// if no entity selected for dragging // if no entity selected for dragging
if ( !dragEnt.GetEntity() ) { if ( !dragEnt.GetEntity() ) {
idBounds bounds; idBounds bounds;
idVec3 end = player->firstPersonViewOrigin + player->firstPersonViewAxis[0] * dragTraceDist; idVec3 end = player->firstPersonViewOrigin + player->firstPersonViewAxis[0] * dragTraceDist;

View file

@ -302,7 +302,7 @@ void idItem::Spawn( void ) {
if ( spawnArgs.GetBool( "spin" ) || (gameLocal.isMultiplayer && !this->IsType( idItemTeam::Type ) ) ) { if ( spawnArgs.GetBool( "spin" ) || (gameLocal.isMultiplayer && !this->IsType( idItemTeam::Type ) ) ) {
spin = true; spin = true;
BecomeActive( TH_THINK ); BecomeActive( TH_THINK );
} }
#else #else
if ( spawnArgs.GetBool( "spin" ) || gameLocal.isMultiplayer ) { if ( spawnArgs.GetBool( "spin" ) || gameLocal.isMultiplayer ) {
spin = true; spin = true;
@ -677,12 +677,12 @@ idItemTeam::idItemTeam
=============== ===============
*/ */
idItemTeam::idItemTeam() { idItemTeam::idItemTeam() {
team = -1; team = -1;
carried = false; carried = false;
dropped = false; dropped = false;
lastDrop = 0; lastDrop = 0;
itemGlowHandle = -1; itemGlowHandle = -1;
skinDefault = NULL; skinDefault = NULL;
skinCarried = NULL; skinCarried = NULL;
@ -710,7 +710,7 @@ idItemTeam::Spawn
=============== ===============
*/ */
void idItemTeam::Spawn( void ) { void idItemTeam::Spawn( void ) {
team = spawnArgs.GetInt( "team" ); team = spawnArgs.GetInt( "team" );
returnOrigin = GetPhysics()->GetOrigin() + idVec3( 0, 0, 20 ); returnOrigin = GetPhysics()->GetOrigin() + idVec3( 0, 0, 20 );
returnAxis = GetPhysics()->GetAxis(); returnAxis = GetPhysics()->GetAxis();
@ -829,18 +829,18 @@ idItemTeam::Pickup
=============== ===============
*/ */
bool idItemTeam::Pickup( idPlayer *player ) { bool idItemTeam::Pickup( idPlayer *player ) {
if ( !gameLocal.mpGame.IsGametypeFlagBased() ) /* CTF */ if ( !gameLocal.mpGame.IsGametypeFlagBased() ) /* CTF */
return false; return false;
if ( gameLocal.mpGame.GetGameState() == idMultiplayerGame::WARMUP || if ( gameLocal.mpGame.GetGameState() == idMultiplayerGame::WARMUP ||
gameLocal.mpGame.GetGameState() == idMultiplayerGame::COUNTDOWN ) gameLocal.mpGame.GetGameState() == idMultiplayerGame::COUNTDOWN )
return false; return false;
// wait 2 seconds after drop before beeing picked up again // wait 2 seconds after drop before beeing picked up again
if ( lastDrop != 0 && (gameLocal.time - lastDrop) < spawnArgs.GetInt("pickupDelay", "500") ) if ( lastDrop != 0 && (gameLocal.time - lastDrop) < spawnArgs.GetInt("pickupDelay", "500") )
return false; return false;
if ( carried == false && player->team != this->team ) { if ( carried == false && player->team != this->team ) {
PostEventMS( &EV_TakeFlag, 0, player ); PostEventMS( &EV_TakeFlag, 0, player );
@ -864,7 +864,7 @@ idItemTeam::ClientReceiveEvent
=============== ===============
*/ */
bool idItemTeam::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) { bool idItemTeam::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) {
gameLocal.DPrintf("ClientRecieveEvent: %i\n", event ); gameLocal.DPrintf("ClientRecieveEvent: %i\n", event );
switch ( event ) { switch ( event ) {
case EVENT_TAKEFLAG: { case EVENT_TAKEFLAG: {
@ -905,7 +905,7 @@ bool idItemTeam::ClientReceiveEvent( int event, int time, const idBitMsg &msg )
return true; return true;
}; };
return false; return false;
} }
/* /*
@ -995,7 +995,7 @@ idItemTeam::Event_TakeFlag
================ ================
*/ */
void idItemTeam::Event_TakeFlag( idPlayer * player ) { void idItemTeam::Event_TakeFlag( idPlayer * player ) {
gameLocal.DPrintf("Event_TakeFlag()!\n"); gameLocal.DPrintf("Event_TakeFlag()!\n");
if ( gameLocal.isServer ) { if ( gameLocal.isServer ) {
idBitMsg msg; idBitMsg msg;
@ -1044,14 +1044,14 @@ void idItemTeam::Event_TakeFlag( idPlayer * player ) {
SetSkin( skinCarried ); SetSkin( skinCarried );
UpdateVisuals(); UpdateVisuals();
UpdateGuis(); UpdateGuis();
if ( gameLocal.isServer ) { if ( gameLocal.isServer ) {
if ( team == 0 ) if ( team == 0 )
gameLocal.mpGame.player_red_flag = player->entityNumber; gameLocal.mpGame.player_red_flag = player->entityNumber;
else else
gameLocal.mpGame.player_blue_flag = player->entityNumber; gameLocal.mpGame.player_blue_flag = player->entityNumber;
} }
} }
/* /*
@ -1060,7 +1060,7 @@ idItemTeam::Event_DropFlag
================ ================
*/ */
void idItemTeam::Event_DropFlag( bool death ) { void idItemTeam::Event_DropFlag( bool death ) {
gameLocal.DPrintf("Event_DropFlag()!\n"); gameLocal.DPrintf("Event_DropFlag()!\n");
if ( gameLocal.isServer ) { if ( gameLocal.isServer ) {
idBitMsg msg; idBitMsg msg;
@ -1118,16 +1118,16 @@ void idItemTeam::Event_DropFlag( bool death ) {
SetSkin( skinDefault ); SetSkin( skinDefault );
UpdateVisuals(); UpdateVisuals();
UpdateGuis(); UpdateGuis();
if ( gameLocal.isServer ) { if ( gameLocal.isServer ) {
if ( team == 0 ) if ( team == 0 )
gameLocal.mpGame.player_red_flag = -1; gameLocal.mpGame.player_red_flag = -1;
else else
gameLocal.mpGame.player_blue_flag = -1; gameLocal.mpGame.player_blue_flag = -1;
} }
} }
/* /*
@ -1136,7 +1136,7 @@ idItemTeam::Event_FlagReturn
================ ================
*/ */
void idItemTeam::Event_FlagReturn( idPlayer * player ) { void idItemTeam::Event_FlagReturn( idPlayer * player ) {
gameLocal.DPrintf("Event_FlagReturn()!\n"); gameLocal.DPrintf("Event_FlagReturn()!\n");
if ( gameLocal.isServer ) { if ( gameLocal.isServer ) {
ServerSendEvent( EVENT_FLAGRETURN, NULL, false, -1 ); ServerSendEvent( EVENT_FLAGRETURN, NULL, false, -1 );
@ -1166,15 +1166,15 @@ void idItemTeam::Event_FlagReturn( idPlayer * player ) {
} }
UpdateVisuals(); UpdateVisuals();
UpdateGuis(); UpdateGuis();
// Present(); // Present();
if ( gameLocal.isServer ) { if ( gameLocal.isServer ) {
if ( team == 0 ) if ( team == 0 )
gameLocal.mpGame.player_red_flag = -1; gameLocal.mpGame.player_red_flag = -1;
else else
gameLocal.mpGame.player_blue_flag = -1; gameLocal.mpGame.player_blue_flag = -1;
} }
} }
/* /*
@ -1215,15 +1215,15 @@ void idItemTeam::Event_FlagCapture( void ) {
} }
UpdateVisuals(); UpdateVisuals();
UpdateGuis(); UpdateGuis();
if ( gameLocal.isServer ) { if ( gameLocal.isServer ) {
if ( team == 0 ) if ( team == 0 )
gameLocal.mpGame.player_red_flag = -1; gameLocal.mpGame.player_red_flag = -1;
else else
gameLocal.mpGame.player_blue_flag = -1; gameLocal.mpGame.player_blue_flag = -1;
} }
} }
@ -1287,15 +1287,15 @@ void idItemTeam::ReadFromSnapshot( const idBitMsgDelta &msg ) {
ReadBindFromSnapshot( msg ); ReadBindFromSnapshot( msg );
if ( msg.HasChanged() ) if ( msg.HasChanged() )
{ {
UpdateGuis(); UpdateGuis();
if ( carried == true ) if ( carried == true )
SetSkin( skinCarried ); SetSkin( skinCarried );
else else
SetSkin( skinDefault ); SetSkin( skinDefault );
} }
idMoveableItem::ReadFromSnapshot( msg ); idMoveableItem::ReadFromSnapshot( msg );
} }
@ -1308,7 +1308,7 @@ Update all client's huds wrt the flag status.
================ ================
*/ */
void idItemTeam::UpdateGuis( void ) { void idItemTeam::UpdateGuis( void ) {
idPlayer *player; idPlayer *player;
for ( int i = 0; i < gameLocal.numClients; i++ ) { for ( int i = 0; i < gameLocal.numClients; i++ ) {
player = static_cast<idPlayer *>( gameLocal.entities[ i ] ); player = static_cast<idPlayer *>( gameLocal.entities[ i ] );
@ -1316,13 +1316,13 @@ void idItemTeam::UpdateGuis( void ) {
if ( player == NULL || player->hud == NULL ) if ( player == NULL || player->hud == NULL )
continue; continue;
player->hud->SetStateInt( "red_flagstatus", gameLocal.mpGame.GetFlagStatus( 0 ) ); player->hud->SetStateInt( "red_flagstatus", gameLocal.mpGame.GetFlagStatus( 0 ) );
player->hud->SetStateInt( "blue_flagstatus", gameLocal.mpGame.GetFlagStatus( 1 ) ); player->hud->SetStateInt( "blue_flagstatus", gameLocal.mpGame.GetFlagStatus( 1 ) );
player->hud->SetStateInt( "red_team_score", gameLocal.mpGame.GetFlagPoints( 0 ) ); player->hud->SetStateInt( "red_team_score", gameLocal.mpGame.GetFlagPoints( 0 ) );
player->hud->SetStateInt( "blue_team_score", gameLocal.mpGame.GetFlagPoints( 1 ) ); player->hud->SetStateInt( "blue_team_score", gameLocal.mpGame.GetFlagPoints( 1 ) );
} }
} }
@ -1479,7 +1479,7 @@ void idObjective::Event_Trigger( idEntity *activator ) {
//Pickup( player ); //Pickup( player );
if ( spawnArgs.GetString( "inv_objective", NULL ) ) { if ( spawnArgs.GetString( "inv_objective", NULL ) ) {
if ( player && player->hud ) { if ( player && player->hud ) {
idStr shotName = gameLocal.GetMapName(); idStr shotName = gameLocal.GetMapName();
shotName.StripFileExtension(); shotName.StripFileExtension();
shotName += "/"; shotName += "/";
@ -1641,7 +1641,7 @@ idMoveableItem::Save
================ ================
*/ */
void idMoveableItem::Save( idSaveGame *savefile ) const { void idMoveableItem::Save( idSaveGame *savefile ) const {
savefile->WriteStaticObject( physicsObj ); savefile->WriteStaticObject( physicsObj );
savefile->WriteClipModel( trigger ); savefile->WriteClipModel( trigger );
@ -2115,7 +2115,7 @@ void idObjectiveComplete::Event_Trigger( idEntity *activator ) {
RemoveItem( player ); RemoveItem( player );
if ( spawnArgs.GetString( "inv_objective", NULL ) ) { if ( spawnArgs.GetString( "inv_objective", NULL ) ) {
if ( player->hud ) { if ( player->hud ) {
player->hud->SetStateString( "objective", "2"); player->hud->SetStateString( "objective", "2");
player->hud->SetStateString( "objectivetext", spawnArgs.GetString( "objectivetext" ) ); player->hud->SetStateString( "objectivetext", spawnArgs.GetString( "objectivetext" ) );

View file

@ -60,9 +60,9 @@ public:
EVENT_RESPAWN, EVENT_RESPAWN,
EVENT_RESPAWNFX, EVENT_RESPAWNFX,
#ifdef CTF #ifdef CTF
EVENT_TAKEFLAG, EVENT_TAKEFLAG,
EVENT_DROPFLAG, EVENT_DROPFLAG,
EVENT_FLAGRETURN, EVENT_FLAGRETURN,
EVENT_FLAGCAPTURE, EVENT_FLAGCAPTURE,
#endif #endif
EVENT_MAXEVENTS EVENT_MAXEVENTS
@ -203,12 +203,12 @@ private:
class idItemTeam : public idMoveableItem { class idItemTeam : public idMoveableItem {
public: public:
CLASS_PROTOTYPE( idItemTeam ); CLASS_PROTOTYPE( idItemTeam );
idItemTeam(); idItemTeam();
virtual ~idItemTeam(); virtual ~idItemTeam();
void Spawn(); void Spawn();
virtual bool Pickup( idPlayer *player ); virtual bool Pickup( idPlayer *player );
virtual bool ClientReceiveEvent( int event, int time, const idBitMsg &msg ); virtual bool ClientReceiveEvent( int event, int time, const idBitMsg &msg );
virtual void Think(void ); virtual void Think(void );
@ -225,7 +225,7 @@ public:
virtual void ReadFromSnapshot( const idBitMsgDelta &msg ); virtual void ReadFromSnapshot( const idBitMsgDelta &msg );
public: public:
int team; int team;
// TODO : turn this into a state : // TODO : turn this into a state :
bool carried; // is it beeing carried by a player? bool carried; // is it beeing carried by a player?
bool dropped; // was it dropped? bool dropped; // was it dropped?
@ -243,8 +243,8 @@ private:
const function_t * scriptReturned; const function_t * scriptReturned;
const function_t * scriptCaptured; const function_t * scriptCaptured;
renderLight_t itemGlow; // Used by flags when they are picked up renderLight_t itemGlow; // Used by flags when they are picked up
int itemGlowHandle; int itemGlowHandle;
int lastNuggetDrop; int lastNuggetDrop;
const char * nuggetName; const char * nuggetName;
@ -252,7 +252,7 @@ private:
private: private:
void Event_TakeFlag( idPlayer * player ); void Event_TakeFlag( idPlayer * player );
void Event_DropFlag( bool death ); void Event_DropFlag( bool death );
void Event_FlagReturn( idPlayer * player = NULL ); void Event_FlagReturn( idPlayer * player = NULL );
void Event_FlagCapture( void ); void Event_FlagCapture( void );
@ -260,7 +260,7 @@ private:
function_t * LoadScript( char * script ); function_t * LoadScript( char * script );
void SpawnNugget( idVec3 pos ); void SpawnNugget( idVec3 pos );
void UpdateGuis( void ); void UpdateGuis( void );
}; };
#endif #endif

View file

@ -123,10 +123,10 @@ void idGameEdit::ParseSpawnArgsToRenderLight( const idDict *args, renderLight_t
idMat3 mat; idMat3 mat;
if ( !args->GetMatrix( "light_rotation", "1 0 0 0 1 0 0 0 1", mat ) ) { if ( !args->GetMatrix( "light_rotation", "1 0 0 0 1 0 0 0 1", mat ) ) {
if ( !args->GetMatrix( "rotation", "1 0 0 0 1 0 0 0 1", mat ) ) { if ( !args->GetMatrix( "rotation", "1 0 0 0 1 0 0 0 1", mat ) ) {
args->GetFloat( "angle", "0", angles[ 1 ] ); args->GetFloat( "angle", "0", angles[ 1 ] );
angles[ 0 ] = 0; angles[ 0 ] = 0;
angles[ 1 ] = idMath::AngleNormalize360( angles[ 1 ] ); angles[ 1 ] = idMath::AngleNormalize360( angles[ 1 ] );
angles[ 2 ] = 0; angles[ 2 ] = 0;
mat = angles.ToMat3(); mat = angles.ToMat3();
} }
} }
@ -357,10 +357,10 @@ void idLight::Spawn( void ) {
} }
#ifdef CTF #ifdef CTF
// Midnight CTF // Midnight CTF
if ( gameLocal.mpGame.IsGametypeFlagBased() && gameLocal.serverInfo.GetBool("si_midnight") && !spawnArgs.GetBool("midnight_override") ) { if ( gameLocal.mpGame.IsGametypeFlagBased() && gameLocal.serverInfo.GetBool("si_midnight") && !spawnArgs.GetBool("midnight_override") ) {
Off(); Off();
} }
#endif #endif
health = spawnArgs.GetInt( "health", "0" ); health = spawnArgs.GetInt( "health", "0" );

View file

@ -2973,8 +2973,8 @@ idPhantomObjects::idPhantomObjects
idPhantomObjects::idPhantomObjects() { idPhantomObjects::idPhantomObjects() {
target = NULL; target = NULL;
end_time = 0; end_time = 0;
throw_time = 0.0f; throw_time = 0.0f;
shake_time = 0.0f; shake_time = 0.0f;
shake_ang.Zero(); shake_ang.Zero();
speed = 0.0f; speed = 0.0f;
min_wait = 0; min_wait = 0;
@ -3095,7 +3095,7 @@ void idPhantomObjects::Event_Activate( idEntity *activator ) {
const idVec3 &toPos = target.GetEntity()->GetEyePosition(); const idVec3 &toPos = target.GetEntity()->GetEyePosition();
// calculate the relative times of all the objects // calculate the relative times of all the objects
time = 0.0f; time = 0.0f;
for( i = 0; i < targetTime.Num(); i++ ) { for( i = 0; i < targetTime.Num(); i++ ) {
targetTime[ i ] = SEC2MS( time ); targetTime[ i ] = SEC2MS( time );

View file

@ -556,7 +556,7 @@ void idMoveable::Event_Activate( idEntity *activator ) {
Show(); Show();
if ( !spawnArgs.GetInt( "notPushable" ) ) { if ( !spawnArgs.GetInt( "notPushable" ) ) {
physicsObj.EnableImpact(); physicsObj.EnableImpact();
} }
physicsObj.Activate(); physicsObj.Activate();

View file

@ -524,7 +524,7 @@ idMover::FindGuiTargets
================ ================
*/ */
void idMover::FindGuiTargets( void ) { void idMover::FindGuiTargets( void ) {
gameLocal.GetTargets( spawnArgs, guiTargets, "guiTarget" ); gameLocal.GetTargets( spawnArgs, guiTargets, "guiTarget" );
} }
/* /*
@ -2440,7 +2440,7 @@ idMover_Binary::SetMoverState
=============== ===============
*/ */
void idMover_Binary::SetMoverState( moverState_t newstate, int time ) { void idMover_Binary::SetMoverState( moverState_t newstate, int time ) {
idVec3 delta; idVec3 delta;
moverState = newstate; moverState = newstate;
move_thread = 0; move_thread = 0;
@ -2911,7 +2911,7 @@ idMover_Binary::FindGuiTargets
================ ================
*/ */
void idMover_Binary::FindGuiTargets( void ) { void idMover_Binary::FindGuiTargets( void ) {
gameLocal.GetTargets( spawnArgs, guiTargets, "guiTarget" ); gameLocal.GetTargets( spawnArgs, guiTargets, "guiTarget" );
} }
/* /*
@ -3938,13 +3938,13 @@ void idDoor::Event_Activate( idEntity *activator ) {
} }
} }
if ( syncLock.Length() ) { if ( syncLock.Length() ) {
idEntity *sync = gameLocal.FindEntity( syncLock ); idEntity *sync = gameLocal.FindEntity( syncLock );
if ( sync && sync->IsType( idDoor::Type ) ) { if ( sync && sync->IsType( idDoor::Type ) ) {
if ( static_cast<idDoor *>( sync )->IsOpen() ) { if ( static_cast<idDoor *>( sync )->IsOpen() ) {
return; return;
} }
} }
} }
ActivateTargets( activator ); ActivateTargets( activator );

View file

@ -122,8 +122,8 @@ idMultiplayerGame::idMultiplayerGame() {
flagMsgOn = true; flagMsgOn = true;
player_blue_flag = -1; player_blue_flag = -1;
player_red_flag = -1; player_red_flag = -1;
#endif #endif
Clear(); Clear();
@ -181,10 +181,10 @@ void idMultiplayerGame::Reset() {
assert( !scoreBoard && !spectateGui && !guiChat && !mainGui && !mapList ); assert( !scoreBoard && !spectateGui && !guiChat && !mainGui && !mapList );
#ifdef CTF #ifdef CTF
// CTF uses its own scoreboard // CTF uses its own scoreboard
if ( IsGametypeFlagBased() ) if ( IsGametypeFlagBased() )
scoreBoard = uiManager->FindGui( "guis/ctfscoreboard.gui", true, false, true ); scoreBoard = uiManager->FindGui( "guis/ctfscoreboard.gui", true, false, true );
else else
#endif #endif
scoreBoard = uiManager->FindGui( "guis/scoreboard.gui", true, false, true ); scoreBoard = uiManager->FindGui( "guis/scoreboard.gui", true, false, true );
@ -316,7 +316,7 @@ void idMultiplayerGame::ClearGuis() {
} }
#ifdef CTF #ifdef CTF
ClearHUDStatus(); ClearHUDStatus();
#endif #endif
} }
@ -327,22 +327,22 @@ idMultiplayerGame::ClearHUDStatus
================ ================
*/ */
void idMultiplayerGame::ClearHUDStatus( void ) { void idMultiplayerGame::ClearHUDStatus( void ) {
int i; int i;
for ( i = 0; i < MAX_CLIENTS; i++ ) { for ( i = 0; i < MAX_CLIENTS; i++ ) {
idPlayer *player = static_cast<idPlayer *>( gameLocal.entities[ i ] ); idPlayer *player = static_cast<idPlayer *>( gameLocal.entities[ i ] );
if ( !player || !player->hud ) { if ( !player || !player->hud ) {
continue; continue;
} }
player->hud->SetStateInt( "red_flagstatus", 0 ); player->hud->SetStateInt( "red_flagstatus", 0 );
player->hud->SetStateInt( "blue_flagstatus", 0 ); player->hud->SetStateInt( "blue_flagstatus", 0 );
if ( IsGametypeFlagBased()) if ( IsGametypeFlagBased())
player->hud->SetStateInt( "self_team", player->team ); player->hud->SetStateInt( "self_team", player->team );
else else
player->hud->SetStateInt( "self_team", -1 ); // Invisible. player->hud->SetStateInt( "self_team", -1 ); // Invisible.
} }
} }
@ -358,9 +358,9 @@ Gets number of captures in CTF game.
*/ */
int idMultiplayerGame::GetFlagPoints( int team ) int idMultiplayerGame::GetFlagPoints( int team )
{ {
assert( team <= 1 ); assert( team <= 1 );
return teamPoints[ team ]; return teamPoints[ team ];
} }
#endif #endif
@ -622,38 +622,38 @@ void idMultiplayerGame::UpdateCTFScoreboard( idUserInterface *scoreBoard, idPlay
idEntity *ent; idEntity *ent;
int value; int value;
// The display lines // The display lines
int ilines[2] = {0,0}; int ilines[2] = {0,0};
// The team strings // The team strings
char redTeam[] = "red"; char redTeam[] = "red";
char blueTeam[] = "blue"; char blueTeam[] = "blue";
char *curTeam = NULL; char *curTeam = NULL;
/* Word "frags" */ /* Word "frags" */
scoreBoard->SetStateString( "scoretext", gameLocal.gameType == GAME_LASTMAN ? common->GetLanguageDict()->GetString( "#str_04242" ) : common->GetLanguageDict()->GetString( "#str_04243" ) ); scoreBoard->SetStateString( "scoretext", gameLocal.gameType == GAME_LASTMAN ? common->GetLanguageDict()->GetString( "#str_04242" ) : common->GetLanguageDict()->GetString( "#str_04243" ) );
// Blank the flag carrier on the scoreboard. We update these in the loop below if necessary. // Blank the flag carrier on the scoreboard. We update these in the loop below if necessary.
if ( this->player_blue_flag == -1 ) if ( this->player_blue_flag == -1 )
scoreBoard->SetStateInt( "player_blue_flag", 0 ); scoreBoard->SetStateInt( "player_blue_flag", 0 );
if ( this->player_red_flag == -1 ) if ( this->player_red_flag == -1 )
scoreBoard->SetStateInt( "player_red_flag", 0 ); scoreBoard->SetStateInt( "player_red_flag", 0 );
if ( gameState != WARMUP ) { if ( gameState != WARMUP ) {
for ( i = 0; i < numRankedPlayers; i++ ) { for ( i = 0; i < numRankedPlayers; i++ ) {
idPlayer *player = rankedPlayers[ i ]; idPlayer *player = rankedPlayers[ i ];
assert( player ); assert( player );
if ( player->team == 0 ) if ( player->team == 0 )
curTeam = redTeam; curTeam = redTeam;
else else
curTeam = blueTeam; curTeam = blueTeam;
// Increase the appropriate iline // Increase the appropriate iline
assert( player->team <= 1 ); assert( player->team <= 1 );
ilines[ player->team ]++; ilines[ player->team ]++;
// Update the flag status // Update the flag status
@ -665,149 +665,149 @@ void idMultiplayerGame::UpdateCTFScoreboard( idUserInterface *scoreBoard, idPlay
/* Player Name */ /* Player Name */
scoreBoard->SetStateString( va( "player%i_%s", ilines[ player->team ], curTeam ), player->GetUserInfo()->GetString( "ui_name" ) ); scoreBoard->SetStateString( va( "player%i_%s", ilines[ player->team ], curTeam ), player->GetUserInfo()->GetString( "ui_name" ) );
if ( IsGametypeTeamBased() ) { if ( IsGametypeTeamBased() ) {
value = idMath::ClampInt( MP_PLAYER_MINFRAGS, MP_PLAYER_MAXFRAGS, playerState[ rankedPlayers[ i ]->entityNumber ].fragCount ); value = idMath::ClampInt( MP_PLAYER_MINFRAGS, MP_PLAYER_MAXFRAGS, playerState[ rankedPlayers[ i ]->entityNumber ].fragCount );
scoreBoard->SetStateInt( va( "player%i_%s_score", ilines[ player->team ], curTeam ), value ); scoreBoard->SetStateInt( va( "player%i_%s_score", ilines[ player->team ], curTeam ), value );
/* Team score and score, blanked */ /* Team score and score, blanked */
scoreBoard->SetStateString( va( "player%i_%s_tscore", ilines[ player->team ], curTeam ), "" ); scoreBoard->SetStateString( va( "player%i_%s_tscore", ilines[ player->team ], curTeam ), "" );
//scoreBoard->SetStateString( va( "player%i_%s_score", ilines[ player->team ], curTeam ), "" ); //scoreBoard->SetStateString( va( "player%i_%s_score", ilines[ player->team ], curTeam ), "" );
} }
/* Wins */ /* Wins */
value = idMath::ClampInt( 0, MP_PLAYER_MAXWINS, playerState[ rankedPlayers[ i ]->entityNumber ].wins ); value = idMath::ClampInt( 0, MP_PLAYER_MAXWINS, playerState[ rankedPlayers[ i ]->entityNumber ].wins );
scoreBoard->SetStateInt( va( "player%i_%s_wins", ilines[ player->team ], curTeam ), value ); scoreBoard->SetStateInt( va( "player%i_%s_wins", ilines[ player->team ], curTeam ), value );
/* Ping */ /* Ping */
scoreBoard->SetStateInt( va( "player%i_%s_ping", ilines[ player->team ], curTeam ), playerState[ rankedPlayers[ i ]->entityNumber ].ping ); scoreBoard->SetStateInt( va( "player%i_%s_ping", ilines[ player->team ], curTeam ), playerState[ rankedPlayers[ i ]->entityNumber ].ping );
} }
} }
for ( i = 0; i < MAX_CLIENTS; i++ ) { for ( i = 0; i < MAX_CLIENTS; i++ ) {
ent = gameLocal.entities[ i ]; ent = gameLocal.entities[ i ];
if ( !ent || !ent->IsType( idPlayer::Type ) ) { if ( !ent || !ent->IsType( idPlayer::Type ) ) {
continue; continue;
} }
if ( gameState != WARMUP ) { if ( gameState != WARMUP ) {
// check he's not covered by ranks already // check he's not covered by ranks already
for ( j = 0; j < numRankedPlayers; j++ ) { for ( j = 0; j < numRankedPlayers; j++ ) {
if ( ent == rankedPlayers[ j ] ) { if ( ent == rankedPlayers[ j ] ) {
break; break;
} }
} }
if ( j != numRankedPlayers ) { if ( j != numRankedPlayers ) {
continue; continue;
} }
} }
player = static_cast< idPlayer * >( ent ); player = static_cast< idPlayer * >( ent );
if ( player->spectating ) if ( player->spectating )
continue; continue;
if ( player->team == 0 ) if ( player->team == 0 )
curTeam = redTeam; curTeam = redTeam;
else else
curTeam = blueTeam; curTeam = blueTeam;
ilines[ player->team ]++; ilines[ player->team ]++;
if ( !playerState[ i ].ingame ) { if ( !playerState[ i ].ingame ) {
/* "New Player" on player's name location */ /* "New Player" on player's name location */
scoreBoard->SetStateString( va( "player%i_%s", ilines[ player->team ], curTeam ), common->GetLanguageDict()->GetString( "#str_04244" ) ); scoreBoard->SetStateString( va( "player%i_%s", ilines[ player->team ], curTeam ), common->GetLanguageDict()->GetString( "#str_04244" ) );
/* "Connecting" on player's score location */ /* "Connecting" on player's score location */
scoreBoard->SetStateString( va( "player%i_%s_score", ilines[ player->team ], curTeam ), common->GetLanguageDict()->GetString( "#str_04245" ) ); scoreBoard->SetStateString( va( "player%i_%s_score", ilines[ player->team ], curTeam ), common->GetLanguageDict()->GetString( "#str_04245" ) );
} else { } else {
/* Player's name in player's name location */ /* Player's name in player's name location */
if ( !player->spectating ) if ( !player->spectating )
scoreBoard->SetStateString( va( "player%i_%s", ilines[ player->team ], curTeam ), gameLocal.userInfo[ i ].GetString( "ui_name" ) ); scoreBoard->SetStateString( va( "player%i_%s", ilines[ player->team ], curTeam ), gameLocal.userInfo[ i ].GetString( "ui_name" ) );
if ( gameState == WARMUP ) { if ( gameState == WARMUP ) {
if ( player->spectating ) { if ( player->spectating ) {
/* "Spectating" on player's score location */ /* "Spectating" on player's score location */
scoreBoard->SetStateString( va( "player%i_%s_score", ilines[ player->team ], curTeam ), common->GetLanguageDict()->GetString( "#str_04246" ) ); scoreBoard->SetStateString( va( "player%i_%s_score", ilines[ player->team ], curTeam ), common->GetLanguageDict()->GetString( "#str_04246" ) );
} else { } else {
/* Display "ready" in player's score location if they're ready. Display nothing if not. No room for 'not ready'. */ /* Display "ready" in player's score location if they're ready. Display nothing if not. No room for 'not ready'. */
scoreBoard->SetStateString( va( "player%i_%s_score", ilines[ player->team ], curTeam ), player->IsReady() ? common->GetLanguageDict()->GetString( "#str_04247" ) : "" ); scoreBoard->SetStateString( va( "player%i_%s_score", ilines[ player->team ], curTeam ), player->IsReady() ? common->GetLanguageDict()->GetString( "#str_04247" ) : "" );
} }
} }
} }
} }
// Clear remaining slots // Clear remaining slots
for ( i = 0; i < 2; i++ ) for ( i = 0; i < 2; i++ )
{ {
if ( i ) if ( i )
curTeam = blueTeam; curTeam = blueTeam;
else else
curTeam = redTeam; curTeam = redTeam;
for ( j = ilines[ i ]+1; j <= 8; j++ ) for ( j = ilines[ i ]+1; j <= 8; j++ )
{ {
scoreBoard->SetStateString( va( "player%i_%s", j, curTeam ), "" ); scoreBoard->SetStateString( va( "player%i_%s", j, curTeam ), "" );
scoreBoard->SetStateString( va( "player%i_%s_score", j, curTeam ), "" ); scoreBoard->SetStateString( va( "player%i_%s_score", j, curTeam ), "" );
scoreBoard->SetStateString( va( "player%i_%s_wins", j, curTeam ), "" ); scoreBoard->SetStateString( va( "player%i_%s_wins", j, curTeam ), "" );
scoreBoard->SetStateString( va( "player%i_%s_ping", j, curTeam ), "" ); scoreBoard->SetStateString( va( "player%i_%s_ping", j, curTeam ), "" );
scoreBoard->SetStateInt( "rank_self", 0 ); scoreBoard->SetStateInt( "rank_self", 0 );
} }
} }
// Don't display "CTF" -- if this scoreboard comes up, it should be apparent. // Don't display "CTF" -- if this scoreboard comes up, it should be apparent.
if ( gameLocal.gameType == GAME_CTF ) { if ( gameLocal.gameType == GAME_CTF ) {
int captureLimit = gameLocal.serverInfo.GetInt( "si_fragLimit" ); int captureLimit = gameLocal.serverInfo.GetInt( "si_fragLimit" );
if ( captureLimit > MP_CTF_MAXPOINTS ) if ( captureLimit > MP_CTF_MAXPOINTS )
captureLimit = MP_CTF_MAXPOINTS; captureLimit = MP_CTF_MAXPOINTS;
int timeLimit = gameLocal.serverInfo.GetInt( "si_timeLimit" ); int timeLimit = gameLocal.serverInfo.GetInt( "si_timeLimit" );
/* Prints "Capture Limit: %i" at the bottom of the scoreboard, left */ /* Prints "Capture Limit: %i" at the bottom of the scoreboard, left */
if ( captureLimit ) if ( captureLimit )
scoreBoard->SetStateString( "gameinfo_red", va( common->GetLanguageDict()->GetString( "#str_11108" ), captureLimit) ); scoreBoard->SetStateString( "gameinfo_red", va( common->GetLanguageDict()->GetString( "#str_11108" ), captureLimit) );
else else
scoreBoard->SetStateString( "gameinfo_red", "" ); scoreBoard->SetStateString( "gameinfo_red", "" );
/* Prints "Time Limit: %i" at the bottom of the scoreboard, right */ /* Prints "Time Limit: %i" at the bottom of the scoreboard, right */
if ( timeLimit ) if ( timeLimit )
scoreBoard->SetStateString( "gameinfo_blue", va( common->GetLanguageDict()->GetString( "#str_11109" ), timeLimit) ); scoreBoard->SetStateString( "gameinfo_blue", va( common->GetLanguageDict()->GetString( "#str_11109" ), timeLimit) );
else else
scoreBoard->SetStateString( "gameinfo_blue", "" ); scoreBoard->SetStateString( "gameinfo_blue", "" );
} }
// Set team scores // Set team scores
scoreBoard->SetStateInt( "red_team_score", GetFlagPoints( 0 ) ); scoreBoard->SetStateInt( "red_team_score", GetFlagPoints( 0 ) );
scoreBoard->SetStateInt( "blue_team_score", GetFlagPoints( 1 ) ); scoreBoard->SetStateInt( "blue_team_score", GetFlagPoints( 1 ) );
// Handle flag status changed event // Handle flag status changed event
scoreBoard->HandleNamedEvent( "BlueFlagStatusChange" ); scoreBoard->HandleNamedEvent( "BlueFlagStatusChange" );
scoreBoard->HandleNamedEvent( "RedFlagStatusChange" ); scoreBoard->HandleNamedEvent( "RedFlagStatusChange" );
scoreBoard->Redraw( gameLocal.time ); scoreBoard->Redraw( gameLocal.time );
@ -1418,7 +1418,7 @@ void idMultiplayerGame::NewState( gameState_t news, idPlayer *player ) {
teamPoints[0] = 0; teamPoints[0] = 0;
teamPoints[1] = 0; teamPoints[1] = 0;
ClearHUDStatus(); ClearHUDStatus();
#endif #endif
PlayGlobalSound( -1, SND_FIGHT ); PlayGlobalSound( -1, SND_FIGHT );
@ -2557,10 +2557,10 @@ void idMultiplayerGame::UpdateHud( idPlayer *player, idUserInterface *hud ) {
} }
#ifdef CTF #ifdef CTF
if ( IsGametypeFlagBased() ) if ( IsGametypeFlagBased() )
hud->SetStateInt( "self_team", player->team ); hud->SetStateInt( "self_team", player->team );
else else
hud->SetStateInt( "self_team", -1 ); /* Disable */ hud->SetStateInt( "self_team", -1 ); /* Disable */
#endif #endif
} }
@ -2578,9 +2578,9 @@ void idMultiplayerGame::DrawScoreBoard( idPlayer *player ) {
} }
#ifdef CTF #ifdef CTF
if ( IsGametypeFlagBased() ) if ( IsGametypeFlagBased() )
UpdateCTFScoreboard( scoreBoard, player ); UpdateCTFScoreboard( scoreBoard, player );
else else
#endif #endif
UpdateScoreboard( scoreBoard, player ); UpdateScoreboard( scoreBoard, player );
@ -2704,10 +2704,10 @@ void idMultiplayerGame::WriteToSnapshot( idBitMsgDelta &msg ) const {
} }
#ifdef CTF #ifdef CTF
msg.WriteShort( teamPoints[0] ); msg.WriteShort( teamPoints[0] );
msg.WriteShort( teamPoints[1] ); msg.WriteShort( teamPoints[1] );
msg.WriteShort( player_red_flag ); msg.WriteShort( player_red_flag );
msg.WriteShort( player_blue_flag ); msg.WriteShort( player_blue_flag );
#endif #endif
} }
@ -2743,11 +2743,11 @@ void idMultiplayerGame::ReadFromSnapshot( const idBitMsgDelta &msg ) {
} }
#ifdef CTF #ifdef CTF
teamPoints[0] = msg.ReadShort(); teamPoints[0] = msg.ReadShort();
teamPoints[1] = msg.ReadShort(); teamPoints[1] = msg.ReadShort();
player_red_flag = msg.ReadShort(); player_red_flag = msg.ReadShort();
player_blue_flag = msg.ReadShort(); player_blue_flag = msg.ReadShort();
#endif #endif
@ -2880,8 +2880,8 @@ void idMultiplayerGame::PrintMessageEvent( int to, msg_evt_t evt, int parm1, int
break; break;
case MSG_FLAGTAKEN : case MSG_FLAGTAKEN :
if ( gameLocal.GetLocalPlayer() == NULL ) if ( gameLocal.GetLocalPlayer() == NULL )
break; break;
if ( parm2 < 0 || parm2 >= MAX_CLIENTS ) if ( parm2 < 0 || parm2 >= MAX_CLIENTS )
break; break;
@ -2894,8 +2894,8 @@ void idMultiplayerGame::PrintMessageEvent( int to, msg_evt_t evt, int parm1, int
break; break;
case MSG_FLAGDROP : case MSG_FLAGDROP :
if ( gameLocal.GetLocalPlayer() == NULL ) if ( gameLocal.GetLocalPlayer() == NULL )
break; break;
if ( gameLocal.GetLocalPlayer()->team != parm1 ) { if ( gameLocal.GetLocalPlayer()->team != parm1 ) {
AddChatLine( common->GetLanguageDict()->GetString( "#str_11103" ) ); // your team AddChatLine( common->GetLanguageDict()->GetString( "#str_11103" ) ); // your team
@ -2905,8 +2905,8 @@ void idMultiplayerGame::PrintMessageEvent( int to, msg_evt_t evt, int parm1, int
break; break;
case MSG_FLAGRETURN : case MSG_FLAGRETURN :
if ( gameLocal.GetLocalPlayer() == NULL ) if ( gameLocal.GetLocalPlayer() == NULL )
break; break;
if ( parm2 >= 0 && parm2 < MAX_CLIENTS ) { if ( parm2 >= 0 && parm2 < MAX_CLIENTS ) {
if ( gameLocal.GetLocalPlayer()->team != parm1 ) { if ( gameLocal.GetLocalPlayer()->team != parm1 ) {
@ -2920,8 +2920,8 @@ void idMultiplayerGame::PrintMessageEvent( int to, msg_evt_t evt, int parm1, int
break; break;
case MSG_FLAGCAPTURE : case MSG_FLAGCAPTURE :
if ( gameLocal.GetLocalPlayer() == NULL ) if ( gameLocal.GetLocalPlayer() == NULL )
break; break;
if ( parm2 < 0 || parm2 >= MAX_CLIENTS ) if ( parm2 < 0 || parm2 >= MAX_CLIENTS )
break; break;
@ -3017,8 +3017,8 @@ void idMultiplayerGame::CheckRespawns( idPlayer *spectator ) {
} }
} else { } else {
if ( gameLocal.gameType == GAME_DM || // CTF : 3wave sboily, was DM really included before? if ( gameLocal.gameType == GAME_DM || // CTF : 3wave sboily, was DM really included before?
IsGametypeTeamBased() ) IsGametypeTeamBased() )
{ {
if ( gameState == WARMUP || gameState == COUNTDOWN || gameState == GAMEON ) { if ( gameState == WARMUP || gameState == COUNTDOWN || gameState == GAMEON ) {
p->ServerSpectate( false ); p->ServerSpectate( false );
} }
@ -3619,7 +3619,7 @@ void idMultiplayerGame::MapRestart( void ) {
teamPoints[0] = 0; teamPoints[0] = 0;
teamPoints[1] = 0; teamPoints[1] = 0;
ClearHUDStatus(); ClearHUDStatus();
#endif #endif
#ifdef CTF #ifdef CTF
@ -3650,7 +3650,7 @@ void idMultiplayerGame::SwitchToTeam( int clientNum, int oldteam, int newteam )
idEntity *ent; idEntity *ent;
int i; int i;
assert( IsGametypeTeamBased() ); /* CTF */ assert( IsGametypeTeamBased() ); /* CTF */
assert( oldteam != newteam ); assert( oldteam != newteam );
assert( !gameLocal.isClient ); assert( !gameLocal.isClient );
@ -3686,8 +3686,8 @@ void idMultiplayerGame::SwitchToTeam( int clientNum, int oldteam, int newteam )
} }
p->Kill( true, true ); p->Kill( true, true );
#ifdef CTF #ifdef CTF
if ( IsGametypeFlagBased() ) if ( IsGametypeFlagBased() )
p->DropFlag(); p->DropFlag();
#endif #endif
CheckAbortGame(); CheckAbortGame();
} }
@ -3710,7 +3710,7 @@ void idMultiplayerGame::ProcessChatMessage( int clientNum, bool team, const char
const char *prefix = NULL; const char *prefix = NULL;
int send_to; // 0 - all, 1 - specs, 2 - team int send_to; // 0 - all, 1 - specs, 2 - team
int i; int i;
idEntity *ent; idEntity *ent;
idPlayer *p; idPlayer *p;
idStr prefixed_name; idStr prefixed_name;
@ -4144,7 +4144,7 @@ void idMultiplayerGame::ClientReadWarmupTime( const idBitMsg &msg ) {
/* /*
#ifdef CTF #ifdef CTF
Threewave note: Threewave note:
The below IsGametype...() functions were implemented for CTF, The below IsGametype...() functions were implemented for CTF,
but we did not #ifdef CTF them, because doing so would clutter but we did not #ifdef CTF them, because doing so would clutter
the codebase substantially. Please consider them part of the merged the codebase substantially. Please consider them part of the merged
@ -4158,24 +4158,24 @@ idMultiplayerGame::IsGametypeTeamBased
*/ */
bool idMultiplayerGame::IsGametypeTeamBased( void ) /* CTF */ bool idMultiplayerGame::IsGametypeTeamBased( void ) /* CTF */
{ {
switch ( gameLocal.gameType ) switch ( gameLocal.gameType )
{ {
case GAME_SP: case GAME_SP:
case GAME_DM: case GAME_DM:
case GAME_TOURNEY: case GAME_TOURNEY:
case GAME_LASTMAN: case GAME_LASTMAN:
return false; return false;
#ifdef CTF #ifdef CTF
case GAME_CTF: case GAME_CTF:
#endif #endif
case GAME_TDM: case GAME_TDM:
return true; return true;
default: default:
assert( !"Add support for your new gametype here." ); assert( !"Add support for your new gametype here." );
} }
return false; return false;
} }
/* /*
@ -4184,25 +4184,25 @@ idMultiplayerGame::IsGametypeFlagBased
================ ================
*/ */
bool idMultiplayerGame::IsGametypeFlagBased( void ) { bool idMultiplayerGame::IsGametypeFlagBased( void ) {
switch ( gameLocal.gameType ) switch ( gameLocal.gameType )
{ {
case GAME_SP: case GAME_SP:
case GAME_DM: case GAME_DM:
case GAME_TOURNEY: case GAME_TOURNEY:
case GAME_LASTMAN: case GAME_LASTMAN:
case GAME_TDM: case GAME_TDM:
return false; return false;
#ifdef CTF #ifdef CTF
case GAME_CTF: case GAME_CTF:
return true; return true;
#endif #endif
default: default:
assert( !"Add support for your new gametype here." ); assert( !"Add support for your new gametype here." );
} }
return false; return false;
} }
#ifdef CTF #ifdef CTF
@ -4213,7 +4213,7 @@ idMultiplayerGame::GetTeamFlag
================ ================
*/ */
idItemTeam * idMultiplayerGame::GetTeamFlag( int team ) { idItemTeam * idMultiplayerGame::GetTeamFlag( int team ) {
assert( team == 0 || team == 1 ); assert( team == 0 || team == 1 );
if ( !IsGametypeFlagBased() || ( team != 0 && team != 1 ) ) /* CTF */ if ( !IsGametypeFlagBased() || ( team != 0 && team != 1 ) ) /* CTF */
return NULL; return NULL;
@ -4263,24 +4263,24 @@ idMultiplayerGame::GetFlagStatus
================ ================
*/ */
flagStatus_t idMultiplayerGame::GetFlagStatus( int team ) { flagStatus_t idMultiplayerGame::GetFlagStatus( int team ) {
//assert( IsGametypeFlagBased() ); //assert( IsGametypeFlagBased() );
idItemTeam *teamFlag = GetTeamFlag( team ); idItemTeam *teamFlag = GetTeamFlag( team );
//assert( teamFlag != NULL ); //assert( teamFlag != NULL );
if ( teamFlag != NULL ) { if ( teamFlag != NULL ) {
if ( teamFlag->carried == false && teamFlag->dropped == false ) if ( teamFlag->carried == false && teamFlag->dropped == false )
return FLAGSTATUS_INBASE; return FLAGSTATUS_INBASE;
if ( teamFlag->carried == true ) if ( teamFlag->carried == true )
return FLAGSTATUS_TAKEN; return FLAGSTATUS_TAKEN;
if ( teamFlag->carried == false && teamFlag->dropped == true ) if ( teamFlag->carried == false && teamFlag->dropped == true )
return FLAGSTATUS_STRAY; return FLAGSTATUS_STRAY;
} }
//assert( !"Invalid flag state." ); //assert( !"Invalid flag state." );
return FLAGSTATUS_NONE; return FLAGSTATUS_NONE;
} }
/* /*

View file

@ -51,7 +51,7 @@ typedef enum {
GAME_TDM, GAME_TDM,
GAME_LASTMAN, GAME_LASTMAN,
#ifdef CTF #ifdef CTF
GAME_CTF, GAME_CTF,
GAME_COUNT, GAME_COUNT,
#endif #endif
} gameType_t; } gameType_t;
@ -60,10 +60,10 @@ typedef enum {
// Used by the UI // Used by the UI
typedef enum { typedef enum {
FLAGSTATUS_INBASE = 0, FLAGSTATUS_INBASE = 0,
FLAGSTATUS_TAKEN = 1, FLAGSTATUS_TAKEN = 1,
FLAGSTATUS_STRAY = 2, FLAGSTATUS_STRAY = 2,
FLAGSTATUS_NONE = 3 FLAGSTATUS_NONE = 3
} flagStatus_t; } flagStatus_t;
#endif #endif
@ -286,14 +286,14 @@ public:
void ServerClientConnect( int clientNum ); void ServerClientConnect( int clientNum );
#ifdef CTF #ifdef CTF
void ClearHUDStatus( void ); void ClearHUDStatus( void );
int GetFlagPoints( int team ); // Team points in CTF int GetFlagPoints( int team ); // Team points in CTF
void SetFlagMsg( bool b ); // allow flag event messages to be sent void SetFlagMsg( bool b ); // allow flag event messages to be sent
bool IsFlagMsgOn( void ); // should flag event messages go through? bool IsFlagMsgOn( void ); // should flag event messages go through?
void ClearGuis( void ); void ClearGuis( void );
int player_red_flag; // Ent num of red flag carrier for HUD int player_red_flag; // Ent num of red flag carrier for HUD
int player_blue_flag; // Ent num of blue flag carrier for HUD int player_blue_flag; // Ent num of blue flag carrier for HUD
#endif #endif
void PlayerStats( int clientNum, char *data, const int len ); void PlayerStats( int clientNum, char *data, const int len );
@ -388,7 +388,7 @@ private:
#endif #endif
#ifndef CTF #ifndef CTF
// We declare this publically above so we can call it during a map restart. // We declare this publically above so we can call it during a map restart.
void ClearGuis( void ); void ClearGuis( void );
#endif #endif
@ -441,12 +441,12 @@ public:
#ifdef CTF #ifdef CTF
idItemTeam * GetTeamFlag( int team ); idItemTeam * GetTeamFlag( int team );
flagStatus_t GetFlagStatus( int team ); flagStatus_t GetFlagStatus( int team );
void TeamScoreCTF( int team, int delta ); void TeamScoreCTF( int team, int delta );
void PlayerScoreCTF( int playerIdx, int delta ); void PlayerScoreCTF( int playerIdx, int delta );
// returns entityNum to team flag carrier, -1 if no flag carrier // returns entityNum to team flag carrier, -1 if no flag carrier
int GetFlagCarrier( int team ); int GetFlagCarrier( int team );
void UpdateScoreboardFlagStatus( void ); void UpdateScoreboardFlagStatus( void );
void SetBestGametype( const char * map ); void SetBestGametype( const char * map );
void ReloadScoreboard(); void ReloadScoreboard();
@ -480,4 +480,3 @@ ID_INLINE bool idMultiplayerGame::IsInGame( int clientNum ) {
} }
#endif /* !__MULTIPLAYERGAME_H__ */ #endif /* !__MULTIPLAYERGAME_H__ */

View file

@ -266,7 +266,7 @@ void idInventory::GetPersistantData( idDict &dict ) {
// armor // armor
dict.SetInt( "armor", armor ); dict.SetInt( "armor", armor );
// don't bother with powerups, maxhealth, maxarmor, or the clip // don't bother with powerups, maxhealth, maxarmor, or the clip
// ammo // ammo
for( i = 0; i < AMMO_NUMTYPES; i++ ) { for( i = 0; i < AMMO_NUMTYPES; i++ ) {
@ -1759,10 +1759,10 @@ void idPlayer::Spawn( void ) {
if ( hud ) { if ( hud ) {
hud->Activate( true, gameLocal.time ); hud->Activate( true, gameLocal.time );
#ifdef CTF #ifdef CTF
if ( gameLocal.mpGame.IsGametypeFlagBased() ) { if ( gameLocal.mpGame.IsGametypeFlagBased() ) {
hud->SetStateInt( "red_team_score", gameLocal.mpGame.GetFlagPoints(0) ); hud->SetStateInt( "red_team_score", gameLocal.mpGame.GetFlagPoints(0) );
hud->SetStateInt( "blue_team_score", gameLocal.mpGame.GetFlagPoints(1) ); hud->SetStateInt( "blue_team_score", gameLocal.mpGame.GetFlagPoints(1) );
} }
#endif #endif
} }
@ -2543,7 +2543,7 @@ void idPlayer::PrepareForRestart( void ) {
#ifdef CTF #ifdef CTF
// Confirm reset hud states // Confirm reset hud states
DropFlag(); DropFlag();
if ( hud ) { if ( hud ) {
hud->SetStateInt( "red_flagstatus", 0 ); hud->SetStateInt( "red_flagstatus", 0 );
@ -3098,19 +3098,19 @@ void idPlayer::UpdateHudStats( idUserInterface *_hud ) {
} }
#ifdef CTF #ifdef CTF
if ( gameLocal.mpGame.IsGametypeFlagBased() && _hud ) if ( gameLocal.mpGame.IsGametypeFlagBased() && _hud )
{ {
_hud->SetStateInt( "red_flagstatus", gameLocal.mpGame.GetFlagStatus( 0 ) ); _hud->SetStateInt( "red_flagstatus", gameLocal.mpGame.GetFlagStatus( 0 ) );
_hud->SetStateInt( "blue_flagstatus", gameLocal.mpGame.GetFlagStatus( 1 ) ); _hud->SetStateInt( "blue_flagstatus", gameLocal.mpGame.GetFlagStatus( 1 ) );
_hud->SetStateInt( "red_team_score", gameLocal.mpGame.GetFlagPoints( 0 ) ); _hud->SetStateInt( "red_team_score", gameLocal.mpGame.GetFlagPoints( 0 ) );
_hud->SetStateInt( "blue_team_score", gameLocal.mpGame.GetFlagPoints( 1 ) ); _hud->SetStateInt( "blue_team_score", gameLocal.mpGame.GetFlagPoints( 1 ) );
_hud->HandleNamedEvent( "RedFlagStatusChange" ); _hud->HandleNamedEvent( "RedFlagStatusChange" );
_hud->HandleNamedEvent( "BlueFlagStatusChange" ); _hud->HandleNamedEvent( "BlueFlagStatusChange" );
} }
_hud->HandleNamedEvent( "selfTeam" ); _hud->HandleNamedEvent( "selfTeam" );
#endif #endif
@ -5016,7 +5016,7 @@ void idPlayer::UpdateWeapon( void ) {
} else if ( ActiveGui() ) { } else if ( ActiveGui() ) {
// gui handling overrides weapon use // gui handling overrides weapon use
Weapon_GUI(); Weapon_GUI();
} else if ( focusCharacter && ( focusCharacter->health > 0 ) ) { } else if ( focusCharacter && ( focusCharacter->health > 0 ) ) {
Weapon_NPC(); Weapon_NPC();
} else { } else {
Weapon_Combat(); Weapon_Combat();
@ -5504,7 +5504,7 @@ void idPlayer::UpdateFocus( void ) {
// clamp the mouse to the corner // clamp the mouse to the corner
ev = sys->GenerateMouseMoveEvent( -2000, -2000 ); ev = sys->GenerateMouseMoveEvent( -2000, -2000 );
command = focusUI->HandleEvent( &ev, gameLocal.time ); command = focusUI->HandleEvent( &ev, gameLocal.time );
HandleGuiCommands( focusGUIent, command ); HandleGuiCommands( focusGUIent, command );
// move to an absolute position // move to an absolute position
ev = sys->GenerateMouseMoveEvent( pt.x * SCREEN_WIDTH, pt.y * SCREEN_HEIGHT ); ev = sys->GenerateMouseMoveEvent( pt.x * SCREEN_WIDTH, pt.y * SCREEN_HEIGHT );
@ -5963,7 +5963,7 @@ void idPlayer::AdjustHeartRate( int target, float timeInSecs, float delay, bool
return; return;
} }
lastHeartAdjust = gameLocal.time; lastHeartAdjust = gameLocal.time;
heartInfo.Init( gameLocal.time + delay * 1000, timeInSecs * 1000, heartRate, target ); heartInfo.Init( gameLocal.time + delay * 1000, timeInSecs * 1000, heartRate, target );
} }
@ -6904,7 +6904,7 @@ void idPlayer::AdjustBodyAngles( void ) {
upBlend = -frac; upBlend = -frac;
} }
animator.CurrentAnim( ANIMCHANNEL_TORSO )->SetSyncedAnimWeight( 0, downBlend ); animator.CurrentAnim( ANIMCHANNEL_TORSO )->SetSyncedAnimWeight( 0, downBlend );
animator.CurrentAnim( ANIMCHANNEL_TORSO )->SetSyncedAnimWeight( 1, forwardBlend ); animator.CurrentAnim( ANIMCHANNEL_TORSO )->SetSyncedAnimWeight( 1, forwardBlend );
animator.CurrentAnim( ANIMCHANNEL_TORSO )->SetSyncedAnimWeight( 2, upBlend ); animator.CurrentAnim( ANIMCHANNEL_TORSO )->SetSyncedAnimWeight( 2, upBlend );
@ -7114,7 +7114,7 @@ void idPlayer::Move( void ) {
if ( AI_JUMP ) { if ( AI_JUMP ) {
// bounce the view weapon // bounce the view weapon
loggedAccel_t *acc = &loggedAccel[currentLoggedAccel&(NUM_LOGGED_ACCELS-1)]; loggedAccel_t *acc = &loggedAccel[currentLoggedAccel&(NUM_LOGGED_ACCELS-1)];
currentLoggedAccel++; currentLoggedAccel++;
acc->time = gameLocal.time; acc->time = gameLocal.time;
acc->dir[2] = 200; acc->dir[2] = 200;
@ -7171,7 +7171,7 @@ void idPlayer::UpdateHud( void ) {
inventory.pickupItemNames.RemoveIndex( 0 ); inventory.pickupItemNames.RemoveIndex( 0 );
if (inventory.nextItemNum == 1 ) { if (inventory.nextItemNum == 1 ) {
inventory.onePickupTime = gameLocal.time; inventory.onePickupTime = gameLocal.time;
} else if ( inventory.nextItemNum > count ) { //_D3XP } else if ( inventory.nextItemNum > count ) { //_D3XP
inventory.nextItemNum = 1; inventory.nextItemNum = 1;
inventory.nextItemPickup = inventory.onePickupTime + 2000; inventory.nextItemPickup = inventory.onePickupTime + 2000;
} else { } else {
@ -7420,7 +7420,7 @@ void idPlayer::Think( void ) {
// service animations // service animations
if ( !spectating && !af.IsActive() && !gameLocal.inCinematic ) { if ( !spectating && !af.IsActive() && !gameLocal.inCinematic ) {
UpdateConditions(); UpdateConditions();
UpdateAnimState(); UpdateAnimState();
CheckBlink(); CheckBlink();
} }
@ -7517,7 +7517,7 @@ void idPlayer::Think( void ) {
if ( !g_stopTime.GetBool() ) { if ( !g_stopTime.GetBool() ) {
UpdateAnimation(); UpdateAnimation();
Present(); Present();
UpdateDamageEffects(); UpdateDamageEffects();
@ -7893,18 +7893,18 @@ void idPlayer::DamageFeedback( idEntity *victim, idEntity *inflictor, int &damag
damage *= PowerUpModifier( BERSERK ); damage *= PowerUpModifier( BERSERK );
if ( damage && ( victim != this ) && ( victim->IsType( idActor::Type ) || victim->IsType( idDamagable::Type ) ) ) { if ( damage && ( victim != this ) && ( victim->IsType( idActor::Type ) || victim->IsType( idDamagable::Type ) ) ) {
idPlayer *victimPlayer = NULL; idPlayer *victimPlayer = NULL;
/* No damage feedback sound for hitting friendlies in CTF */ /* No damage feedback sound for hitting friendlies in CTF */
if ( victim->IsType( idPlayer::Type ) ) { if ( victim->IsType( idPlayer::Type ) ) {
victimPlayer = static_cast<idPlayer*>(victim); victimPlayer = static_cast<idPlayer*>(victim);
} }
if ( gameLocal.mpGame.IsGametypeFlagBased() && victimPlayer && this->team == victimPlayer->team ) { if ( gameLocal.mpGame.IsGametypeFlagBased() && victimPlayer && this->team == victimPlayer->team ) {
/* Do nothing ... */ /* Do nothing ... */
} }
else { else {
SetLastHitTime( gameLocal.time ); SetLastHitTime( gameLocal.time );
} }
} }
} }
@ -9338,7 +9338,7 @@ void idPlayer::ClientPredictionThink( void ) {
// service animations // service animations
if ( !spectating && !af.IsActive() ) { if ( !spectating && !af.IsActive() ) {
UpdateConditions(); UpdateConditions();
UpdateAnimState(); UpdateAnimState();
CheckBlink(); CheckBlink();
} }
@ -9543,8 +9543,8 @@ void idPlayer::WriteToSnapshot( idBitMsgDelta &msg ) const {
msg.WriteBits( isLagged, 1 ); msg.WriteBits( isLagged, 1 );
msg.WriteBits( isChatting, 1 ); msg.WriteBits( isChatting, 1 );
#ifdef CTF #ifdef CTF
/* Needed for the scoreboard */ /* Needed for the scoreboard */
msg.WriteBits( carryingFlag, 1 ); msg.WriteBits( carryingFlag, 1 );
#endif #endif
#ifdef _D3XP #ifdef _D3XP
msg.WriteBits( enviroSuitLight.GetSpawnId(), 32 ); msg.WriteBits( enviroSuitLight.GetSpawnId(), 32 );
@ -10040,9 +10040,9 @@ void idPlayer::DrawPlayerIcons( void ) {
} }
#ifdef CTF #ifdef CTF
// Never draw icons for hidden players. // Never draw icons for hidden players.
if ( this->IsHidden() ) if ( this->IsHidden() )
return; return;
#endif #endif
playerIcon.Draw( this, headJoint ); playerIcon.Draw( this, headJoint );

View file

@ -837,4 +837,3 @@ ID_INLINE void idPlayer::SetSelfSmooth( bool b ) {
} }
#endif /* !__GAME_PLAYER_H__ */ #endif /* !__GAME_PLAYER_H__ */

View file

@ -195,4 +195,3 @@ void idPlayerIcon::UpdateIcon( idPlayer *player, const idVec3 &origin, const idM
renderEnt.axis = axis; renderEnt.axis = axis;
gameRenderWorld->UpdateEntityDef( iconHandle, &renderEnt ); gameRenderWorld->UpdateEntityDef( iconHandle, &renderEnt );
} }

View file

@ -64,4 +64,3 @@ public:
#endif /* !_PLAYERICON_H_ */ #endif /* !_PLAYERICON_H_ */

View file

@ -1690,7 +1690,7 @@ void FullscreenFXManager::Initialize( idPlayerView *pv ) {
renderSystem->CaptureRenderToImage( "_accum" ); renderSystem->CaptureRenderToImage( "_accum" );
renderSystem->UnCrop(); renderSystem->UnCrop();
renderSystem->CropRenderSize( 512, 256, true ); renderSystem->CropRenderSize( 512, 256, true );
renderSystem->CaptureRenderToImage( "_scratch" ); renderSystem->CaptureRenderToImage( "_scratch" );
renderSystem->UnCrop(); renderSystem->UnCrop();

View file

@ -911,10 +911,10 @@ void idProjectile::Explode( const trace_t &collision, idEntity *ignore ) {
light_shader = spawnArgs.GetString( "mtr_explode_light_shader" ); light_shader = spawnArgs.GetString( "mtr_explode_light_shader" );
#ifdef CTF #ifdef CTF
if ( gameLocal.mpGame.IsGametypeFlagBased() && gameLocal.serverInfo.GetBool("si_midnight") ) if ( gameLocal.mpGame.IsGametypeFlagBased() && gameLocal.serverInfo.GetBool("si_midnight") )
{ {
light_shader = "lights/midnight_grenade"; light_shader = "lights/midnight_grenade";
} }
#endif #endif
if ( *light_shader ) { if ( *light_shader ) {
@ -925,13 +925,13 @@ void idProjectile::Explode( const trace_t &collision, idEntity *ignore ) {
renderLight.lightRadius[2] = spawnArgs.GetFloat( "explode_light_radius" ); renderLight.lightRadius[2] = spawnArgs.GetFloat( "explode_light_radius" );
#ifdef CTF #ifdef CTF
// Midnight ctf // Midnight ctf
if ( gameLocal.mpGame.IsGametypeFlagBased() && gameLocal.serverInfo.GetBool("si_midnight") ) if ( gameLocal.mpGame.IsGametypeFlagBased() && gameLocal.serverInfo.GetBool("si_midnight") )
{ {
renderLight.lightRadius[0] = renderLight.lightRadius[0] =
renderLight.lightRadius[1] = renderLight.lightRadius[1] =
renderLight.lightRadius[2] = spawnArgs.GetFloat( "explode_light_radius" ) * 2; renderLight.lightRadius[2] = spawnArgs.GetFloat( "explode_light_radius" ) * 2;
} }
#endif #endif
@ -943,12 +943,12 @@ void idProjectile::Explode( const trace_t &collision, idEntity *ignore ) {
renderLight.shaderParms[SHADERPARM_TIMEOFFSET] = -MS2SEC( gameLocal.time ); renderLight.shaderParms[SHADERPARM_TIMEOFFSET] = -MS2SEC( gameLocal.time );
#ifdef CTF #ifdef CTF
// Midnight ctf // Midnight ctf
if ( gameLocal.mpGame.IsGametypeFlagBased() && gameLocal.serverInfo.GetBool("si_midnight") ) if ( gameLocal.mpGame.IsGametypeFlagBased() && gameLocal.serverInfo.GetBool("si_midnight") )
{ {
light_fadetime = 3.0f; light_fadetime = 3.0f;
} }
else else
#endif #endif
light_fadetime = spawnArgs.GetFloat( "explode_light_fadetime", "0.5" ); light_fadetime = spawnArgs.GetFloat( "explode_light_fadetime", "0.5" );
lightStartTime = gameLocal.time; lightStartTime = gameLocal.time;

View file

@ -446,7 +446,7 @@ void idSecurityCamera::StartSweep( void ) {
sweepStart = gameLocal.time; sweepStart = gameLocal.time;
speed = SEC2MS( SweepSpeed() ); speed = SEC2MS( SweepSpeed() );
sweepEnd = sweepStart + speed; sweepEnd = sweepStart + speed;
PostEventMS( &EV_SecurityCam_Pause, speed ); PostEventMS( &EV_SecurityCam_Pause, speed );
StartSound( "snd_moving", SND_CHANNEL_BODY, 0, false, NULL ); StartSound( "snd_moving", SND_CHANNEL_BODY, 0, false, NULL );
} }
@ -463,7 +463,7 @@ void idSecurityCamera::Event_ContinueSweep( void ) {
sweepStart = f; sweepStart = f;
speed = MS2SEC( SweepSpeed() ); speed = MS2SEC( SweepSpeed() );
sweepEnd = sweepStart + speed; sweepEnd = sweepStart + speed;
PostEventMS( &EV_SecurityCam_Pause, speed * (1.0 - pct)); PostEventMS( &EV_SecurityCam_Pause, speed * (1.0 - pct));
StartSound( "snd_moving", SND_CHANNEL_BODY, 0, false, NULL ); StartSound( "snd_moving", SND_CHANNEL_BODY, 0, false, NULL );
SetAlertMode(SCANNING); SetAlertMode(SCANNING);
sweeping = true; sweeping = true;
@ -510,7 +510,7 @@ void idSecurityCamera::Event_Pause( void ) {
sweeping = false; sweeping = false;
StopSound( SND_CHANNEL_ANY, false ); StopSound( SND_CHANNEL_ANY, false );
StartSound( "snd_stop", SND_CHANNEL_BODY, 0, false, NULL ); StartSound( "snd_stop", SND_CHANNEL_BODY, 0, false, NULL );
PostEventSec( &EV_SecurityCam_ReverseSweep, sweepWait ); PostEventSec( &EV_SecurityCam_ReverseSweep, sweepWait );
} }
/* /*

View file

@ -216,7 +216,7 @@ bool idSmokeParticles::EmitSmoke( const idDeclParticle *smoke, const int systemS
} }
// see how many particles we should emit this tic // see how many particles we should emit this tic
// FIXME: smoke.privateStartTime += stage->timeOffset; // FIXME: smoke.privateStartTime += stage->timeOffset;
int finalParticleTime = stage->cycleMsec * stage->spawnBunching; int finalParticleTime = stage->cycleMsec * stage->spawnBunching;
int deltaMsec = gameLocal.time - systemStartTime; int deltaMsec = gameLocal.time - systemStartTime;

View file

@ -302,4 +302,3 @@ idSound::ShowEditingDialog
void idSound::ShowEditingDialog( void ) { void idSound::ShowEditingDialog( void ) {
common->InitTool( EDITOR_SOUND, &spawnArgs ); common->InitTool( EDITOR_SOUND, &spawnArgs );
} }

View file

@ -1798,4 +1798,3 @@ void idTarget_FadeSoundClass::Event_RestoreVolume() {
// restore volume // restore volume
gameSoundWorld->FadeSoundClasses( 0, fadeDB, fadeTime ); gameSoundWorld->FadeSoundClasses( 0, fadeDB, fadeTime );
} }

View file

@ -2703,10 +2703,10 @@ void idWeapon::ReadFromSnapshot( const idBitMsgDelta &msg ) {
idealState = "Fire"; idealState = "Fire";
} }
// immediately switch back to idle // immediately switch back to idle
if ( WEAPON_NETFIRING && !isFiring ) { if ( WEAPON_NETFIRING && !isFiring ) {
idealState = "Idle"; idealState = "Idle";
} }
WEAPON_NETFIRING = isFiring; WEAPON_NETFIRING = isFiring;
} }
@ -3769,9 +3769,9 @@ void idWeapon::Event_Melee( void ) {
#ifdef CTF /* Code is formed oddly for easy merge */ #ifdef CTF /* Code is formed oddly for easy merge */
if ( gameLocal.mpGame.IsGametypeFlagBased() ) if ( gameLocal.mpGame.IsGametypeFlagBased() )
{ /* Do nothing ... */ } { /* Do nothing ... */ }
else else
#endif #endif
owner->StealWeapon( static_cast< idPlayer * >( ent ) ); owner->StealWeapon( static_cast< idPlayer * >( ent ) );
} }

View file

@ -290,7 +290,7 @@ private:
bool isFiring; bool isFiring;
// zoom // zoom
int zoomFov; // variable zoom fov per weapon int zoomFov; // variable zoom fov per weapon
// joints from models // joints from models
jointHandle_t barrelJointView; jointHandle_t barrelJointView;

View file

@ -2163,7 +2163,7 @@ bool idAI::StepDirection( float dir ) {
if ( z <= ceilingPos.z ) { if ( z <= ceilingPos.z ) {
start.x = org.x; start.x = org.x;
start.y = org.y; start.y = org.y;
start.z = z; start.z = z;
} else { } else {
start = ceilingPos; start = ceilingPos;
} }
@ -2250,7 +2250,7 @@ bool idAI::NewWanderDir( const idVec3 &dest ) {
if ( gameLocal.random.RandomInt() & 1 ) { if ( gameLocal.random.RandomInt() & 1 ) {
for( tdir = 0; tdir <= 315; tdir += 45 ) { for( tdir = 0; tdir <= 315; tdir += 45 ) {
if ( tdir != turnaround && StepDirection( tdir ) ) { if ( tdir != turnaround && StepDirection( tdir ) ) {
return true; return true;
} }
} }
} else { } else {
@ -2961,9 +2961,9 @@ idAI::AdjustFlyingAngles
*/ */
void idAI::AdjustFlyingAngles( void ) { void idAI::AdjustFlyingAngles( void ) {
idVec3 vel; idVec3 vel;
float speed; float speed;
float roll; float roll;
float pitch; float pitch;
vel = physicsObj.GetLinearVelocity(); vel = physicsObj.GetLinearVelocity();
@ -3628,7 +3628,7 @@ void idAI::Activate( idEntity *activator ) {
// update the script in cinematics so that entities don't start anims or show themselves a frame late. // update the script in cinematics so that entities don't start anims or show themselves a frame late.
if ( cinematic ) { if ( cinematic ) {
UpdateAIScript(); UpdateAIScript();
// make sure our model gets updated // make sure our model gets updated
animator.ForceUpdate(); animator.ForceUpdate();
@ -4964,10 +4964,10 @@ bool idAI::UpdateAnimationControllers( void ) {
idVec3 focusPos; idVec3 focusPos;
idQuat jawQuat; idQuat jawQuat;
idVec3 left; idVec3 left;
idVec3 dir; idVec3 dir;
idVec3 orientationJointPos; idVec3 orientationJointPos;
idVec3 localDir; idVec3 localDir;
idAngles newLookAng; idAngles newLookAng;
idAngles diff; idAngles diff;
idMat3 mat; idMat3 mat;
idMat3 axis; idMat3 axis;
@ -5022,7 +5022,7 @@ bool idAI::UpdateAnimationControllers( void ) {
idEntity *focusEnt = focusEntity.GetEntity(); idEntity *focusEnt = focusEntity.GetEntity();
if ( !allowJointMod || !allowEyeFocus || ( gameLocal.time >= focusTime ) ) { if ( !allowJointMod || !allowEyeFocus || ( gameLocal.time >= focusTime ) ) {
focusPos = GetEyePosition() + orientationJointAxis[ 0 ] * 512.0f; focusPos = GetEyePosition() + orientationJointAxis[ 0 ] * 512.0f;
} else if ( focusEnt == NULL ) { } else if ( focusEnt == NULL ) {
// keep looking at last position until focusTime is up // keep looking at last position until focusTime is up
focusPos = currentFocusPos; focusPos = currentFocusPos;

View file

@ -689,8 +689,8 @@ protected:
void Event_AllowHiddenMovement( int enable ); void Event_AllowHiddenMovement( int enable );
void Event_TriggerParticles( const char *jointName ); void Event_TriggerParticles( const char *jointName );
void Event_FindActorsInBounds( const idVec3 &mins, const idVec3 &maxs ); void Event_FindActorsInBounds( const idVec3 &mins, const idVec3 &maxs );
void Event_CanReachPosition( const idVec3 &pos ); void Event_CanReachPosition( const idVec3 &pos );
void Event_CanReachEntity( idEntity *ent ); void Event_CanReachEntity( idEntity *ent );
void Event_CanReachEnemy( void ); void Event_CanReachEnemy( void );
void Event_GetReachableEntityPosition( idEntity *ent ); void Event_GetReachableEntityPosition( idEntity *ent );
#ifdef _D3XP #ifdef _D3XP

View file

@ -111,7 +111,7 @@ void idAI_Vagary::Event_ChooseObjectToThrow( const idVec3 &mins, const idVec3 &m
if ( PredictTrajectory( entPhys->GetOrigin() + offsetVec, enemyEyePos, speed, entPhys->GetGravity(), if ( PredictTrajectory( entPhys->GetOrigin() + offsetVec, enemyEyePos, speed, entPhys->GetGravity(),
entPhys->GetClipModel(), entPhys->GetClipMask(), MAX_WORLD_SIZE, NULL, enemyEnt, ai_debugTrajectory.GetBool() ? 4000 : 0, vel ) ) { entPhys->GetClipModel(), entPhys->GetClipMask(), MAX_WORLD_SIZE, NULL, enemyEnt, ai_debugTrajectory.GetBool() ? 4000 : 0, vel ) ) {
idThread::ReturnEntity( ent ); idThread::ReturnEntity( ent );
return; return;
} }
} }

View file

@ -308,7 +308,7 @@ CLASS_DECLARATION( idActor, idAI )
EVENT( AI_GetReachableEntityPosition, idAI::Event_GetReachableEntityPosition ) EVENT( AI_GetReachableEntityPosition, idAI::Event_GetReachableEntityPosition )
#ifdef _D3XP #ifdef _D3XP
EVENT( AI_MoveToPositionDirect, idAI::Event_MoveToPositionDirect ) EVENT( AI_MoveToPositionDirect, idAI::Event_MoveToPositionDirect )
EVENT( AI_AvoidObstacles, idAI::Event_AvoidObstacles ) EVENT( AI_AvoidObstacles, idAI::Event_AvoidObstacles )
EVENT( AI_TriggerFX, idAI::Event_TriggerFX ) EVENT( AI_TriggerFX, idAI::Event_TriggerFX )
EVENT( AI_StartEmitter, idAI::Event_StartEmitter ) EVENT( AI_StartEmitter, idAI::Event_StartEmitter )
EVENT( AI_GetEmitter, idAI::Event_GetEmitter ) EVENT( AI_GetEmitter, idAI::Event_GetEmitter )
@ -1853,7 +1853,7 @@ void idAI::Event_TestAnimMoveTowardEnemy( const char *animname ) {
} }
delta = enemyEnt->GetPhysics()->GetOrigin() - physicsObj.GetOrigin(); delta = enemyEnt->GetPhysics()->GetOrigin() - physicsObj.GetOrigin();
yaw = delta.ToYaw(); yaw = delta.ToYaw();
moveVec = animator.TotalMovementDelta( anim ) * idAngles( 0.0f, yaw, 0.0f ).ToMat3() * physicsObj.GetGravityAxis(); moveVec = animator.TotalMovementDelta( anim ) * idAngles( 0.0f, yaw, 0.0f ).ToMat3() * physicsObj.GetGravityAxis();
idAI::PredictPath( this, aas, physicsObj.GetOrigin(), moveVec, 1000, 1000, ( move.moveType == MOVETYPE_FLY ) ? SE_BLOCKED : ( SE_ENTER_OBSTACLE | SE_BLOCKED | SE_ENTER_LEDGE_AREA ), path ); idAI::PredictPath( this, aas, physicsObj.GetOrigin(), moveVec, 1000, 1000, ( move.moveType == MOVETYPE_FLY ) ? SE_BLOCKED : ( SE_ENTER_OBSTACLE | SE_BLOCKED | SE_ENTER_LEDGE_AREA ), path );
@ -2903,4 +2903,3 @@ void idAI::Event_StopEmitter( const char* name ) {
} }
#endif #endif

View file

@ -52,10 +52,10 @@ If you have questions concerning this license or the applicable additional terms
const float MAX_OBSTACLE_RADIUS = 256.0f; const float MAX_OBSTACLE_RADIUS = 256.0f;
const float PUSH_OUTSIDE_OBSTACLES = 0.5f; const float PUSH_OUTSIDE_OBSTACLES = 0.5f;
const float CLIP_BOUNDS_EPSILON = 10.0f; const float CLIP_BOUNDS_EPSILON = 10.0f;
const int MAX_AAS_WALL_EDGES = 256; const int MAX_AAS_WALL_EDGES = 256;
const int MAX_OBSTACLES = 256; const int MAX_OBSTACLES = 256;
const int MAX_PATH_NODES = 256; const int MAX_PATH_NODES = 256;
const int MAX_OBSTACLE_PATH = 64; const int MAX_OBSTACLE_PATH = 64;
typedef struct obstacle_s { typedef struct obstacle_s {
idVec2 bounds[2]; idVec2 bounds[2];
@ -425,7 +425,7 @@ int GetObstacles( const idPhysics *physics, const idAAS *aas, const idEntity *ig
lastEdgeNormal.Zero(); lastEdgeNormal.Zero();
nextVerts[0] = nextVerts[1] = 0; nextVerts[0] = nextVerts[1] = 0;
for ( i = 0; i < numWallEdges && numObstacles < MAX_OBSTACLES; i++ ) { for ( i = 0; i < numWallEdges && numObstacles < MAX_OBSTACLES; i++ ) {
aas->GetEdge( wallEdges[i], start, end ); aas->GetEdge( wallEdges[i], start, end );
aas->GetEdgeVertexNumbers( wallEdges[i], verts ); aas->GetEdgeVertexNumbers( wallEdges[i], verts );
edgeDir = end.ToVec2() - start.ToVec2(); edgeDir = end.ToVec2() - start.ToVec2();
edgeDir.Normalize(); edgeDir.Normalize();

View file

@ -1192,7 +1192,7 @@ void idAnimBlend::Reset( const idDeclModelDef *_modelDef ) {
blendStartValue = 0.0f; blendStartValue = 0.0f;
blendEndValue = 0.0f; blendEndValue = 0.0f;
blendStartTime = 0; blendStartTime = 0;
blendDuration = 0; blendDuration = 0;
} }
@ -1292,7 +1292,7 @@ idAnimBlend::SetWeight
void idAnimBlend::SetWeight( float newweight, int currentTime, int blendTime ) { void idAnimBlend::SetWeight( float newweight, int currentTime, int blendTime ) {
blendStartValue = GetWeight( currentTime ); blendStartValue = GetWeight( currentTime );
blendEndValue = newweight; blendEndValue = newweight;
blendStartTime = currentTime - 1; blendStartTime = currentTime - 1;
blendDuration = blendTime; blendDuration = blendTime;
if ( !newweight ) { if ( !newweight ) {
@ -1918,7 +1918,7 @@ bool idAnimBlend::BlendAnim( int currentTime, int channel, int numJoints, idJoin
blendFrame[j].q = jointFrame[j].q; blendFrame[j].q = jointFrame[j].q;
} }
} }
} else { } else {
blendWeight += weight; blendWeight += weight;
lerp = weight / blendWeight; lerp = weight / blendWeight;
SIMDProcessor->BlendJoints( blendFrame, jointFrame, lerp, modelDef->GetChannelJoints( channel ), modelDef->NumJointsOnChannel( channel ) ); SIMDProcessor->BlendJoints( blendFrame, jointFrame, lerp, modelDef->GetChannelJoints( channel ), modelDef->NumJointsOnChannel( channel ) );
@ -3634,7 +3634,7 @@ void idAnimator::SyncAnimChannels( int channelNum, int fromChannelNum, int curre
toBlend.blendStartValue = 0.0f; toBlend.blendStartValue = 0.0f;
toBlend.blendEndValue = 0.0f; toBlend.blendEndValue = 0.0f;
} }
toBlend.SetWeight( weight, currentTime - 1, blendTime ); toBlend.SetWeight( weight, currentTime - 1, blendTime );
// disable framecommands on the current channel so that commands aren't called twice // disable framecommands on the current channel so that commands aren't called twice
toBlend.AllowFrameCommands( false ); toBlend.AllowFrameCommands( false );
@ -4290,7 +4290,7 @@ bool idAnimator::CreateFrame( int currentTime, bool force ) {
if ( entity && ( ( g_debugAnim.GetInteger() == entity->entityNumber ) || ( g_debugAnim.GetInteger() == -2 ) ) ) { if ( entity && ( ( g_debugAnim.GetInteger() == entity->entityNumber ) || ( g_debugAnim.GetInteger() == -2 ) ) ) {
debugInfo = true; debugInfo = true;
gameLocal.Printf( "---------------\n%d: entity '%s':\n", gameLocal.time, entity->GetName() ); gameLocal.Printf( "---------------\n%d: entity '%s':\n", gameLocal.time, entity->GetName() );
gameLocal.Printf( "model '%s':\n", modelDef->GetModelName() ); gameLocal.Printf( "model '%s':\n", modelDef->GetModelName() );
} else { } else {
debugInfo = false; debugInfo = false;
} }
@ -5039,7 +5039,7 @@ idRenderModel *idGameEdit::ANIM_CreateMeshForAnim( idRenderModel *model, const c
const idDict *args; const idDict *args;
const char *temp; const char *temp;
idRenderModel *newmodel; idRenderModel *newmodel;
const idMD5Anim *md5anim; const idMD5Anim *md5anim;
idStr filename; idStr filename;
idStr extension; idStr extension;
const idAnim *anim; const idAnim *anim;

View file

@ -415,7 +415,7 @@ int idModelExport::ParseExportSection( idParser &parser ) {
return 0; return 0;
} }
parser.ReadToken( &token ); parser.ReadToken( &token );
if ( token.Icmp( g_exportMask.GetString() ) ) { if ( token.Icmp( g_exportMask.GetString() ) ) {
parser.SkipBracedSection(); parser.SkipBracedSection();
return 0; return 0;

View file

@ -414,7 +414,7 @@ void idTestModel::NextAnim( const idCmdArgs &args ) {
headAnim = 0; headAnim = 0;
if ( headAnimator ) { if ( headAnimator ) {
headAnimator->ClearAllAnims( gameLocal.time, 0 ); headAnimator->ClearAllAnims( gameLocal.time, 0 );
headAnim = headAnimator->GetAnim( animname ); headAnim = headAnimator->GetAnim( animname );
if ( !headAnim ) { if ( !headAnim ) {
headAnim = headAnimator->GetAnim( "idle" ); headAnim = headAnimator->GetAnim( "idle" );
} }
@ -456,7 +456,7 @@ void idTestModel::PrevAnim( const idCmdArgs &args ) {
headAnim = 0; headAnim = 0;
if ( headAnimator ) { if ( headAnimator ) {
headAnimator->ClearAllAnims( gameLocal.time, 0 ); headAnimator->ClearAllAnims( gameLocal.time, 0 );
headAnim = headAnimator->GetAnim( animname ); headAnim = headAnimator->GetAnim( animname );
if ( !headAnim ) { if ( !headAnim ) {
headAnim = headAnimator->GetAnim( "idle" ); headAnim = headAnimator->GetAnim( "idle" );
} }
@ -565,7 +565,7 @@ void idTestModel::TestAnim( const idCmdArgs &args ) {
headAnim = 0; headAnim = 0;
if ( headAnimator ) { if ( headAnimator ) {
headAnimator->ClearAllAnims( gameLocal.time, 0 ); headAnimator->ClearAllAnims( gameLocal.time, 0 );
headAnim = headAnimator->GetAnim( animname ); headAnim = headAnimator->GetAnim( animname );
if ( !headAnim ) { if ( !headAnim ) {
headAnim = headAnimator->GetAnim( "idle" ); headAnim = headAnimator->GetAnim( "idle" );
if ( !headAnim ) { if ( !headAnim ) {

View file

@ -58,19 +58,19 @@ public:
void TestAnim( const idCmdArgs &args ); void TestAnim( const idCmdArgs &args );
void BlendAnim( const idCmdArgs &args ); void BlendAnim( const idCmdArgs &args );
static void KeepTestModel_f( const idCmdArgs &args ); static void KeepTestModel_f( const idCmdArgs &args );
static void TestModel_f( const idCmdArgs &args ); static void TestModel_f( const idCmdArgs &args );
static void ArgCompletion_TestModel( const idCmdArgs &args, void(*callback)( const char *s ) ); static void ArgCompletion_TestModel( const idCmdArgs &args, void(*callback)( const char *s ) );
static void TestSkin_f( const idCmdArgs &args ); static void TestSkin_f( const idCmdArgs &args );
static void TestShaderParm_f( const idCmdArgs &args ); static void TestShaderParm_f( const idCmdArgs &args );
static void TestParticleStopTime_f( const idCmdArgs &args ); static void TestParticleStopTime_f( const idCmdArgs &args );
static void TestAnim_f( const idCmdArgs &args ); static void TestAnim_f( const idCmdArgs &args );
static void ArgCompletion_TestAnim( const idCmdArgs &args, void(*callback)( const char *s ) ); static void ArgCompletion_TestAnim( const idCmdArgs &args, void(*callback)( const char *s ) );
static void TestBlend_f( const idCmdArgs &args ); static void TestBlend_f( const idCmdArgs &args );
static void TestModelNextAnim_f( const idCmdArgs &args ); static void TestModelNextAnim_f( const idCmdArgs &args );
static void TestModelPrevAnim_f( const idCmdArgs &args ); static void TestModelPrevAnim_f( const idCmdArgs &args );
static void TestModelNextFrame_f( const idCmdArgs &args ); static void TestModelNextFrame_f( const idCmdArgs &args );
static void TestModelPrevFrame_f( const idCmdArgs &args ); static void TestModelPrevFrame_f( const idCmdArgs &args );
private: private:
idEntityPtr<idEntity> head; idEntityPtr<idEntity> head;

View file

@ -2623,4 +2623,3 @@ If you have questions concerning this license or the applicable additional terms
typedef void ( idClass::*eventCallback_ffffffff_t )( const float, const float, const float, const float, const float, const float, const float, const float ); typedef void ( idClass::*eventCallback_ffffffff_t )( const float, const float, const float, const float, const float, const float, const float, const float );
( this->*( eventCallback_ffffffff_t )callback )( *( float * )&data[ 0 ], *( float * )&data[ 1 ], *( float * )&data[ 2 ], *( float * )&data[ 3 ], *( float * )&data[ 4 ], *( float * )&data[ 5 ], *( float * )&data[ 6 ], *( float * )&data[ 7 ] ); ( this->*( eventCallback_ffffffff_t )callback )( *( float * )&data[ 0 ], *( float * )&data[ 1 ], *( float * )&data[ 2 ], *( float * )&data[ 3 ], *( float * )&data[ 4 ], *( float * )&data[ 5 ], *( float * )&data[ 6 ], *( float * )&data[ 7 ] );
break; break;

View file

@ -394,7 +394,7 @@ void idClass::Init( void ) {
// is a subclass of another // is a subclass of another
num = 0; num = 0;
for( c = classHierarchy.GetNext(); c != NULL; c = c->node.GetNext(), num++ ) { for( c = classHierarchy.GetNext(); c != NULL; c = c->node.GetNext(), num++ ) {
c->typeNum = num; c->typeNum = num;
c->lastChild += num; c->lastChild += num;
} }
@ -504,7 +504,7 @@ void idClass::operator delete( void *ptr ) {
p = ( ( int * )ptr ) - 1; p = ( ( int * )ptr ) - 1;
memused -= *p; memused -= *p;
numobjects--; numobjects--;
Mem_Free( p ); Mem_Free( p );
} }
} }
@ -515,7 +515,7 @@ void idClass::operator delete( void *ptr, int, int, char *, int ) {
p = ( ( int * )ptr ) - 1; p = ( ( int * )ptr ) - 1;
memused -= *p; memused -= *p;
numobjects--; numobjects--;
Mem_Free( p ); Mem_Free( p );
} }
} }

View file

@ -233,7 +233,7 @@ void idSaveGame::WriteString( const char *string ) {
len = strlen( string ); len = strlen( string );
WriteInt( len ); WriteInt( len );
file->Write( string, len ); file->Write( string, len );
} }
/* /*

View file

@ -623,19 +623,19 @@ static void Cmd_Say( bool team, const idCmdArgs &args ) {
} }
#ifdef CTF #ifdef CTF
// Append the player's location to team chat messages in CTF // Append the player's location to team chat messages in CTF
if ( gameLocal.mpGame.IsGametypeFlagBased() && team && player ) { if ( gameLocal.mpGame.IsGametypeFlagBased() && team && player ) {
idLocationEntity *locationEntity = gameLocal.LocationForPoint( player->GetEyePosition() ); idLocationEntity *locationEntity = gameLocal.LocationForPoint( player->GetEyePosition() );
if ( locationEntity ) { if ( locationEntity ) {
idStr temp = "["; idStr temp = "[";
temp += locationEntity->GetLocation(); temp += locationEntity->GetLocation();
temp += "] "; temp += "] ";
temp += text; temp += text;
text = temp; text = temp;
} }
} }
#endif #endif

View file

@ -112,7 +112,7 @@ idCVar ui_chat( "ui_chat", "0", CVAR_GAME | CVAR_USERINFO | CVAR_BOOL
// change anytime vars // change anytime vars
idCVar developer( "developer", "0", CVAR_GAME | CVAR_BOOL, "" ); idCVar developer( "developer", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar r_aspectRatio( "r_aspectRatio", "0", CVAR_RENDERER | CVAR_INTEGER | CVAR_ARCHIVE, "aspect ratio of view:\n0 = 4:3\n1 = 16:9\n2 = 16:10", 0, 2 ); idCVar r_aspectRatio( "r_aspectRatio", "0", CVAR_RENDERER | CVAR_INTEGER | CVAR_ARCHIVE, "aspect ratio of view:\n0 = 4:3\n1 = 16:9\n2 = 16:10", 0, 2 );
idCVar g_cinematic( "g_cinematic", "1", CVAR_GAME | CVAR_BOOL, "skips updating entities that aren't marked 'cinematic' '1' during cinematics" ); idCVar g_cinematic( "g_cinematic", "1", CVAR_GAME | CVAR_BOOL, "skips updating entities that aren't marked 'cinematic' '1' during cinematics" );
idCVar g_cinematicMaxSkipTime( "g_cinematicMaxSkipTime", "600", CVAR_GAME | CVAR_FLOAT, "# of seconds to allow game to run when skipping cinematic. prevents lock-up when cinematic doesn't end.", 0, 3600 ); idCVar g_cinematicMaxSkipTime( "g_cinematicMaxSkipTime", "600", CVAR_GAME | CVAR_FLOAT, "# of seconds to allow game to run when skipping cinematic. prevents lock-up when cinematic doesn't end.", 0, 3600 );

View file

@ -158,7 +158,7 @@ public: // common physics interface
virtual const contactInfo_t &GetContact( int num ) const = 0; virtual const contactInfo_t &GetContact( int num ) const = 0;
virtual void ClearContacts( void ) = 0; virtual void ClearContacts( void ) = 0;
virtual void AddContactEntity( idEntity *e ) = 0; virtual void AddContactEntity( idEntity *e ) = 0;
virtual void RemoveContactEntity( idEntity *e ) = 0; virtual void RemoveContactEntity( idEntity *e ) = 0;
// ground contacts // ground contacts
virtual bool HasGroundContacts( void ) const = 0; virtual bool HasGroundContacts( void ) const = 0;
virtual bool IsGroundEntity( int entityNum ) const = 0; virtual bool IsGroundEntity( int entityNum ) const = 0;

View file

@ -1301,12 +1301,12 @@ void idAFConstraint_UniversalJoint::DebugDraw( void ) {
d1 = axis1 * body1->GetWorldAxis(); d1 = axis1 * body1->GetWorldAxis();
if ( master ) { if ( master ) {
a2 = master->GetWorldOrigin() + anchor2 * master->GetWorldAxis(); a2 = master->GetWorldOrigin() + anchor2 * master->GetWorldAxis();
s2 = shaft2 * master->GetWorldAxis(); s2 = shaft2 * master->GetWorldAxis();
d2 = axis2 * master->GetWorldAxis(); d2 = axis2 * master->GetWorldAxis();
} }
else { else {
a2 = anchor2; a2 = anchor2;
s2 = shaft2; s2 = shaft2;
d2 = axis2; d2 = axis2;
} }

View file

@ -501,7 +501,7 @@ bool idPhysics_Monster::Evaluate( int timeStepMSec, int endTimeMSec ) {
delta = current.velocity * timeStep; delta = current.velocity * timeStep;
if ( delta != vec3_origin ) { if ( delta != vec3_origin ) {
moveResult = idPhysics_Monster::SlideMove( current.origin, current.velocity, delta ); moveResult = idPhysics_Monster::SlideMove( current.origin, current.velocity, delta );
delta.Zero(); delta.Zero();
} }
if ( !fly ) { if ( !fly ) {

View file

@ -2042,4 +2042,3 @@ void idPhysics_Player::ReadFromSnapshot( const idBitMsgDelta &msg ) {
clipModel->Link( gameLocal.clip, self, 0, current.origin, clipModel->GetAxis() ); clipModel->Link( gameLocal.clip, self, 0, current.origin, clipModel->GetAxis() );
} }
} }

View file

@ -762,7 +762,7 @@ void idPhysics_StaticMulti::DisableClip( void ) {
int i; int i;
for ( i = 0; i < clipModels.Num(); i++ ) { for ( i = 0; i < clipModels.Num(); i++ ) {
if ( clipModels[i] ) { if ( clipModels[i] ) {
clipModels[i]->Disable(); clipModels[i]->Disable();
} }
} }
@ -792,7 +792,7 @@ void idPhysics_StaticMulti::UnlinkClip( void ) {
int i; int i;
for ( i = 0; i < clipModels.Num(); i++ ) { for ( i = 0; i < clipModels.Num(); i++ ) {
if ( clipModels[i] ) { if ( clipModels[i] ) {
clipModels[i]->Unlink(); clipModels[i]->Unlink();
} }
} }
@ -934,7 +934,7 @@ void idPhysics_StaticMulti::SetMaster( idEntity *master, const bool orientated )
// transform from world space to master space // transform from world space to master space
self->GetMasterPosition( masterOrigin, masterAxis ); self->GetMasterPosition( masterOrigin, masterAxis );
for ( i = 0; i < clipModels.Num(); i++ ) { for ( i = 0; i < clipModels.Num(); i++ ) {
current[i].localOrigin = ( current[i].origin - masterOrigin ) * masterAxis.Transpose(); current[i].localOrigin = ( current[i].origin - masterOrigin ) * masterAxis.Transpose();
if ( orientated ) { if ( orientated ) {
current[i].localAxis = current[i].axis * masterAxis.Transpose(); current[i].localAxis = current[i].axis * masterAxis.Transpose();
} else { } else {

View file

@ -1394,7 +1394,7 @@ float idPush::ClipPush( trace_t &results, idEntity *pusher, const int flags,
idRotation rotation; idRotation rotation;
float mass; float mass;
mass = 0.0f; mass = 0.0f;
results.fraction = 1.0f; results.fraction = 1.0f;
results.endpos = newOrigin; results.endpos = newOrigin;

View file

@ -85,7 +85,7 @@ opcode_t idCompiler::opcodes[] = {
{ "!=", "NE_F", 5, false, &def_float, &def_float, &def_float }, { "!=", "NE_F", 5, false, &def_float, &def_float, &def_float },
{ "!=", "NE_V", 5, false, &def_vector, &def_vector, &def_float }, { "!=", "NE_V", 5, false, &def_vector, &def_vector, &def_float },
{ "!=", "NE_S", 5, false, &def_string, &def_string, &def_float }, { "!=", "NE_S", 5, false, &def_string, &def_string, &def_float },
{ "!=", "NE_E", 5, false, &def_entity, &def_entity, &def_float }, { "!=", "NE_E", 5, false, &def_entity, &def_entity, &def_float },
{ "!=", "NE_EO", 5, false, &def_entity, &def_object, &def_float }, { "!=", "NE_EO", 5, false, &def_entity, &def_object, &def_float },
{ "!=", "NE_OE", 5, false, &def_object, &def_entity, &def_float }, { "!=", "NE_OE", 5, false, &def_object, &def_entity, &def_float },
{ "!=", "NE_OO", 5, false, &def_object, &def_object, &def_float }, { "!=", "NE_OO", 5, false, &def_object, &def_object, &def_float },
@ -534,7 +534,7 @@ idVarDef *idCompiler::OptimizeOpcode( const opcode_t *op, idVarDef *var_a, idVar
case OP_UDIV_F: c._float = Divide( *var_b->value.floatPtr, *var_a->value.floatPtr ); type = &type_float; break; case OP_UDIV_F: c._float = Divide( *var_b->value.floatPtr, *var_a->value.floatPtr ); type = &type_float; break;
case OP_UMOD_F: c._float = ( int ) *var_b->value.floatPtr % ( int )*var_a->value.floatPtr; type = &type_float; break; case OP_UMOD_F: c._float = ( int ) *var_b->value.floatPtr % ( int )*var_a->value.floatPtr; type = &type_float; break;
case OP_UOR_F: c._float = ( int )*var_b->value.floatPtr | ( int )*var_a->value.floatPtr; type = &type_float; break; case OP_UOR_F: c._float = ( int )*var_b->value.floatPtr | ( int )*var_a->value.floatPtr; type = &type_float; break;
case OP_UAND_F: c._float = ( int )*var_b->value.floatPtr & ( int )*var_a->value.floatPtr; type = &type_float; break; case OP_UAND_F: c._float = ( int )*var_b->value.floatPtr & ( int )*var_a->value.floatPtr; type = &type_float; break;
case OP_UINC_F: c._float = *var_a->value.floatPtr + 1; type = &type_float; break; case OP_UINC_F: c._float = *var_a->value.floatPtr + 1; type = &type_float; break;
case OP_UDEC_F: c._float = *var_a->value.floatPtr - 1; type = &type_float; break; case OP_UDEC_F: c._float = *var_a->value.floatPtr - 1; type = &type_float; break;
case OP_COMP_F: c._float = ( float )~( int )*var_a->value.floatPtr; type = &type_float; break; case OP_COMP_F: c._float = ( float )~( int )*var_a->value.floatPtr; type = &type_float; break;
@ -586,7 +586,7 @@ idVarDef *idCompiler::EmitOpcode( const opcode_t *op, idVarDef *var_a, idVarDef
statement = gameLocal.program.AllocStatement(); statement = gameLocal.program.AllocStatement();
statement->linenumber = currentLineNumber; statement->linenumber = currentLineNumber;
statement->file = currentFileNumber; statement->file = currentFileNumber;
if ( ( op->type_c == &def_void ) || op->rightAssociative ) { if ( ( op->type_c == &def_void ) || op->rightAssociative ) {
// ifs, gotos, and assignments don't need vars allocated // ifs, gotos, and assignments don't need vars allocated
@ -935,8 +935,8 @@ idVarDef *idCompiler::EmitFunctionParms( int op, idVarDef *func, int startarg, i
const idTypeDef *funcArg; const idTypeDef *funcArg;
idVarDef *returnDef; idVarDef *returnDef;
idTypeDef *returnType; idTypeDef *returnType;
int arg; int arg;
int size; int size;
int resultOp; int resultOp;
type = func->TypeDef(); type = func->TypeDef();
@ -1199,7 +1199,7 @@ idVarDef *idCompiler::LookupDef( const char *name, const idVarDef *baseobj ) {
type_c = field->TypeDef()->ReturnType()->Type(); type_c = field->TypeDef()->ReturnType()->Type();
} else { } else {
type_c = field->TypeDef()->FieldType()->Type(); // field access gets type from field type_c = field->TypeDef()->FieldType()->Type(); // field access gets type from field
if ( CheckToken( "++" ) ) { if ( CheckToken( "++" ) ) {
if ( type_c != ev_float ) { if ( type_c != ev_float ) {
Error( "Invalid type for ++" ); Error( "Invalid type for ++" );
} }
@ -1303,7 +1303,7 @@ idCompiler::GetTerm
*/ */
idVarDef *idCompiler::GetTerm( void ) { idVarDef *idCompiler::GetTerm( void ) {
idVarDef *e; idVarDef *e;
int op; int op;
if ( !immediateType && CheckToken( "~" ) ) { if ( !immediateType && CheckToken( "~" ) ) {
e = GetExpression( TILDE_PRIORITY ); e = GetExpression( TILDE_PRIORITY );
@ -1468,9 +1468,9 @@ idVarDef *idCompiler::GetExpression( int priority ) {
idVarDef *e; idVarDef *e;
idVarDef *e2; idVarDef *e2;
const idVarDef *oldtype; const idVarDef *oldtype;
etype_t type_a; etype_t type_a;
etype_t type_b; etype_t type_b;
etype_t type_c; etype_t type_c;
if ( priority == 0 ) { if ( priority == 0 ) {
return GetTerm(); return GetTerm();
@ -1675,8 +1675,8 @@ idCompiler::ParseReturnStatement
*/ */
void idCompiler::ParseReturnStatement( void ) { void idCompiler::ParseReturnStatement( void ) {
idVarDef *e; idVarDef *e;
etype_t type_a; etype_t type_a;
etype_t type_b; etype_t type_b;
opcode_t *op; opcode_t *op;
if ( CheckToken( ";" ) ) { if ( CheckToken( ";" ) ) {
@ -1748,7 +1748,7 @@ void idCompiler::ParseWhileStatement( void ) {
EmitOpcode( OP_GOTO, JumpTo( patch2 ), 0 ); EmitOpcode( OP_GOTO, JumpTo( patch2 ), 0 );
} else { } else {
patch1 = gameLocal.program.NumStatements(); patch1 = gameLocal.program.NumStatements();
EmitOpcode( OP_IFNOT, e, 0 ); EmitOpcode( OP_IFNOT, e, 0 );
ParseStatement(); ParseStatement();
EmitOpcode( OP_GOTO, JumpTo( patch2 ), 0 ); EmitOpcode( OP_GOTO, JumpTo( patch2 ), 0 );
gameLocal.program.GetStatement( patch1 ).b = JumpFrom( patch1 ); gameLocal.program.GetStatement( patch1 ).b = JumpFrom( patch1 );
@ -2116,8 +2116,8 @@ void idCompiler::ParseFunctionDef( idTypeDef *returnType, const char *name ) {
idVarDef *def; idVarDef *def;
const idVarDef *parm; const idVarDef *parm;
idVarDef *oldscope; idVarDef *oldscope;
int i; int i;
int numParms; int numParms;
const idTypeDef *parmType; const idTypeDef *parmType;
function_t *func; function_t *func;
statement_t *pos; statement_t *pos;
@ -2399,7 +2399,7 @@ void idCompiler::ParseEventDef( idTypeDef *returnType, const char *name ) {
const idTypeDef *expectedType; const idTypeDef *expectedType;
idTypeDef *argType; idTypeDef *argType;
idTypeDef *type; idTypeDef *type;
int i; int i;
int num; int num;
const char *format; const char *format;
const idEventDef *ev; const idEventDef *ev;
@ -2483,7 +2483,7 @@ Called at the outer layer and when a local statement is hit
================ ================
*/ */
void idCompiler::ParseDefs( void ) { void idCompiler::ParseDefs( void ) {
idStr name; idStr name;
idTypeDef *type; idTypeDef *type;
idVarDef *def; idVarDef *def;
idVarDef *oldscope; idVarDef *oldscope;

View file

@ -170,7 +170,7 @@ void idInterpreter::Reset( void ) {
currentFunction = 0; currentFunction = 0;
NextInstruction( 0 ); NextInstruction( 0 );
threadDying = false; threadDying = false;
doneProcessing = true; doneProcessing = true;
} }
@ -389,7 +389,7 @@ idInterpreter::StackTrace
*/ */
void idInterpreter::StackTrace( void ) const { void idInterpreter::StackTrace( void ) const {
const function_t *f; const function_t *f;
int i; int i;
int top; int top;
if ( callStackDepth == 0 ) { if ( callStackDepth == 0 ) {
@ -552,7 +552,7 @@ NOTE: If this is called from within a event called by this interpreter, the func
==================== ====================
*/ */
void idInterpreter::EnterFunction( const function_t *func, bool clearStack ) { void idInterpreter::EnterFunction( const function_t *func, bool clearStack ) {
int c; int c;
prstack_t *stack; prstack_t *stack;
if ( clearStack ) { if ( clearStack ) {
@ -587,7 +587,7 @@ void idInterpreter::EnterFunction( const function_t *func, bool clearStack ) {
gameLocal.Printf( "%d: call '%s' from '%s'(line %d)%s\n", gameLocal.time, func->Name(), currentFunction->Name(), gameLocal.Printf( "%d: call '%s' from '%s'(line %d)%s\n", gameLocal.time, func->Name(), currentFunction->Name(),
gameLocal.program.GetStatement( instructionPointer ).linenumber, clearStack ? " clear stack" : "" ); gameLocal.program.GetStatement( instructionPointer ).linenumber, clearStack ? " clear stack" : "" );
} else { } else {
gameLocal.Printf( "%d: call '%s'%s\n", gameLocal.time, func->Name(), clearStack ? " clear stack" : "" ); gameLocal.Printf( "%d: call '%s'%s\n", gameLocal.time, func->Name(), clearStack ? " clear stack" : "" );
} }
} }
@ -681,11 +681,11 @@ idInterpreter::CallEvent
================ ================
*/ */
void idInterpreter::CallEvent( const function_t *func, int argsize ) { void idInterpreter::CallEvent( const function_t *func, int argsize ) {
int i; int i;
int j; int j;
varEval_t var; varEval_t var;
int pos; int pos;
int start; int start;
int data[ D_EVENT_MAXARGS ]; int data[ D_EVENT_MAXARGS ];
const idEventDef *evdef; const idEventDef *evdef;
const char *format; const char *format;
@ -852,11 +852,11 @@ idInterpreter::CallSysEvent
================ ================
*/ */
void idInterpreter::CallSysEvent( const function_t *func, int argsize ) { void idInterpreter::CallSysEvent( const function_t *func, int argsize ) {
int i; int i;
int j; int j;
varEval_t source; varEval_t source;
int pos; int pos;
int start; int start;
int data[ D_EVENT_MAXARGS ]; int data[ D_EVENT_MAXARGS ];
const idEventDef *evdef; const idEventDef *evdef;
const char *format; const char *format;
@ -939,7 +939,7 @@ bool idInterpreter::Execute( void ) {
varEval_t var_c; varEval_t var_c;
varEval_t var; varEval_t var;
statement_t *st; statement_t *st;
int runaway; int runaway;
idThread *newThread; idThread *newThread;
float floatVal; float floatVal;
idScriptObject *obj; idScriptObject *obj;

View file

@ -29,28 +29,28 @@ If you have questions concerning this license or the applicable additional terms
#ifndef __SCRIPT_INTERPRETER_H__ #ifndef __SCRIPT_INTERPRETER_H__
#define __SCRIPT_INTERPRETER_H__ #define __SCRIPT_INTERPRETER_H__
#define MAX_STACK_DEPTH 64 #define MAX_STACK_DEPTH 64
#define LOCALSTACK_SIZE 6144 #define LOCALSTACK_SIZE 6144
typedef struct prstack_s { typedef struct prstack_s {
int s; int s;
const function_t *f; const function_t *f;
int stackbase; int stackbase;
} prstack_t; } prstack_t;
class idInterpreter { class idInterpreter {
private: private:
prstack_t callStack[ MAX_STACK_DEPTH ]; prstack_t callStack[ MAX_STACK_DEPTH ];
int callStackDepth; int callStackDepth;
int maxStackDepth; int maxStackDepth;
byte localstack[ LOCALSTACK_SIZE ]; byte localstack[ LOCALSTACK_SIZE ];
int localstackUsed; int localstackUsed;
int localstackBase; int localstackBase;
int maxLocalstackUsed; int maxLocalstackUsed;
const function_t *currentFunction; const function_t *currentFunction;
int instructionPointer; int instructionPointer;
int popParms; int popParms;
const idEventDef *multiFrameEvent; const idEventDef *multiFrameEvent;

View file

@ -795,7 +795,7 @@ void idVarDef::PrintInfo( idFile *file, int instructionPointer ) const {
break; break;
case ev_float : case ev_float :
file->Printf( "%f", *value.floatPtr ); file->Printf( "%f", *value.floatPtr );
break; break;
case ev_virtualfunction : case ev_virtualfunction :
@ -1597,7 +1597,7 @@ void idProgram::BeginCompilation( void ) {
// make the first statement a return for a "NULL" function // make the first statement a return for a "NULL" function
statement = AllocStatement(); statement = AllocStatement();
statement->linenumber = 0; statement->linenumber = 0;
statement->file = 0; statement->file = 0;
statement->op = OP_RETURN; statement->op = OP_RETURN;
statement->a = NULL; statement->a = NULL;
statement->b = NULL; statement->b = NULL;

View file

@ -72,16 +72,16 @@ public:
void Clear( void ); void Clear( void );
private: private:
idStr name; idStr name;
public: public:
const idEventDef *eventdef; const idEventDef *eventdef;
idVarDef *def; idVarDef *def;
const idTypeDef *type; const idTypeDef *type;
int firstStatement; int firstStatement;
int numStatements; int numStatements;
int parmTotal; int parmTotal;
int locals; // total ints of parms + locals int locals; // total ints of parms + locals
int filenum; // source file defined in int filenum; // source file defined in
idList<int> parmSize; idList<int> parmSize;
}; };
@ -90,8 +90,8 @@ typedef union eval_s {
float _float; float _float;
float vector[ 3 ]; float vector[ 3 ];
function_t *function; function_t *function;
int _int; int _int;
int entity; int entity;
} eval_t; } eval_t;
/*********************************************************************** /***********************************************************************
@ -105,7 +105,7 @@ Contains type information for variables and functions.
class idTypeDef { class idTypeDef {
private: private:
etype_t type; etype_t type;
idStr name; idStr name;
int size; int size;
// function types are more complex // function types are more complex
@ -309,9 +309,9 @@ typedef union varEval_s {
float *floatPtr; float *floatPtr;
idVec3 *vectorPtr; idVec3 *vectorPtr;
function_t *functionPtr; function_t *functionPtr;
int *intPtr; int *intPtr;
byte *bytePtr; byte *bytePtr;
int *entityNumberPtr; int *entityNumberPtr;
int virtualFunction; int virtualFunction;
int jumpOffset; int jumpOffset;
int stackOffset; // offset in stack for local variables int stackOffset; // offset in stack for local variables
@ -328,7 +328,7 @@ class idVarDef {
public: public:
int num; int num;
varEval_t value; varEval_t value;
idVarDef * scope; // function, namespace, or object the var was defined in idVarDef * scope; // function, namespace, or object the var was defined in
int numUsers; // number of users if this is a constant int numUsers; // number of users if this is a constant
typedef enum { typedef enum {
@ -448,7 +448,7 @@ single idProgram.
class idProgram { class idProgram {
private: private:
idStrList fileList; idStrList fileList;
idStr filename; idStr filename;
int filenum; int filenum;
int numVariables; int numVariables;
@ -524,7 +524,7 @@ public:
statement_t &GetStatement( int index ); statement_t &GetStatement( int index );
int NumStatements( void ) { return statements.Num(); } int NumStatements( void ) { return statements.Num(); }
int GetReturnedInteger( void ); int GetReturnedInteger( void );
void ReturnFloat( float value ); void ReturnFloat( float value );
void ReturnInteger( int value ); void ReturnInteger( int value );

View file

@ -85,8 +85,8 @@ private:
idDict spawnArgs; idDict spawnArgs;
int threadNum; int threadNum;
idStr threadName; idStr threadName;
int lastExecuteTime; int lastExecuteTime;
int creationTime; int creationTime;
@ -134,10 +134,10 @@ private:
void Event_SpawnFloat( const char *key, float defaultvalue ); void Event_SpawnFloat( const char *key, float defaultvalue );
void Event_SpawnVector( const char *key, idVec3 &defaultvalue ); void Event_SpawnVector( const char *key, idVec3 &defaultvalue );
void Event_ClearPersistantArgs( void ); void Event_ClearPersistantArgs( void );
void Event_SetPersistantArg( const char *key, const char *value ); void Event_SetPersistantArg( const char *key, const char *value );
void Event_GetPersistantString( const char *key ); void Event_GetPersistantString( const char *key );
void Event_GetPersistantFloat( const char *key ); void Event_GetPersistantFloat( const char *key );
void Event_GetPersistantVector( const char *key ); void Event_GetPersistantVector( const char *key );
void Event_AngToForward( idAngles &ang ); void Event_AngToForward( idAngles &ang );
void Event_AngToRight( idAngles &ang ); void Event_AngToRight( idAngles &ang );
void Event_AngToUp( idAngles &ang ); void Event_AngToUp( idAngles &ang );
@ -176,17 +176,17 @@ private:
void Event_StartMusic( const char *name ); void Event_StartMusic( const char *name );
void Event_Warning( const char *text ); void Event_Warning( const char *text );
void Event_Error( const char *text ); void Event_Error( const char *text );
void Event_StrLen( const char *string ); void Event_StrLen( const char *string );
void Event_StrLeft( const char *string, int num ); void Event_StrLeft( const char *string, int num );
void Event_StrRight( const char *string, int num ); void Event_StrRight( const char *string, int num );
void Event_StrSkip( const char *string, int num ); void Event_StrSkip( const char *string, int num );
void Event_StrMid( const char *string, int start, int num ); void Event_StrMid( const char *string, int start, int num );
void Event_StrToFloat( const char *string ); void Event_StrToFloat( const char *string );
void Event_RadiusDamage( const idVec3 &origin, idEntity *inflictor, idEntity *attacker, idEntity *ignore, const char *damageDefName, float dmgPower ); void Event_RadiusDamage( const idVec3 &origin, idEntity *inflictor, idEntity *attacker, idEntity *ignore, const char *damageDefName, float dmgPower );
void Event_IsClient( void ); void Event_IsClient( void );
void Event_IsMultiplayer( void ); void Event_IsMultiplayer( void );
void Event_GetFrameTime( void ); void Event_GetFrameTime( void );
void Event_GetTicsPerSecond( void ); void Event_GetTicsPerSecond( void );
void Event_CacheSoundShader( const char *soundName ); void Event_CacheSoundShader( const char *soundName );
void Event_DebugLine( const idVec3 &color, const idVec3 &start, const idVec3 &end, const float lifetime ); void Event_DebugLine( const idVec3 &color, const idVec3 &start, const idVec3 &end, const float lifetime );
void Event_DebugArrow( const idVec3 &color, const idVec3 &start, const idVec3 &end, const int size, const float lifetime ); void Event_DebugArrow( const idVec3 &color, const idVec3 &start, const idVec3 &end, const int size, const float lifetime );
@ -255,7 +255,7 @@ public:
bool Start( void ); bool Start( void );
idThread *WaitingOnThread( void ); idThread *WaitingOnThread( void );
void SetThreadNum( int num ); void SetThreadNum( int num );
int GetThreadNum( void ); int GetThreadNum( void );
void SetThreadName( const char *name ); void SetThreadName( const char *name );
const char *GetThreadName( void ); const char *GetThreadName( void );

View file

@ -132,4 +132,3 @@ If you have questions concerning this license or the applicable additional terms
# define ID_ALLOW_D3XP 1 # define ID_ALLOW_D3XP 1
# endif # endif
#endif #endif

View file

@ -100,7 +100,7 @@ const int DECL_LEXER_FLAGS = LEXFL_NOSTRINGCONCAT | // multiple strings seper
class idDeclBase { class idDeclBase {
public: public:
virtual ~idDeclBase() {}; virtual ~idDeclBase() {};
virtual const char * GetName( void ) const = 0; virtual const char * GetName( void ) const = 0;
virtual declType_t GetType( void ) const = 0; virtual declType_t GetType( void ) const = 0;
virtual declState_t GetState( void ) const = 0; virtual declState_t GetState( void ) const = 0;
@ -134,7 +134,7 @@ public:
// The constructor should initialize variables such that // The constructor should initialize variables such that
// an immediate call to FreeData() does no harm. // an immediate call to FreeData() does no harm.
idDecl( void ) { base = NULL; } idDecl( void ) { base = NULL; }
virtual ~idDecl( void ) {}; virtual ~idDecl( void ) {};
// Returns the name of the decl. // Returns the name of the decl.
const char * GetName( void ) const { return base->GetName(); } const char * GetName( void ) const { return base->GetName(); }

View file

@ -1261,7 +1261,7 @@ void idAF::RemoveBindConstraints( void ) {
name.Strip( "bindConstraint " ); name.Strip( "bindConstraint " );
if ( physicsObj.GetConstraint( name ) ) { if ( physicsObj.GetConstraint( name ) ) {
physicsObj.DeleteConstraint( name ); physicsObj.DeleteConstraint( name );
} }
kv = args.MatchPrefix( "bindConstraint ", kv ); kv = args.MatchPrefix( "bindConstraint ", kv );

View file

@ -2838,7 +2838,7 @@ idRenderModel *idGameEdit::AF_CreateMesh( const idDict &args, idVec3 &meshOrigin
modifiedAxis[ jointNum ] = ( bodyAxis[i] * originalJoints[jointNum].ToMat3().Transpose() ).Transpose() * ( newBodyAxis[i] * meshAxis.Transpose() ); modifiedAxis[ jointNum ] = ( bodyAxis[i] * originalJoints[jointNum].ToMat3().Transpose() ).Transpose() * ( newBodyAxis[i] * meshAxis.Transpose() );
// FIXME: calculate correct modifiedOrigin // FIXME: calculate correct modifiedOrigin
modifiedOrigin[ jointNum ] = originalJoints[ jointNum ].ToVec3(); modifiedOrigin[ jointNum ] = originalJoints[ jointNum ].ToVec3();
} }
} }
// apply joint modifications to the skeleton // apply joint modifications to the skeleton

View file

@ -607,7 +607,7 @@ void idActor::Spawn( void ) {
int headAnim = headAnimator->GetAnim( "def_head" ); int headAnim = headAnimator->GetAnim( "def_head" );
if ( headAnim ) { if ( headAnim ) {
if ( headEnt ) { if ( headEnt ) {
headAnimator->CycleAnim( ANIMCHANNEL_ALL, headAnim, gameLocal.time, 0 ); headAnimator->CycleAnim( ANIMCHANNEL_ALL, headAnim, gameLocal.time, 0 );
} else { } else {
headAnimator->CycleAnim( ANIMCHANNEL_HEAD, headAnim, gameLocal.time, 0 ); headAnimator->CycleAnim( ANIMCHANNEL_HEAD, headAnim, gameLocal.time, 0 );
} }
@ -3197,7 +3197,7 @@ void idActor::Event_NextEnemy( idEntity *ent ) {
} }
} }
idThread::ReturnEntity( NULL ); idThread::ReturnEntity( NULL );
} }
/* /*

View file

@ -386,7 +386,7 @@ bool idBrittleFracture::UpdateRenderEntity( renderEntity_s *renderEntity, const
} }
packedColor = PackColor( idVec4( renderEntity->shaderParms[ SHADERPARM_RED ] * fade, packedColor = PackColor( idVec4( renderEntity->shaderParms[ SHADERPARM_RED ] * fade,
renderEntity->shaderParms[ SHADERPARM_GREEN ] * fade, renderEntity->shaderParms[ SHADERPARM_GREEN ] * fade,
renderEntity->shaderParms[ SHADERPARM_BLUE ] * fade, renderEntity->shaderParms[ SHADERPARM_BLUE ] * fade,
fade ) ); fade ) );
const idWinding &winding = shards[i]->winding; const idWinding &winding = shards[i]->winding;
@ -916,7 +916,7 @@ void idBrittleFracture::DropFloatingIslands( const idVec3 &point, const idVec3 &
continue; continue;
} }
queueStart = 0; queueStart = 0;
queueEnd = 1; queueEnd = 1;
queue[0] = shards[i]; queue[0] = shards[i];
shards[i]->islandNum = numIslands+1; shards[i]->islandNum = numIslands+1;

View file

@ -63,4 +63,3 @@ private:
void Event_Trigger( idEntity *activator ); void Event_Trigger( idEntity *activator );
}; };

View file

@ -151,8 +151,8 @@ ABSTRACT_DECLARATION( idClass, idEntity )
EVENT( EV_GetMins, idEntity::Event_GetMins) EVENT( EV_GetMins, idEntity::Event_GetMins)
EVENT( EV_GetMaxs, idEntity::Event_GetMaxs ) EVENT( EV_GetMaxs, idEntity::Event_GetMaxs )
EVENT( EV_Touches, idEntity::Event_Touches ) EVENT( EV_Touches, idEntity::Event_Touches )
EVENT( EV_SetGuiParm, idEntity::Event_SetGuiParm ) EVENT( EV_SetGuiParm, idEntity::Event_SetGuiParm )
EVENT( EV_SetGuiFloat, idEntity::Event_SetGuiFloat ) EVENT( EV_SetGuiFloat, idEntity::Event_SetGuiFloat )
EVENT( EV_GetNextKey, idEntity::Event_GetNextKey ) EVENT( EV_GetNextKey, idEntity::Event_GetNextKey )
EVENT( EV_SetKey, idEntity::Event_SetKey ) EVENT( EV_SetKey, idEntity::Event_SetKey )
EVENT( EV_GetKey, idEntity::Event_GetKey ) EVENT( EV_GetKey, idEntity::Event_GetKey )
@ -2337,7 +2337,7 @@ void idEntity::JoinTeam( idEntity *teammember ) {
ent->teamChain->teamMaster = master; ent->teamChain->teamMaster = master;
} }
prev->teamChain = this; prev->teamChain = this;
ent->teamChain = next; ent->teamChain = next;
} }
@ -2867,9 +2867,9 @@ explosions and melee attacks.
============ ============
*/ */
bool idEntity::CanDamage( const idVec3 &origin, idVec3 &damagePoint ) const { bool idEntity::CanDamage( const idVec3 &origin, idVec3 &damagePoint ) const {
idVec3 dest; idVec3 dest;
trace_t tr; trace_t tr;
idVec3 midpoint; idVec3 midpoint;
// use the midpoint of the bounds instead of the origin, because // use the midpoint of the bounds instead of the origin, because
// bmodels may have their origin at 0,0,0 // bmodels may have their origin at 0,0,0
@ -4387,9 +4387,9 @@ void idEntity::Event_RestorePosition( void ) {
if ( spawnArgs.GetMatrix( "rotation", "1 0 0 0 1 0 0 0 1", axis ) ) { if ( spawnArgs.GetMatrix( "rotation", "1 0 0 0 1 0 0 0 1", axis ) ) {
angles = axis.ToAngles(); angles = axis.ToAngles();
} else { } else {
angles[ 0 ] = 0; angles[ 0 ] = 0;
angles[ 1 ] = spawnArgs.GetFloat( "angle" ); angles[ 1 ] = spawnArgs.GetFloat( "angle" );
angles[ 2 ] = 0; angles[ 2 ] = 0;
} }
Teleport( org, angles, NULL ); Teleport( org, angles, NULL );

View file

@ -513,12 +513,12 @@ protected:
private: private:
void Event_GetJointHandle( const char *jointname ); void Event_GetJointHandle( const char *jointname );
void Event_ClearAllJoints( void ); void Event_ClearAllJoints( void );
void Event_ClearJoint( jointHandle_t jointnum ); void Event_ClearJoint( jointHandle_t jointnum );
void Event_SetJointPos( jointHandle_t jointnum, jointModTransform_t transform_type, const idVec3 &pos ); void Event_SetJointPos( jointHandle_t jointnum, jointModTransform_t transform_type, const idVec3 &pos );
void Event_SetJointAngle( jointHandle_t jointnum, jointModTransform_t transform_type, const idAngles &angles ); void Event_SetJointAngle( jointHandle_t jointnum, jointModTransform_t transform_type, const idAngles &angles );
void Event_GetJointPos( jointHandle_t jointnum ); void Event_GetJointPos( jointHandle_t jointnum );
void Event_GetJointAngle( jointHandle_t jointnum ); void Event_GetJointAngle( jointHandle_t jointnum );
}; };
#endif /* !__GAME_ENTITY_H__ */ #endif /* !__GAME_ENTITY_H__ */

View file

@ -43,7 +43,7 @@ const idEventDef EV_Fx_KillFx( "_killfx" );
const idEventDef EV_Fx_Action( "_fxAction", "e" ); // implemented by subclasses const idEventDef EV_Fx_Action( "_fxAction", "e" ); // implemented by subclasses
CLASS_DECLARATION( idEntity, idEntityFx ) CLASS_DECLARATION( idEntity, idEntityFx )
EVENT( EV_Activate, idEntityFx::Event_Trigger ) EVENT( EV_Activate, idEntityFx::Event_Trigger )
EVENT( EV_Fx_KillFx, idEntityFx::Event_ClearFx ) EVENT( EV_Fx_KillFx, idEntityFx::Event_ClearFx )
END_CLASS END_CLASS

View file

@ -239,7 +239,7 @@ public:
// Animation system calls for non-game based skeletal rendering. // Animation system calls for non-game based skeletal rendering.
virtual idRenderModel * ANIM_GetModelFromEntityDef( const char *classname ); virtual idRenderModel * ANIM_GetModelFromEntityDef( const char *classname );
virtual const idVec3 &ANIM_GetModelOffsetFromEntityDef( const char *classname ); virtual const idVec3 &ANIM_GetModelOffsetFromEntityDef( const char *classname );
virtual idRenderModel * ANIM_GetModelFromEntityDef( const idDict *args ); virtual idRenderModel * ANIM_GetModelFromEntityDef( const idDict *args );
virtual idRenderModel * ANIM_GetModelFromName( const char *modelName ); virtual idRenderModel * ANIM_GetModelFromName( const char *modelName );
virtual const idMD5Anim * ANIM_GetAnimFromEntityDef( const char *classname, const char *animname ); virtual const idMD5Anim * ANIM_GetAnimFromEntityDef( const char *classname, const char *animname );

View file

@ -176,7 +176,7 @@ void idDragEntity::Update( idPlayer *player ) {
player->GetViewPos( viewPoint, viewAxis ); player->GetViewPos( viewPoint, viewAxis );
// if no entity selected for dragging // if no entity selected for dragging
if ( !dragEnt.GetEntity() ) { if ( !dragEnt.GetEntity() ) {
if ( player->usercmd.buttons & BUTTON_ATTACK ) { if ( player->usercmd.buttons & BUTTON_ATTACK ) {
@ -470,7 +470,7 @@ idEditEntities::RemoveSelectedEntity
============== ==============
*/ */
void idEditEntities::RemoveSelectedEntity( idEntity *ent ) { void idEditEntities::RemoveSelectedEntity( idEntity *ent ) {
if ( selectedEntities.Find( ent ) ) { if ( selectedEntities.Find( ent ) ) {
selectedEntities.Remove( ent ); selectedEntities.Remove( ent );
} }
} }

View file

@ -2029,7 +2029,7 @@ bool idGameLocal::InPlayerPVS( idEntity *ent ) const {
if ( playerPVS.i == -1 ) { if ( playerPVS.i == -1 ) {
return false; return false;
} }
return pvs.InCurrentPVS( playerPVS, ent->GetPVSAreas(), ent->GetNumPVSAreas() ); return pvs.InCurrentPVS( playerPVS, ent->GetPVSAreas(), ent->GetNumPVSAreas() );
} }
/* /*
@ -2043,7 +2043,7 @@ bool idGameLocal::InPlayerConnectedArea( idEntity *ent ) const {
if ( playerConnectedAreas.i == -1 ) { if ( playerConnectedAreas.i == -1 ) {
return false; return false;
} }
return pvs.InCurrentPVS( playerConnectedAreas, ent->GetPVSAreas(), ent->GetNumPVSAreas() ); return pvs.InCurrentPVS( playerConnectedAreas, ent->GetPVSAreas(), ent->GetNumPVSAreas() );
} }
/* /*
@ -2058,7 +2058,7 @@ void idGameLocal::UpdateGravity( void ) {
if ( g_gravity.GetFloat() == 0.0f ) { if ( g_gravity.GetFloat() == 0.0f ) {
g_gravity.SetFloat( 1.0f ); g_gravity.SetFloat( 1.0f );
} }
gravity.Set( 0, 0, -g_gravity.GetFloat() ); gravity.Set( 0, 0, -g_gravity.GetFloat() );
// update all physics objects // update all physics objects
for( ent = spawnedEntities.Next(); ent != NULL; ent = ent->spawnNode.Next() ) { for( ent = spawnedEntities.Next(); ent != NULL; ent = ent->spawnNode.Next() ) {
@ -3285,7 +3285,7 @@ int idGameLocal::GetTargets( const idDict &args, idList< idEntityPtr<idEntity> >
ent = FindEntity( arg->GetValue() ); ent = FindEntity( arg->GetValue() );
if ( ent ) { if ( ent ) {
idEntityPtr<idEntity> &entityPtr = list.Alloc(); idEntityPtr<idEntity> &entityPtr = list.Alloc();
entityPtr = ent; entityPtr = ent;
} }
} }
} }
@ -3546,7 +3546,7 @@ void idGameLocal::RadiusDamage( const idVec3 &origin, idEntity *inflictor, idEnt
idEntity * entityList[ MAX_GENTITIES ]; idEntity * entityList[ MAX_GENTITIES ];
int numListedEntities; int numListedEntities;
idBounds bounds; idBounds bounds;
idVec3 v, damagePoint, dir; idVec3 v, damagePoint, dir;
int i, e, damage, radius, push; int i, e, damage, radius, push;
const idDict *damageDef = FindEntityDefDict( damageDefName, false ); const idDict *damageDef = FindEntityDefDict( damageDefName, false );
@ -4365,4 +4365,3 @@ idGameLocal::GetMapLoadingGUI
=============== ===============
*/ */
void idGameLocal::GetMapLoadingGUI( char gui[ MAX_STRING_CHARS ] ) { } void idGameLocal::GetMapLoadingGUI( char gui[ MAX_STRING_CHARS ] ) { }

View file

@ -1580,7 +1580,7 @@ bool idGameLocal::DownloadRequest( const char *IP, const char *guid, const char
reply += ";"; reply += ";";
} }
if ( pakList[ i ][ 0 ] == '\0' ) { if ( pakList[ i ][ 0 ] == '\0' ) {
if ( i == 0 ) { if ( i == 0 ) {
// pak 0 will always miss when client doesn't ask for game bin // pak 0 will always miss when client doesn't ask for game bin
common->DPrintf( "no game pak request\n" ); common->DPrintf( "no game pak request\n" );
} else { } else {

View file

@ -729,7 +729,7 @@ void idObjective::Event_Trigger( idEntity *activator ) {
//Pickup( player ); //Pickup( player );
if ( spawnArgs.GetString( "inv_objective", NULL ) ) { if ( spawnArgs.GetString( "inv_objective", NULL ) ) {
if ( player && player->hud ) { if ( player && player->hud ) {
idStr shotName = gameLocal.GetMapName(); idStr shotName = gameLocal.GetMapName();
shotName.StripFileExtension(); shotName.StripFileExtension();
shotName += "/"; shotName += "/";
@ -885,7 +885,7 @@ idMoveableItem::Save
================ ================
*/ */
void idMoveableItem::Save( idSaveGame *savefile ) const { void idMoveableItem::Save( idSaveGame *savefile ) const {
savefile->WriteStaticObject( physicsObj ); savefile->WriteStaticObject( physicsObj );
savefile->WriteClipModel( trigger ); savefile->WriteClipModel( trigger );
@ -1310,7 +1310,7 @@ void idObjectiveComplete::Event_Trigger( idEntity *activator ) {
RemoveItem( player ); RemoveItem( player );
if ( spawnArgs.GetString( "inv_objective", NULL ) ) { if ( spawnArgs.GetString( "inv_objective", NULL ) ) {
if ( player->hud ) { if ( player->hud ) {
player->hud->SetStateString( "objective", "2" ); player->hud->SetStateString( "objective", "2" );
player->hud->SetStateString( "objectivetext", spawnArgs.GetString( "objectivetext" ) ); player->hud->SetStateString( "objectivetext", spawnArgs.GetString( "objectivetext" ) );
player->hud->SetStateString( "objectivetitle", spawnArgs.GetString( "objectivetitle" ) ); player->hud->SetStateString( "objectivetitle", spawnArgs.GetString( "objectivetitle" ) );

View file

@ -123,10 +123,10 @@ void idGameEdit::ParseSpawnArgsToRenderLight( const idDict *args, renderLight_t
idMat3 mat; idMat3 mat;
if ( !args->GetMatrix( "light_rotation", "1 0 0 0 1 0 0 0 1", mat ) ) { if ( !args->GetMatrix( "light_rotation", "1 0 0 0 1 0 0 0 1", mat ) ) {
if ( !args->GetMatrix( "rotation", "1 0 0 0 1 0 0 0 1", mat ) ) { if ( !args->GetMatrix( "rotation", "1 0 0 0 1 0 0 0 1", mat ) ) {
args->GetFloat( "angle", "0", angles[ 1 ] ); args->GetFloat( "angle", "0", angles[ 1 ] );
angles[ 0 ] = 0; angles[ 0 ] = 0;
angles[ 1 ] = idMath::AngleNormalize360( angles[ 1 ] ); angles[ 1 ] = idMath::AngleNormalize360( angles[ 1 ] );
angles[ 2 ] = 0; angles[ 2 ] = 0;
mat = angles.ToMat3(); mat = angles.ToMat3();
} }
} }

View file

@ -2907,8 +2907,8 @@ idPhantomObjects::idPhantomObjects
idPhantomObjects::idPhantomObjects() { idPhantomObjects::idPhantomObjects() {
target = NULL; target = NULL;
end_time = 0; end_time = 0;
throw_time = 0.0f; throw_time = 0.0f;
shake_time = 0.0f; shake_time = 0.0f;
shake_ang.Zero(); shake_ang.Zero();
speed = 0.0f; speed = 0.0f;
min_wait = 0; min_wait = 0;
@ -3037,7 +3037,7 @@ void idPhantomObjects::Event_Activate( idEntity *activator ) {
const idVec3 &toPos = target.GetEntity()->GetEyePosition(); const idVec3 &toPos = target.GetEntity()->GetEyePosition();
// calculate the relative times of all the objects // calculate the relative times of all the objects
time = 0.0f; time = 0.0f;
for( i = 0; i < targetTime.Num(); i++ ) { for( i = 0; i < targetTime.Num(); i++ ) {
targetTime[ i ] = SEC2MS( time ); targetTime[ i ] = SEC2MS( time );

View file

@ -479,7 +479,7 @@ void idMoveable::Event_Activate( idEntity *activator ) {
Show(); Show();
if ( !spawnArgs.GetInt( "notPushable" ) ) { if ( !spawnArgs.GetInt( "notPushable" ) ) {
physicsObj.EnableImpact(); physicsObj.EnableImpact();
} }
physicsObj.Activate(); physicsObj.Activate();

View file

@ -522,7 +522,7 @@ idMover::FindGuiTargets
================ ================
*/ */
void idMover::FindGuiTargets( void ) { void idMover::FindGuiTargets( void ) {
gameLocal.GetTargets( spawnArgs, guiTargets, "guiTarget" ); gameLocal.GetTargets( spawnArgs, guiTargets, "guiTarget" );
} }
/* /*
@ -2418,7 +2418,7 @@ idMover_Binary::SetMoverState
=============== ===============
*/ */
void idMover_Binary::SetMoverState( moverState_t newstate, int time ) { void idMover_Binary::SetMoverState( moverState_t newstate, int time ) {
idVec3 delta; idVec3 delta;
moverState = newstate; moverState = newstate;
move_thread = 0; move_thread = 0;
@ -2880,7 +2880,7 @@ idMover_Binary::FindGuiTargets
================ ================
*/ */
void idMover_Binary::FindGuiTargets( void ) { void idMover_Binary::FindGuiTargets( void ) {
gameLocal.GetTargets( spawnArgs, guiTargets, "guiTarget" ); gameLocal.GetTargets( spawnArgs, guiTargets, "guiTarget" );
} }
/* /*
@ -3877,13 +3877,13 @@ void idDoor::Event_Activate( idEntity *activator ) {
} }
} }
if ( syncLock.Length() ) { if ( syncLock.Length() ) {
idEntity *sync = gameLocal.FindEntity( syncLock ); idEntity *sync = gameLocal.FindEntity( syncLock );
if ( sync && sync->IsType( idDoor::Type ) ) { if ( sync && sync->IsType( idDoor::Type ) ) {
if ( static_cast<idDoor *>( sync )->IsOpen() ) { if ( static_cast<idDoor *>( sync )->IsOpen() ) {
return; return;
} }
} }
} }
ActivateTargets( activator ); ActivateTargets( activator );

View file

@ -2977,7 +2977,7 @@ void idMultiplayerGame::ProcessChatMessage( int clientNum, bool team, const char
const char *prefix = NULL; const char *prefix = NULL;
int send_to; // 0 - all, 1 - specs, 2 - team int send_to; // 0 - all, 1 - specs, 2 - team
int i; int i;
idEntity *ent; idEntity *ent;
idPlayer *p; idPlayer *p;
idStr prefixed_name; idStr prefixed_name;
@ -3407,4 +3407,3 @@ idMultiplayerGame::ClientReadWarmupTime
void idMultiplayerGame::ClientReadWarmupTime( const idBitMsg &msg ) { void idMultiplayerGame::ClientReadWarmupTime( const idBitMsg &msg ) {
warmupEndTime = msg.ReadLong(); warmupEndTime = msg.ReadLong();
} }

View file

@ -368,4 +368,3 @@ ID_INLINE bool idMultiplayerGame::IsInGame( int clientNum ) {
} }
#endif /* !__MULTIPLAYERGAME_H__ */ #endif /* !__MULTIPLAYERGAME_H__ */

View file

@ -226,7 +226,7 @@ void idInventory::GetPersistantData( idDict &dict ) {
// armor // armor
dict.SetInt( "armor", armor ); dict.SetInt( "armor", armor );
// don't bother with powerups, maxhealth, maxarmor, or the clip // don't bother with powerups, maxhealth, maxarmor, or the clip
// ammo // ammo
for( i = 0; i < AMMO_NUMTYPES; i++ ) { for( i = 0; i < AMMO_NUMTYPES; i++ ) {
@ -4045,7 +4045,7 @@ void idPlayer::UpdateWeapon( void ) {
} else if ( ActiveGui() ) { } else if ( ActiveGui() ) {
// gui handling overrides weapon use // gui handling overrides weapon use
Weapon_GUI(); Weapon_GUI();
} else if ( focusCharacter && ( focusCharacter->health > 0 ) ) { } else if ( focusCharacter && ( focusCharacter->health > 0 ) ) {
Weapon_NPC(); Weapon_NPC();
} else { } else {
Weapon_Combat(); Weapon_Combat();
@ -4522,7 +4522,7 @@ void idPlayer::UpdateFocus( void ) {
// clamp the mouse to the corner // clamp the mouse to the corner
ev = sys->GenerateMouseMoveEvent( -2000, -2000 ); ev = sys->GenerateMouseMoveEvent( -2000, -2000 );
command = focusUI->HandleEvent( &ev, gameLocal.time ); command = focusUI->HandleEvent( &ev, gameLocal.time );
HandleGuiCommands( focusGUIent, command ); HandleGuiCommands( focusGUIent, command );
// move to an absolute position // move to an absolute position
ev = sys->GenerateMouseMoveEvent( pt.x * SCREEN_WIDTH, pt.y * SCREEN_HEIGHT ); ev = sys->GenerateMouseMoveEvent( pt.x * SCREEN_WIDTH, pt.y * SCREEN_HEIGHT );
@ -4957,7 +4957,7 @@ void idPlayer::AdjustHeartRate( int target, float timeInSecs, float delay, bool
return; return;
} }
lastHeartAdjust = gameLocal.time; lastHeartAdjust = gameLocal.time;
heartInfo.Init( gameLocal.time + delay * 1000, timeInSecs * 1000, heartRate, target ); heartInfo.Init( gameLocal.time + delay * 1000, timeInSecs * 1000, heartRate, target );
} }
@ -5810,7 +5810,7 @@ void idPlayer::AdjustBodyAngles( void ) {
upBlend = -frac; upBlend = -frac;
} }
animator.CurrentAnim( ANIMCHANNEL_TORSO )->SetSyncedAnimWeight( 0, downBlend ); animator.CurrentAnim( ANIMCHANNEL_TORSO )->SetSyncedAnimWeight( 0, downBlend );
animator.CurrentAnim( ANIMCHANNEL_TORSO )->SetSyncedAnimWeight( 1, forwardBlend ); animator.CurrentAnim( ANIMCHANNEL_TORSO )->SetSyncedAnimWeight( 1, forwardBlend );
animator.CurrentAnim( ANIMCHANNEL_TORSO )->SetSyncedAnimWeight( 2, upBlend ); animator.CurrentAnim( ANIMCHANNEL_TORSO )->SetSyncedAnimWeight( 2, upBlend );
@ -6015,7 +6015,7 @@ void idPlayer::Move( void ) {
if ( AI_JUMP ) { if ( AI_JUMP ) {
// bounce the view weapon // bounce the view weapon
loggedAccel_t *acc = &loggedAccel[currentLoggedAccel&(NUM_LOGGED_ACCELS-1)]; loggedAccel_t *acc = &loggedAccel[currentLoggedAccel&(NUM_LOGGED_ACCELS-1)];
currentLoggedAccel++; currentLoggedAccel++;
acc->time = gameLocal.time; acc->time = gameLocal.time;
acc->dir[2] = 200; acc->dir[2] = 200;
@ -6065,7 +6065,7 @@ void idPlayer::UpdateHud( void ) {
inventory.pickupItemNames.RemoveIndex( 0 ); inventory.pickupItemNames.RemoveIndex( 0 );
if (inventory.nextItemNum == 1 ) { if (inventory.nextItemNum == 1 ) {
inventory.onePickupTime = gameLocal.time; inventory.onePickupTime = gameLocal.time;
} else if ( inventory.nextItemNum > 5 ) { } else if ( inventory.nextItemNum > 5 ) {
inventory.nextItemNum = 1; inventory.nextItemNum = 1;
inventory.nextItemPickup = inventory.onePickupTime + 2000; inventory.nextItemPickup = inventory.onePickupTime + 2000;
} else { } else {
@ -6298,7 +6298,7 @@ void idPlayer::Think( void ) {
// service animations // service animations
if ( !spectating && !af.IsActive() && !gameLocal.inCinematic ) { if ( !spectating && !af.IsActive() && !gameLocal.inCinematic ) {
UpdateConditions(); UpdateConditions();
UpdateAnimState(); UpdateAnimState();
CheckBlink(); CheckBlink();
} }
@ -6368,7 +6368,7 @@ void idPlayer::Think( void ) {
if ( !g_stopTime.GetBool() ) { if ( !g_stopTime.GetBool() ) {
UpdateAnimation(); UpdateAnimation();
Present(); Present();
UpdateDamageEffects(); UpdateDamageEffects();
@ -7847,7 +7847,7 @@ void idPlayer::ClientPredictionThink( void ) {
// service animations // service animations
if ( !spectating && !af.IsActive() ) { if ( !spectating && !af.IsActive() ) {
UpdateConditions(); UpdateConditions();
UpdateAnimState(); UpdateAnimState();
CheckBlink(); CheckBlink();
} }

View file

@ -718,4 +718,3 @@ ID_INLINE void idPlayer::SetSelfSmooth( bool b ) {
} }
#endif /* !__GAME_PLAYER_H__ */ #endif /* !__GAME_PLAYER_H__ */

View file

@ -180,4 +180,3 @@ void idPlayerIcon::UpdateIcon( idPlayer *player, const idVec3 &origin, const idM
renderEnt.axis = axis; renderEnt.axis = axis;
gameRenderWorld->UpdateEntityDef( iconHandle, &renderEnt ); gameRenderWorld->UpdateEntityDef( iconHandle, &renderEnt );
} }

View file

@ -60,4 +60,3 @@ public:
#endif /* !_PLAYERICON_H_ */ #endif /* !_PLAYERICON_H_ */

View file

@ -719,4 +719,3 @@ void idPlayerView::RenderPlayerView( idUserInterface *hud ) {
renderSystem->DrawStretchPic( 10.0f, 380.0f, 64.0f, 64.0f, 0.0f, 0.0f, 1.0f, 1.0f, lagoMaterial ); renderSystem->DrawStretchPic( 10.0f, 380.0f, 64.0f, 64.0f, 0.0f, 0.0f, 1.0f, 1.0f, lagoMaterial );
} }
} }

View file

@ -1419,4 +1419,3 @@ void idPVS::ReadPVS( const pvsHandle_t handle, const idBitMsg &msg ) {
} }
#endif #endif

View file

@ -446,7 +446,7 @@ void idSecurityCamera::StartSweep( void ) {
sweepStart = gameLocal.time; sweepStart = gameLocal.time;
speed = SEC2MS( SweepSpeed() ); speed = SEC2MS( SweepSpeed() );
sweepEnd = sweepStart + speed; sweepEnd = sweepStart + speed;
PostEventMS( &EV_SecurityCam_Pause, speed ); PostEventMS( &EV_SecurityCam_Pause, speed );
StartSound( "snd_moving", SND_CHANNEL_BODY, 0, false, NULL ); StartSound( "snd_moving", SND_CHANNEL_BODY, 0, false, NULL );
} }
@ -463,7 +463,7 @@ void idSecurityCamera::Event_ContinueSweep( void ) {
sweepStart = f; sweepStart = f;
speed = MS2SEC( SweepSpeed() ); speed = MS2SEC( SweepSpeed() );
sweepEnd = sweepStart + speed; sweepEnd = sweepStart + speed;
PostEventMS( &EV_SecurityCam_Pause, speed * (1.0 - pct)); PostEventMS( &EV_SecurityCam_Pause, speed * (1.0 - pct));
StartSound( "snd_moving", SND_CHANNEL_BODY, 0, false, NULL ); StartSound( "snd_moving", SND_CHANNEL_BODY, 0, false, NULL );
SetAlertMode(SCANNING); SetAlertMode(SCANNING);
sweeping = true; sweeping = true;
@ -510,7 +510,7 @@ void idSecurityCamera::Event_Pause( void ) {
sweeping = false; sweeping = false;
StopSound( SND_CHANNEL_ANY, false ); StopSound( SND_CHANNEL_ANY, false );
StartSound( "snd_stop", SND_CHANNEL_BODY, 0, false, NULL ); StartSound( "snd_stop", SND_CHANNEL_BODY, 0, false, NULL );
PostEventSec( &EV_SecurityCam_ReverseSweep, sweepWait ); PostEventSec( &EV_SecurityCam_ReverseSweep, sweepWait );
} }
/* /*

View file

@ -202,7 +202,7 @@ bool idSmokeParticles::EmitSmoke( const idDeclParticle *smoke, const int systemS
} }
// see how many particles we should emit this tic // see how many particles we should emit this tic
// FIXME: smoke.privateStartTime += stage->timeOffset; // FIXME: smoke.privateStartTime += stage->timeOffset;
int finalParticleTime = stage->cycleMsec * stage->spawnBunching; int finalParticleTime = stage->cycleMsec * stage->spawnBunching;
int deltaMsec = gameLocal.time - systemStartTime; int deltaMsec = gameLocal.time - systemStartTime;

View file

@ -302,4 +302,3 @@ idSound::ShowEditingDialog
void idSound::ShowEditingDialog( void ) { void idSound::ShowEditingDialog( void ) {
common->InitTool( EDITOR_SOUND, &spawnArgs ); common->InitTool( EDITOR_SOUND, &spawnArgs );
} }

View file

@ -1762,4 +1762,3 @@ void idTarget_FadeSoundClass::Event_RestoreVolume() {
// restore volume // restore volume
gameSoundWorld->FadeSoundClasses( 0, fadeDB, fadeTime ); gameSoundWorld->FadeSoundClasses( 0, fadeDB, fadeTime );
} }

View file

@ -2276,10 +2276,10 @@ void idWeapon::ReadFromSnapshot( const idBitMsgDelta &msg ) {
idealState = "Fire"; idealState = "Fire";
} }
// immediately switch back to idle // immediately switch back to idle
if ( WEAPON_NETFIRING && !isFiring ) { if ( WEAPON_NETFIRING && !isFiring ) {
idealState = "Idle"; idealState = "Idle";
} }
WEAPON_NETFIRING = isFiring; WEAPON_NETFIRING = isFiring;
} }

View file

@ -255,7 +255,7 @@ private:
bool isFiring; bool isFiring;
// zoom // zoom
int zoomFov; // variable zoom fov per weapon int zoomFov; // variable zoom fov per weapon
// joints from models // joints from models
jointHandle_t barrelJointView; jointHandle_t barrelJointView;

View file

@ -2081,7 +2081,7 @@ bool idAI::StepDirection( float dir ) {
if ( z <= ceilingPos.z ) { if ( z <= ceilingPos.z ) {
start.x = org.x; start.x = org.x;
start.y = org.y; start.y = org.y;
start.z = z; start.z = z;
} else { } else {
start = ceilingPos; start = ceilingPos;
} }
@ -2168,7 +2168,7 @@ bool idAI::NewWanderDir( const idVec3 &dest ) {
if ( gameLocal.random.RandomInt() & 1 ) { if ( gameLocal.random.RandomInt() & 1 ) {
for( tdir = 0; tdir <= 315; tdir += 45 ) { for( tdir = 0; tdir <= 315; tdir += 45 ) {
if ( tdir != turnaround && StepDirection( tdir ) ) { if ( tdir != turnaround && StepDirection( tdir ) ) {
return true; return true;
} }
} }
} else { } else {
@ -2876,9 +2876,9 @@ idAI::AdjustFlyingAngles
*/ */
void idAI::AdjustFlyingAngles( void ) { void idAI::AdjustFlyingAngles( void ) {
idVec3 vel; idVec3 vel;
float speed; float speed;
float roll; float roll;
float pitch; float pitch;
vel = physicsObj.GetLinearVelocity(); vel = physicsObj.GetLinearVelocity();
@ -3519,7 +3519,7 @@ void idAI::Activate( idEntity *activator ) {
// update the script in cinematics so that entities don't start anims or show themselves a frame late. // update the script in cinematics so that entities don't start anims or show themselves a frame late.
if ( cinematic ) { if ( cinematic ) {
UpdateAIScript(); UpdateAIScript();
// make sure our model gets updated // make sure our model gets updated
animator.ForceUpdate(); animator.ForceUpdate();
@ -4716,10 +4716,10 @@ bool idAI::UpdateAnimationControllers( void ) {
idVec3 focusPos; idVec3 focusPos;
idQuat jawQuat; idQuat jawQuat;
idVec3 left; idVec3 left;
idVec3 dir; idVec3 dir;
idVec3 orientationJointPos; idVec3 orientationJointPos;
idVec3 localDir; idVec3 localDir;
idAngles newLookAng; idAngles newLookAng;
idAngles diff; idAngles diff;
idMat3 mat; idMat3 mat;
idMat3 axis; idMat3 axis;
@ -4774,7 +4774,7 @@ bool idAI::UpdateAnimationControllers( void ) {
idEntity *focusEnt = focusEntity.GetEntity(); idEntity *focusEnt = focusEntity.GetEntity();
if ( !allowJointMod || !allowEyeFocus || ( gameLocal.time >= focusTime ) ) { if ( !allowJointMod || !allowEyeFocus || ( gameLocal.time >= focusTime ) ) {
focusPos = GetEyePosition() + orientationJointAxis[ 0 ] * 512.0f; focusPos = GetEyePosition() + orientationJointAxis[ 0 ] * 512.0f;
} else if ( focusEnt == NULL ) { } else if ( focusEnt == NULL ) {
// keep looking at last position until focusTime is up // keep looking at last position until focusTime is up
focusPos = currentFocusPos; focusPos = currentFocusPos;

View file

@ -653,8 +653,8 @@ protected:
void Event_AllowHiddenMovement( int enable ); void Event_AllowHiddenMovement( int enable );
void Event_TriggerParticles( const char *jointName ); void Event_TriggerParticles( const char *jointName );
void Event_FindActorsInBounds( const idVec3 &mins, const idVec3 &maxs ); void Event_FindActorsInBounds( const idVec3 &mins, const idVec3 &maxs );
void Event_CanReachPosition( const idVec3 &pos ); void Event_CanReachPosition( const idVec3 &pos );
void Event_CanReachEntity( idEntity *ent ); void Event_CanReachEntity( idEntity *ent );
void Event_CanReachEnemy( void ); void Event_CanReachEnemy( void );
void Event_GetReachableEntityPosition( idEntity *ent ); void Event_GetReachableEntityPosition( idEntity *ent );
}; };

View file

@ -111,7 +111,7 @@ void idAI_Vagary::Event_ChooseObjectToThrow( const idVec3 &mins, const idVec3 &m
if ( PredictTrajectory( entPhys->GetOrigin() + offsetVec, enemyEyePos, speed, entPhys->GetGravity(), if ( PredictTrajectory( entPhys->GetOrigin() + offsetVec, enemyEyePos, speed, entPhys->GetGravity(),
entPhys->GetClipModel(), entPhys->GetClipMask(), MAX_WORLD_SIZE, NULL, enemyEnt, ai_debugTrajectory.GetBool() ? 4000 : 0, vel ) ) { entPhys->GetClipModel(), entPhys->GetClipMask(), MAX_WORLD_SIZE, NULL, enemyEnt, ai_debugTrajectory.GetBool() ? 4000 : 0, vel ) ) {
idThread::ReturnEntity( ent ); idThread::ReturnEntity( ent );
return; return;
} }
} }

View file

@ -1704,7 +1704,7 @@ void idAI::Event_TestAnimMoveTowardEnemy( const char *animname ) {
} }
delta = enemyEnt->GetPhysics()->GetOrigin() - physicsObj.GetOrigin(); delta = enemyEnt->GetPhysics()->GetOrigin() - physicsObj.GetOrigin();
yaw = delta.ToYaw(); yaw = delta.ToYaw();
moveVec = animator.TotalMovementDelta( anim ) * idAngles( 0.0f, yaw, 0.0f ).ToMat3() * physicsObj.GetGravityAxis(); moveVec = animator.TotalMovementDelta( anim ) * idAngles( 0.0f, yaw, 0.0f ).ToMat3() * physicsObj.GetGravityAxis();
idAI::PredictPath( this, aas, physicsObj.GetOrigin(), moveVec, 1000, 1000, ( move.moveType == MOVETYPE_FLY ) ? SE_BLOCKED : ( SE_ENTER_OBSTACLE | SE_BLOCKED | SE_ENTER_LEDGE_AREA ), path ); idAI::PredictPath( this, aas, physicsObj.GetOrigin(), moveVec, 1000, 1000, ( move.moveType == MOVETYPE_FLY ) ? SE_BLOCKED : ( SE_ENTER_OBSTACLE | SE_BLOCKED | SE_ENTER_LEDGE_AREA ), path );

View file

@ -52,10 +52,10 @@ If you have questions concerning this license or the applicable additional terms
const float MAX_OBSTACLE_RADIUS = 256.0f; const float MAX_OBSTACLE_RADIUS = 256.0f;
const float PUSH_OUTSIDE_OBSTACLES = 0.5f; const float PUSH_OUTSIDE_OBSTACLES = 0.5f;
const float CLIP_BOUNDS_EPSILON = 10.0f; const float CLIP_BOUNDS_EPSILON = 10.0f;
const int MAX_AAS_WALL_EDGES = 256; const int MAX_AAS_WALL_EDGES = 256;
const int MAX_OBSTACLES = 256; const int MAX_OBSTACLES = 256;
const int MAX_PATH_NODES = 256; const int MAX_PATH_NODES = 256;
const int MAX_OBSTACLE_PATH = 64; const int MAX_OBSTACLE_PATH = 64;
typedef struct obstacle_s { typedef struct obstacle_s {
idVec2 bounds[2]; idVec2 bounds[2];
@ -425,7 +425,7 @@ int GetObstacles( const idPhysics *physics, const idAAS *aas, const idEntity *ig
lastEdgeNormal.Zero(); lastEdgeNormal.Zero();
nextVerts[0] = nextVerts[1] = 0; nextVerts[0] = nextVerts[1] = 0;
for ( i = 0; i < numWallEdges && numObstacles < MAX_OBSTACLES; i++ ) { for ( i = 0; i < numWallEdges && numObstacles < MAX_OBSTACLES; i++ ) {
aas->GetEdge( wallEdges[i], start, end ); aas->GetEdge( wallEdges[i], start, end );
aas->GetEdgeVertexNumbers( wallEdges[i], verts ); aas->GetEdgeVertexNumbers( wallEdges[i], verts );
edgeDir = end.ToVec2() - start.ToVec2(); edgeDir = end.ToVec2() - start.ToVec2();
edgeDir.Normalize(); edgeDir.Normalize();

View file

@ -1106,7 +1106,7 @@ void idAnimBlend::Reset( const idDeclModelDef *_modelDef ) {
blendStartValue = 0.0f; blendStartValue = 0.0f;
blendEndValue = 0.0f; blendEndValue = 0.0f;
blendStartTime = 0; blendStartTime = 0;
blendDuration = 0; blendDuration = 0;
} }
@ -1206,7 +1206,7 @@ idAnimBlend::SetWeight
void idAnimBlend::SetWeight( float newweight, int currentTime, int blendTime ) { void idAnimBlend::SetWeight( float newweight, int currentTime, int blendTime ) {
blendStartValue = GetWeight( currentTime ); blendStartValue = GetWeight( currentTime );
blendEndValue = newweight; blendEndValue = newweight;
blendStartTime = currentTime - 1; blendStartTime = currentTime - 1;
blendDuration = blendTime; blendDuration = blendTime;
if ( !newweight ) { if ( !newweight ) {
@ -1832,7 +1832,7 @@ bool idAnimBlend::BlendAnim( int currentTime, int channel, int numJoints, idJoin
blendFrame[j].q = jointFrame[j].q; blendFrame[j].q = jointFrame[j].q;
} }
} }
} else { } else {
blendWeight += weight; blendWeight += weight;
lerp = weight / blendWeight; lerp = weight / blendWeight;
SIMDProcessor->BlendJoints( blendFrame, jointFrame, lerp, modelDef->GetChannelJoints( channel ), modelDef->NumJointsOnChannel( channel ) ); SIMDProcessor->BlendJoints( blendFrame, jointFrame, lerp, modelDef->GetChannelJoints( channel ), modelDef->NumJointsOnChannel( channel ) );
@ -3548,7 +3548,7 @@ void idAnimator::SyncAnimChannels( int channelNum, int fromChannelNum, int curre
toBlend.blendStartValue = 0.0f; toBlend.blendStartValue = 0.0f;
toBlend.blendEndValue = 0.0f; toBlend.blendEndValue = 0.0f;
} }
toBlend.SetWeight( weight, currentTime - 1, blendTime ); toBlend.SetWeight( weight, currentTime - 1, blendTime );
// disable framecommands on the current channel so that commands aren't called twice // disable framecommands on the current channel so that commands aren't called twice
toBlend.AllowFrameCommands( false ); toBlend.AllowFrameCommands( false );
@ -4204,7 +4204,7 @@ bool idAnimator::CreateFrame( int currentTime, bool force ) {
if ( entity && ( ( g_debugAnim.GetInteger() == entity->entityNumber ) || ( g_debugAnim.GetInteger() == -2 ) ) ) { if ( entity && ( ( g_debugAnim.GetInteger() == entity->entityNumber ) || ( g_debugAnim.GetInteger() == -2 ) ) ) {
debugInfo = true; debugInfo = true;
gameLocal.Printf( "---------------\n%d: entity '%s':\n", gameLocal.time, entity->GetName() ); gameLocal.Printf( "---------------\n%d: entity '%s':\n", gameLocal.time, entity->GetName() );
gameLocal.Printf( "model '%s':\n", modelDef->GetModelName() ); gameLocal.Printf( "model '%s':\n", modelDef->GetModelName() );
} else { } else {
debugInfo = false; debugInfo = false;
} }
@ -4953,7 +4953,7 @@ idRenderModel *idGameEdit::ANIM_CreateMeshForAnim( idRenderModel *model, const c
const idDict *args; const idDict *args;
const char *temp; const char *temp;
idRenderModel *newmodel; idRenderModel *newmodel;
const idMD5Anim *md5anim; const idMD5Anim *md5anim;
idStr filename; idStr filename;
idStr extension; idStr extension;
const idAnim *anim; const idAnim *anim;

View file

@ -409,7 +409,7 @@ int idModelExport::ParseExportSection( idParser &parser ) {
return 0; return 0;
} }
parser.ReadToken( &token ); parser.ReadToken( &token );
if ( token.Icmp( g_exportMask.GetString() ) ) { if ( token.Icmp( g_exportMask.GetString() ) ) {
parser.SkipBracedSection(); parser.SkipBracedSection();
return 0; return 0;

View file

@ -414,7 +414,7 @@ void idTestModel::NextAnim( const idCmdArgs &args ) {
headAnim = 0; headAnim = 0;
if ( headAnimator ) { if ( headAnimator ) {
headAnimator->ClearAllAnims( gameLocal.time, 0 ); headAnimator->ClearAllAnims( gameLocal.time, 0 );
headAnim = headAnimator->GetAnim( animname ); headAnim = headAnimator->GetAnim( animname );
if ( !headAnim ) { if ( !headAnim ) {
headAnim = headAnimator->GetAnim( "idle" ); headAnim = headAnimator->GetAnim( "idle" );
} }
@ -456,7 +456,7 @@ void idTestModel::PrevAnim( const idCmdArgs &args ) {
headAnim = 0; headAnim = 0;
if ( headAnimator ) { if ( headAnimator ) {
headAnimator->ClearAllAnims( gameLocal.time, 0 ); headAnimator->ClearAllAnims( gameLocal.time, 0 );
headAnim = headAnimator->GetAnim( animname ); headAnim = headAnimator->GetAnim( animname );
if ( !headAnim ) { if ( !headAnim ) {
headAnim = headAnimator->GetAnim( "idle" ); headAnim = headAnimator->GetAnim( "idle" );
} }
@ -565,7 +565,7 @@ void idTestModel::TestAnim( const idCmdArgs &args ) {
headAnim = 0; headAnim = 0;
if ( headAnimator ) { if ( headAnimator ) {
headAnimator->ClearAllAnims( gameLocal.time, 0 ); headAnimator->ClearAllAnims( gameLocal.time, 0 );
headAnim = headAnimator->GetAnim( animname ); headAnim = headAnimator->GetAnim( animname );
if ( !headAnim ) { if ( !headAnim ) {
headAnim = headAnimator->GetAnim( "idle" ); headAnim = headAnimator->GetAnim( "idle" );
if ( !headAnim ) { if ( !headAnim ) {

View file

@ -58,19 +58,19 @@ public:
void TestAnim( const idCmdArgs &args ); void TestAnim( const idCmdArgs &args );
void BlendAnim( const idCmdArgs &args ); void BlendAnim( const idCmdArgs &args );
static void KeepTestModel_f( const idCmdArgs &args ); static void KeepTestModel_f( const idCmdArgs &args );
static void TestModel_f( const idCmdArgs &args ); static void TestModel_f( const idCmdArgs &args );
static void ArgCompletion_TestModel( const idCmdArgs &args, void(*callback)( const char *s ) ); static void ArgCompletion_TestModel( const idCmdArgs &args, void(*callback)( const char *s ) );
static void TestSkin_f( const idCmdArgs &args ); static void TestSkin_f( const idCmdArgs &args );
static void TestShaderParm_f( const idCmdArgs &args ); static void TestShaderParm_f( const idCmdArgs &args );
static void TestParticleStopTime_f( const idCmdArgs &args ); static void TestParticleStopTime_f( const idCmdArgs &args );
static void TestAnim_f( const idCmdArgs &args ); static void TestAnim_f( const idCmdArgs &args );
static void ArgCompletion_TestAnim( const idCmdArgs &args, void(*callback)( const char *s ) ); static void ArgCompletion_TestAnim( const idCmdArgs &args, void(*callback)( const char *s ) );
static void TestBlend_f( const idCmdArgs &args ); static void TestBlend_f( const idCmdArgs &args );
static void TestModelNextAnim_f( const idCmdArgs &args ); static void TestModelNextAnim_f( const idCmdArgs &args );
static void TestModelPrevAnim_f( const idCmdArgs &args ); static void TestModelPrevAnim_f( const idCmdArgs &args );
static void TestModelNextFrame_f( const idCmdArgs &args ); static void TestModelNextFrame_f( const idCmdArgs &args );
static void TestModelPrevFrame_f( const idCmdArgs &args ); static void TestModelPrevFrame_f( const idCmdArgs &args );
private: private:
idEntityPtr<idEntity> head; idEntityPtr<idEntity> head;

Some files were not shown because too many files have changed in this diff Show more