diff --git a/d3xp/Entity.cpp b/d3xp/Entity.cpp index 88692a4..143ce71 100644 --- a/d3xp/Entity.cpp +++ b/d3xp/Entity.cpp @@ -1689,7 +1689,7 @@ bool idEntity::StartSoundShader( const idSoundShader *shader, const s_channelTyp msg.Init( msgBuf, sizeof( msgBuf ) ); msg.BeginWriting(); - msg.WriteLong( gameLocal.ServerRemapDecl( -1, DECL_SOUND, shader->Index() ) ); + msg.WriteInt( gameLocal.ServerRemapDecl( -1, DECL_SOUND, shader->Index() ) ); msg.WriteByte( channel ); ServerSendEvent( EVENT_STARTSOUNDSHADER, &msg, false, -1 ); } @@ -4834,7 +4834,7 @@ void idEntity::WriteColorToSnapshot( idBitMsgDelta &msg ) const { color[1] = renderEntity.shaderParms[ SHADERPARM_GREEN ]; color[2] = renderEntity.shaderParms[ SHADERPARM_BLUE ]; color[3] = renderEntity.shaderParms[ SHADERPARM_ALPHA ]; - msg.WriteLong( PackColor( color ) ); + msg.WriteInt( PackColor( color ) ); } /* @@ -4925,7 +4925,7 @@ void idEntity::ServerSendEvent( int eventId, const idBitMsg *msg, bool saveEvent outMsg.WriteByte( GAME_RELIABLE_MESSAGE_EVENT ); outMsg.WriteBits( gameLocal.GetSpawnId( this ), 32 ); outMsg.WriteByte( eventId ); - outMsg.WriteLong( gameLocal.time ); + outMsg.WriteInt( gameLocal.time ); if ( msg ) { outMsg.WriteBits( msg->GetSize(), idMath::BitsForInteger( MAX_EVENT_PARAM_SIZE ) ); outMsg.WriteData( msg->GetData(), msg->GetSize() ); @@ -4967,7 +4967,7 @@ void idEntity::ClientSendEvent( int eventId, const idBitMsg *msg ) const { outMsg.WriteByte( GAME_RELIABLE_MESSAGE_EVENT ); outMsg.WriteBits( gameLocal.GetSpawnId( this ), 32 ); outMsg.WriteByte( eventId ); - outMsg.WriteLong( gameLocal.time ); + outMsg.WriteInt( gameLocal.time ); if ( msg ) { outMsg.WriteBits( msg->GetSize(), idMath::BitsForInteger( MAX_EVENT_PARAM_SIZE ) ); outMsg.WriteData( msg->GetData(), msg->GetSize() ); @@ -5348,8 +5348,8 @@ void idAnimatedEntity::AddDamageEffect( const trace_t &collision, const idVec3 & msg.WriteFloat( localOrigin[2] ); msg.WriteDir( localNormal, 24 ); msg.WriteDir( localDir, 24 ); - msg.WriteLong( gameLocal.ServerRemapDecl( -1, DECL_ENTITYDEF, def->Index() ) ); - msg.WriteLong( gameLocal.ServerRemapDecl( -1, DECL_MATERIAL, collision.c.material->Index() ) ); + msg.WriteInt( gameLocal.ServerRemapDecl( -1, DECL_ENTITYDEF, def->Index() ) ); + msg.WriteInt( gameLocal.ServerRemapDecl( -1, DECL_MATERIAL, collision.c.material->Index() ) ); ServerSendEvent( EVENT_ADD_DAMAGE_EFFECT, &msg, false, -1 ); } } diff --git a/d3xp/Fx.cpp b/d3xp/Fx.cpp index d61fdf6..b57116f 100644 --- a/d3xp/Fx.cpp +++ b/d3xp/Fx.cpp @@ -754,8 +754,8 @@ idEntityFx::WriteToSnapshot void idEntityFx::WriteToSnapshot( idBitMsgDelta &msg ) const { GetPhysics()->WriteToSnapshot( msg ); WriteBindToSnapshot( msg ); - msg.WriteLong( ( fxEffect != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_FX, fxEffect->Index() ) : -1 ); - msg.WriteLong( started ); + msg.WriteInt( ( fxEffect != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_FX, fxEffect->Index() ) : -1 ); + msg.WriteInt( started ); } /* diff --git a/d3xp/Game_local.cpp b/d3xp/Game_local.cpp index cd36bdf..f1252d2 100644 --- a/d3xp/Game_local.cpp +++ b/d3xp/Game_local.cpp @@ -4373,7 +4373,7 @@ void idGameLocal::SetPortalState( qhandle_t portal, int blockingBits ) { if ( !gameLocal.isClient ) { outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_PORTAL ); - outMsg.WriteLong( portal ); + outMsg.WriteInt( portal ); outMsg.WriteBits( blockingBits, NUM_RENDER_PORTAL_BITS ); networkSystem->ServerSendReliableMessage( -1, outMsg ); } diff --git a/d3xp/Game_network.cpp b/d3xp/Game_network.cpp index d65be3d..6895a2f 100644 --- a/d3xp/Game_network.cpp +++ b/d3xp/Game_network.cpp @@ -183,7 +183,7 @@ void idGameLocal::ServerSendDeclRemapToClient( int clientNum, declType_t type, i outMsg.BeginWriting(); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_REMAP_DECL ); outMsg.WriteByte( type ); - outMsg.WriteLong( index ); + outMsg.WriteInt( index ); outMsg.WriteString( decl->GetName() ); networkSystem->ServerSendReliableMessage( clientNum, outMsg ); } @@ -333,7 +333,7 @@ void idGameLocal::ServerClientBegin( int clientNum ) { outMsg.BeginWriting(); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_SPAWN_PLAYER ); outMsg.WriteByte( clientNum ); - outMsg.WriteLong( spawnIds[ clientNum ] ); + outMsg.WriteInt( spawnIds[ clientNum ] ); networkSystem->ServerSendReliableMessage( -1, outMsg ); } @@ -396,7 +396,7 @@ void idGameLocal::ServerWriteInitialReliableMessages( int clientNum ) { outMsg.BeginWriting( ); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_SPAWN_PLAYER ); outMsg.WriteByte( i ); - outMsg.WriteLong( spawnIds[ i ] ); + outMsg.WriteInt( spawnIds[ i ] ); networkSystem->ServerSendReliableMessage( clientNum, outMsg ); } @@ -407,7 +407,7 @@ void idGameLocal::ServerWriteInitialReliableMessages( int clientNum ) { outMsg.WriteByte( GAME_RELIABLE_MESSAGE_EVENT ); outMsg.WriteBits( event->spawnId, 32 ); outMsg.WriteByte( event->event ); - outMsg.WriteLong( event->time ); + outMsg.WriteInt( event->time ); outMsg.WriteBits( event->paramsSize, idMath::BitsForInteger( MAX_EVENT_PARAM_SIZE ) ); if ( event->paramsSize ) { outMsg.WriteData( event->paramsBuf, event->paramsSize ); @@ -421,7 +421,7 @@ void idGameLocal::ServerWriteInitialReliableMessages( int clientNum ) { outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.BeginWriting(); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_PORTALSTATES ); - outMsg.WriteLong( numPortals ); + outMsg.WriteInt( numPortals ); for ( i = 0; i < numPortals; i++ ) { outMsg.WriteBits( gameRenderWorld->GetPortalState( (qhandle_t) (i+1) ) , NUM_RENDER_PORTAL_BITS ); } @@ -606,7 +606,7 @@ void idGameLocal::ServerWriteSnapshot( int clientNum, int sequence, idBitMsg &ms #if ASYNC_WRITE_TAGS idRandom tagRandom; tagRandom.SetSeed( random.RandomInt() ); - msg.WriteLong( tagRandom.GetSeed() ); + msg.WriteInt( tagRandom.GetSeed() ); #endif // create the snapshot @@ -657,7 +657,7 @@ void idGameLocal::ServerWriteSnapshot( int clientNum, int sequence, idBitMsg &ms snapshot->firstEntityState = newBase; #if ASYNC_WRITE_TAGS - msg.WriteLong( tagRandom.RandomInt() ); + msg.WriteInt( tagRandom.RandomInt() ); #endif } } @@ -668,9 +668,9 @@ void idGameLocal::ServerWriteSnapshot( int clientNum, int sequence, idBitMsg &ms #if ASYNC_WRITE_PVS for ( i = 0; i < idEntity::MAX_PVS_AREAS; i++ ) { if ( i < numSourceAreas ) { - msg.WriteLong( sourceAreas[ i ] ); + msg.WriteInt( sourceAreas[ i ] ); } else { - msg.WriteLong( 0 ); + msg.WriteInt( 0 ); } } gameLocal.pvs.WritePVS( pvsHandle, msg ); diff --git a/d3xp/Light.cpp b/d3xp/Light.cpp index a937c8b..5f10a70 100644 --- a/d3xp/Light.cpp +++ b/d3xp/Light.cpp @@ -1055,14 +1055,14 @@ void idLight::WriteToSnapshot( idBitMsgDelta &msg ) const { WriteBindToSnapshot( msg ); msg.WriteByte( currentLevel ); - msg.WriteLong( PackColor( baseColor ) ); + msg.WriteInt( PackColor( baseColor ) ); // msg.WriteBits( lightParent.GetEntityNum(), GENTITYNUM_BITS ); /* // only helps prediction - msg.WriteLong( PackColor( fadeFrom ) ); - msg.WriteLong( PackColor( fadeTo ) ); - msg.WriteLong( fadeStart ); - msg.WriteLong( fadeEnd ); + msg.WriteInt( PackColor( fadeFrom ) ); + msg.WriteInt( PackColor( fadeTo ) ); + msg.WriteInt( fadeStart ); + msg.WriteInt( fadeEnd ); */ // FIXME: send renderLight.shader @@ -1070,13 +1070,13 @@ void idLight::WriteToSnapshot( idBitMsgDelta &msg ) const { msg.WriteFloat( renderLight.lightRadius[1], 5, 10 ); msg.WriteFloat( renderLight.lightRadius[2], 5, 10 ); - msg.WriteLong( PackColor( idVec4( renderLight.shaderParms[SHADERPARM_RED], + msg.WriteInt( PackColor( idVec4( renderLight.shaderParms[SHADERPARM_RED], renderLight.shaderParms[SHADERPARM_GREEN], renderLight.shaderParms[SHADERPARM_BLUE], renderLight.shaderParms[SHADERPARM_ALPHA] ) ) ); msg.WriteFloat( renderLight.shaderParms[SHADERPARM_TIMESCALE], 5, 10 ); - msg.WriteLong( renderLight.shaderParms[SHADERPARM_TIMEOFFSET] ); + msg.WriteInt( renderLight.shaderParms[SHADERPARM_TIMEOFFSET] ); //msg.WriteByte( renderLight.shaderParms[SHADERPARM_DIVERSITY] ); msg.WriteShort( renderLight.shaderParms[SHADERPARM_MODE] ); diff --git a/d3xp/Moveable.cpp b/d3xp/Moveable.cpp index f771ece..b5f95d2 100644 --- a/d3xp/Moveable.cpp +++ b/d3xp/Moveable.cpp @@ -1157,7 +1157,7 @@ void idExplodingBarrel::Killed( idEntity *inflictor, idEntity *attacker, int dam byte msgBuf[MAX_EVENT_PARAM_SIZE]; msg.Init( msgBuf, sizeof( msgBuf ) ); - msg.WriteLong( gameLocal.time ); + msg.WriteInt( gameLocal.time ); ServerSendEvent( EVENT_EXPLODE, &msg, false, -1 ); } } diff --git a/d3xp/MultiplayerGame.cpp b/d3xp/MultiplayerGame.cpp index c199ff3..d0368ec 100644 --- a/d3xp/MultiplayerGame.cpp +++ b/d3xp/MultiplayerGame.cpp @@ -1500,7 +1500,7 @@ void idMultiplayerGame::NewState( gameState_t news, idPlayer *player ) { outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_WARMUPTIME ); - outMsg.WriteLong( warmupEndTime ); + outMsg.WriteInt( warmupEndTime ); networkSystem->ServerSendReliableMessage( -1, outMsg ); break; @@ -2789,7 +2789,7 @@ void idMultiplayerGame::PlayGlobalSound( int to, snd_evt_t evt, const char *shad return; } outMsg.WriteByte( GAME_RELIABLE_MESSAGE_SOUND_INDEX ); - outMsg.WriteLong( gameLocal.ServerRemapDecl( to, DECL_SOUND, shaderDecl->Index() ) ); + outMsg.WriteInt( gameLocal.ServerRemapDecl( to, DECL_SOUND, shaderDecl->Index() ) ); } else { outMsg.WriteByte( GAME_RELIABLE_MESSAGE_SOUND_EVENT ); outMsg.WriteByte( evt ); @@ -4018,7 +4018,7 @@ void idMultiplayerGame::VoiceChat( const idCmdArgs &args, bool team ) { outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_VCHAT ); - outMsg.WriteLong( index ); + outMsg.WriteInt( index ); outMsg.WriteBits( team ? 1 : 0, 1 ); networkSystem->ClientSendReliableMessage( outMsg ); } @@ -4083,7 +4083,7 @@ void idMultiplayerGame::ServerWriteInitialReliableMessages( int clientNum ) { outMsg.WriteByte( GAME_RELIABLE_MESSAGE_STARTSTATE ); // send the game state and start time outMsg.WriteByte( gameState ); - outMsg.WriteLong( matchStartedTime ); + outMsg.WriteInt( matchStartedTime ); outMsg.WriteShort( startFragLimit ); // send the powerup states and the spectate states for( i = 0; i < gameLocal.numClients; i++ ) { @@ -4107,7 +4107,7 @@ void idMultiplayerGame::ServerWriteInitialReliableMessages( int clientNum ) { if ( gameState == COUNTDOWN ) { outMsg.BeginWriting(); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_WARMUPTIME ); - outMsg.WriteLong( warmupEndTime ); + outMsg.WriteInt( warmupEndTime ); networkSystem->ServerSendReliableMessage( clientNum, outMsg ); } } diff --git a/d3xp/Player.cpp b/d3xp/Player.cpp index ae217f6..c4f110f 100644 --- a/d3xp/Player.cpp +++ b/d3xp/Player.cpp @@ -9701,10 +9701,10 @@ void idPlayer::WritePlayerStateToSnapshot( idBitMsgDelta &msg ) const { int i; msg.WriteByte( bobCycle ); - msg.WriteLong( stepUpTime ); + msg.WriteInt( stepUpTime ); msg.WriteFloat( stepUpDelta ); #ifdef _D3XP - msg.WriteLong( inventory.weapons ); + msg.WriteInt( inventory.weapons ); #else msg.WriteShort( inventory.weapons ); #endif diff --git a/d3xp/Projectile.cpp b/d3xp/Projectile.cpp index 6e53ce3..935323d 100644 --- a/d3xp/Projectile.cpp +++ b/d3xp/Projectile.cpp @@ -718,7 +718,7 @@ void idProjectile::AddDefaultDamageEffect( const trace_t &collision, const idVec msg.WriteFloat( collision.c.point[1] ); msg.WriteFloat( collision.c.point[2] ); msg.WriteDir( collision.c.normal, 24 ); - msg.WriteLong( ( collision.c.material != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_MATERIAL, collision.c.material->Index() ) : -1 ); + msg.WriteInt( ( collision.c.material != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_MATERIAL, collision.c.material->Index() ) : -1 ); msg.WriteFloat( velocity[0], 5, 10 ); msg.WriteFloat( velocity[1], 5, 10 ); msg.WriteFloat( velocity[2], 5, 10 ); diff --git a/d3xp/Weapon.cpp b/d3xp/Weapon.cpp index 79a246f..802b7f8 100644 --- a/d3xp/Weapon.cpp +++ b/d3xp/Weapon.cpp @@ -3154,7 +3154,7 @@ void idWeapon::Event_SetSkin( const char *skinname ) { byte msgBuf[MAX_EVENT_PARAM_SIZE]; msg.Init( msgBuf, sizeof( msgBuf ) ); - msg.WriteLong( ( skinDecl != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_SKIN, skinDecl->Index() ) : -1 ); + msg.WriteInt( ( skinDecl != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_SKIN, skinDecl->Index() ) : -1 ); ServerSendEvent( EVENT_CHANGESKIN, &msg, false, -1 ); } } diff --git a/d3xp/physics/Physics_AF.cpp b/d3xp/physics/Physics_AF.cpp index 23e8c46..2aea5e4 100644 --- a/d3xp/physics/Physics_AF.cpp +++ b/d3xp/physics/Physics_AF.cpp @@ -7925,7 +7925,7 @@ void idPhysics_AF::WriteToSnapshot( idBitMsgDelta &msg ) const { int i; idCQuat quat; - msg.WriteLong( current.atRest ); + msg.WriteInt( current.atRest ); msg.WriteFloat( current.noMoveTime ); msg.WriteFloat( current.activateTime ); msg.WriteDeltaFloat( 0.0f, current.pushVelocity[0], AF_VELOCITY_EXPONENT_BITS, AF_VELOCITY_MANTISSA_BITS ); diff --git a/d3xp/physics/Physics_Monster.cpp b/d3xp/physics/Physics_Monster.cpp index 1e48b7f..f3a1606 100644 --- a/d3xp/physics/Physics_Monster.cpp +++ b/d3xp/physics/Physics_Monster.cpp @@ -780,7 +780,7 @@ void idPhysics_Monster::WriteToSnapshot( idBitMsgDelta &msg ) const { msg.WriteDeltaFloat( 0.0f, current.pushVelocity[0], MONSTER_VELOCITY_EXPONENT_BITS, MONSTER_VELOCITY_MANTISSA_BITS ); msg.WriteDeltaFloat( 0.0f, current.pushVelocity[1], MONSTER_VELOCITY_EXPONENT_BITS, MONSTER_VELOCITY_MANTISSA_BITS ); msg.WriteDeltaFloat( 0.0f, current.pushVelocity[2], MONSTER_VELOCITY_EXPONENT_BITS, MONSTER_VELOCITY_MANTISSA_BITS ); - msg.WriteLong( current.atRest ); + msg.WriteInt( current.atRest ); msg.WriteBits( current.onGround, 1 ); } diff --git a/d3xp/physics/Physics_Parametric.cpp b/d3xp/physics/Physics_Parametric.cpp index c502ba5..ced21a3 100644 --- a/d3xp/physics/Physics_Parametric.cpp +++ b/d3xp/physics/Physics_Parametric.cpp @@ -1031,8 +1031,8 @@ idPhysics_Parametric::WriteToSnapshot ================ */ void idPhysics_Parametric::WriteToSnapshot( idBitMsgDelta &msg ) const { - msg.WriteLong( current.time ); - msg.WriteLong( current.atRest ); + msg.WriteInt( current.time ); + msg.WriteInt( current.atRest ); msg.WriteFloat( current.origin[0] ); msg.WriteFloat( current.origin[1] ); msg.WriteFloat( current.origin[2] ); diff --git a/d3xp/physics/Physics_RigidBody.cpp b/d3xp/physics/Physics_RigidBody.cpp index 2bd77cc..e1990ef 100644 --- a/d3xp/physics/Physics_RigidBody.cpp +++ b/d3xp/physics/Physics_RigidBody.cpp @@ -1466,7 +1466,7 @@ void idPhysics_RigidBody::WriteToSnapshot( idBitMsgDelta &msg ) const { quat = current.i.orientation.ToCQuat(); localQuat = current.localAxis.ToCQuat(); - msg.WriteLong( current.atRest ); + msg.WriteInt( current.atRest ); msg.WriteFloat( current.i.position[0] ); msg.WriteFloat( current.i.position[1] ); msg.WriteFloat( current.i.position[2] ); diff --git a/game/Entity.cpp b/game/Entity.cpp index f7776dc..2f4c59c 100644 --- a/game/Entity.cpp +++ b/game/Entity.cpp @@ -1597,7 +1597,7 @@ bool idEntity::StartSoundShader( const idSoundShader *shader, const s_channelTyp msg.Init( msgBuf, sizeof( msgBuf ) ); msg.BeginWriting(); - msg.WriteLong( gameLocal.ServerRemapDecl( -1, DECL_SOUND, shader->Index() ) ); + msg.WriteInt( gameLocal.ServerRemapDecl( -1, DECL_SOUND, shader->Index() ) ); msg.WriteByte( channel ); ServerSendEvent( EVENT_STARTSOUNDSHADER, &msg, false, -1 ); } @@ -4660,7 +4660,7 @@ void idEntity::WriteColorToSnapshot( idBitMsgDelta &msg ) const { color[1] = renderEntity.shaderParms[ SHADERPARM_GREEN ]; color[2] = renderEntity.shaderParms[ SHADERPARM_BLUE ]; color[3] = renderEntity.shaderParms[ SHADERPARM_ALPHA ]; - msg.WriteLong( PackColor( color ) ); + msg.WriteInt( PackColor( color ) ); } /* @@ -4751,7 +4751,7 @@ void idEntity::ServerSendEvent( int eventId, const idBitMsg *msg, bool saveEvent outMsg.WriteByte( GAME_RELIABLE_MESSAGE_EVENT ); outMsg.WriteBits( gameLocal.GetSpawnId( this ), 32 ); outMsg.WriteByte( eventId ); - outMsg.WriteLong( gameLocal.time ); + outMsg.WriteInt( gameLocal.time ); if ( msg ) { outMsg.WriteBits( msg->GetSize(), idMath::BitsForInteger( MAX_EVENT_PARAM_SIZE ) ); outMsg.WriteData( msg->GetData(), msg->GetSize() ); @@ -4793,7 +4793,7 @@ void idEntity::ClientSendEvent( int eventId, const idBitMsg *msg ) const { outMsg.WriteByte( GAME_RELIABLE_MESSAGE_EVENT ); outMsg.WriteBits( gameLocal.GetSpawnId( this ), 32 ); outMsg.WriteByte( eventId ); - outMsg.WriteLong( gameLocal.time ); + outMsg.WriteInt( gameLocal.time ); if ( msg ) { outMsg.WriteBits( msg->GetSize(), idMath::BitsForInteger( MAX_EVENT_PARAM_SIZE ) ); outMsg.WriteData( msg->GetData(), msg->GetSize() ); @@ -5140,8 +5140,8 @@ void idAnimatedEntity::AddDamageEffect( const trace_t &collision, const idVec3 & msg.WriteFloat( localOrigin[2] ); msg.WriteDir( localNormal, 24 ); msg.WriteDir( localDir, 24 ); - msg.WriteLong( gameLocal.ServerRemapDecl( -1, DECL_ENTITYDEF, def->Index() ) ); - msg.WriteLong( gameLocal.ServerRemapDecl( -1, DECL_MATERIAL, collision.c.material->Index() ) ); + msg.WriteInt( gameLocal.ServerRemapDecl( -1, DECL_ENTITYDEF, def->Index() ) ); + msg.WriteInt( gameLocal.ServerRemapDecl( -1, DECL_MATERIAL, collision.c.material->Index() ) ); ServerSendEvent( EVENT_ADD_DAMAGE_EFFECT, &msg, false, -1 ); } } diff --git a/game/Fx.cpp b/game/Fx.cpp index 8ee3e7c..1ab4f75 100644 --- a/game/Fx.cpp +++ b/game/Fx.cpp @@ -724,8 +724,8 @@ idEntityFx::WriteToSnapshot void idEntityFx::WriteToSnapshot( idBitMsgDelta &msg ) const { GetPhysics()->WriteToSnapshot( msg ); WriteBindToSnapshot( msg ); - msg.WriteLong( ( fxEffect != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_FX, fxEffect->Index() ) : -1 ); - msg.WriteLong( started ); + msg.WriteInt( ( fxEffect != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_FX, fxEffect->Index() ) : -1 ); + msg.WriteInt( started ); } /* diff --git a/game/Game_local.cpp b/game/Game_local.cpp index 0f9cbae..2f81739 100644 --- a/game/Game_local.cpp +++ b/game/Game_local.cpp @@ -4074,7 +4074,7 @@ void idGameLocal::SetPortalState( qhandle_t portal, int blockingBits ) { if ( !gameLocal.isClient ) { outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_PORTAL ); - outMsg.WriteLong( portal ); + outMsg.WriteInt( portal ); outMsg.WriteBits( blockingBits, NUM_RENDER_PORTAL_BITS ); networkSystem->ServerSendReliableMessage( -1, outMsg ); } diff --git a/game/Game_network.cpp b/game/Game_network.cpp index 0a1b07a..5e2cfe1 100644 --- a/game/Game_network.cpp +++ b/game/Game_network.cpp @@ -183,7 +183,7 @@ void idGameLocal::ServerSendDeclRemapToClient( int clientNum, declType_t type, i outMsg.BeginWriting(); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_REMAP_DECL ); outMsg.WriteByte( type ); - outMsg.WriteLong( index ); + outMsg.WriteInt( index ); outMsg.WriteString( decl->GetName() ); networkSystem->ServerSendReliableMessage( clientNum, outMsg ); } @@ -333,7 +333,7 @@ void idGameLocal::ServerClientBegin( int clientNum ) { outMsg.BeginWriting(); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_SPAWN_PLAYER ); outMsg.WriteByte( clientNum ); - outMsg.WriteLong( spawnIds[ clientNum ] ); + outMsg.WriteInt( spawnIds[ clientNum ] ); networkSystem->ServerSendReliableMessage( -1, outMsg ); } @@ -396,7 +396,7 @@ void idGameLocal::ServerWriteInitialReliableMessages( int clientNum ) { outMsg.BeginWriting( ); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_SPAWN_PLAYER ); outMsg.WriteByte( i ); - outMsg.WriteLong( spawnIds[ i ] ); + outMsg.WriteInt( spawnIds[ i ] ); networkSystem->ServerSendReliableMessage( clientNum, outMsg ); } @@ -407,7 +407,7 @@ void idGameLocal::ServerWriteInitialReliableMessages( int clientNum ) { outMsg.WriteByte( GAME_RELIABLE_MESSAGE_EVENT ); outMsg.WriteBits( event->spawnId, 32 ); outMsg.WriteByte( event->event ); - outMsg.WriteLong( event->time ); + outMsg.WriteInt( event->time ); outMsg.WriteBits( event->paramsSize, idMath::BitsForInteger( MAX_EVENT_PARAM_SIZE ) ); if ( event->paramsSize ) { outMsg.WriteData( event->paramsBuf, event->paramsSize ); @@ -421,7 +421,7 @@ void idGameLocal::ServerWriteInitialReliableMessages( int clientNum ) { outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.BeginWriting(); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_PORTALSTATES ); - outMsg.WriteLong( numPortals ); + outMsg.WriteInt( numPortals ); for ( i = 0; i < numPortals; i++ ) { outMsg.WriteBits( gameRenderWorld->GetPortalState( (qhandle_t) (i+1) ) , NUM_RENDER_PORTAL_BITS ); } @@ -592,7 +592,7 @@ void idGameLocal::ServerWriteSnapshot( int clientNum, int sequence, idBitMsg &ms #if ASYNC_WRITE_TAGS idRandom tagRandom; tagRandom.SetSeed( random.RandomInt() ); - msg.WriteLong( tagRandom.GetSeed() ); + msg.WriteInt( tagRandom.GetSeed() ); #endif // create the snapshot @@ -643,7 +643,7 @@ void idGameLocal::ServerWriteSnapshot( int clientNum, int sequence, idBitMsg &ms snapshot->firstEntityState = newBase; #if ASYNC_WRITE_TAGS - msg.WriteLong( tagRandom.RandomInt() ); + msg.WriteInt( tagRandom.RandomInt() ); #endif } } @@ -654,9 +654,9 @@ void idGameLocal::ServerWriteSnapshot( int clientNum, int sequence, idBitMsg &ms #if ASYNC_WRITE_PVS for ( i = 0; i < idEntity::MAX_PVS_AREAS; i++ ) { if ( i < numSourceAreas ) { - msg.WriteLong( sourceAreas[ i ] ); + msg.WriteInt( sourceAreas[ i ] ); } else { - msg.WriteLong( 0 ); + msg.WriteInt( 0 ); } } gameLocal.pvs.WritePVS( pvsHandle, msg ); diff --git a/game/Light.cpp b/game/Light.cpp index a195b35..75a3c1b 100644 --- a/game/Light.cpp +++ b/game/Light.cpp @@ -1048,14 +1048,14 @@ void idLight::WriteToSnapshot( idBitMsgDelta &msg ) const { WriteBindToSnapshot( msg ); msg.WriteByte( currentLevel ); - msg.WriteLong( PackColor( baseColor ) ); + msg.WriteInt( PackColor( baseColor ) ); // msg.WriteBits( lightParent.GetEntityNum(), GENTITYNUM_BITS ); /* // only helps prediction - msg.WriteLong( PackColor( fadeFrom ) ); - msg.WriteLong( PackColor( fadeTo ) ); - msg.WriteLong( fadeStart ); - msg.WriteLong( fadeEnd ); + msg.WriteInt( PackColor( fadeFrom ) ); + msg.WriteInt( PackColor( fadeTo ) ); + msg.WriteInt( fadeStart ); + msg.WriteInt( fadeEnd ); */ // FIXME: send renderLight.shader @@ -1063,13 +1063,13 @@ void idLight::WriteToSnapshot( idBitMsgDelta &msg ) const { msg.WriteFloat( renderLight.lightRadius[1], 5, 10 ); msg.WriteFloat( renderLight.lightRadius[2], 5, 10 ); - msg.WriteLong( PackColor( idVec4( renderLight.shaderParms[SHADERPARM_RED], + msg.WriteInt( PackColor( idVec4( renderLight.shaderParms[SHADERPARM_RED], renderLight.shaderParms[SHADERPARM_GREEN], renderLight.shaderParms[SHADERPARM_BLUE], renderLight.shaderParms[SHADERPARM_ALPHA] ) ) ); msg.WriteFloat( renderLight.shaderParms[SHADERPARM_TIMESCALE], 5, 10 ); - msg.WriteLong( renderLight.shaderParms[SHADERPARM_TIMEOFFSET] ); + msg.WriteInt( renderLight.shaderParms[SHADERPARM_TIMEOFFSET] ); //msg.WriteByte( renderLight.shaderParms[SHADERPARM_DIVERSITY] ); msg.WriteShort( renderLight.shaderParms[SHADERPARM_MODE] ); diff --git a/game/Moveable.cpp b/game/Moveable.cpp index 13bd7be..942196c 100644 --- a/game/Moveable.cpp +++ b/game/Moveable.cpp @@ -993,7 +993,7 @@ void idExplodingBarrel::Killed( idEntity *inflictor, idEntity *attacker, int dam byte msgBuf[MAX_EVENT_PARAM_SIZE]; msg.Init( msgBuf, sizeof( msgBuf ) ); - msg.WriteLong( gameLocal.time ); + msg.WriteInt( gameLocal.time ); ServerSendEvent( EVENT_EXPLODE, &msg, false, -1 ); } } diff --git a/game/MultiplayerGame.cpp b/game/MultiplayerGame.cpp index c21df32..f600fca 100644 --- a/game/MultiplayerGame.cpp +++ b/game/MultiplayerGame.cpp @@ -1057,7 +1057,7 @@ void idMultiplayerGame::NewState( gameState_t news, idPlayer *player ) { outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_WARMUPTIME ); - outMsg.WriteLong( warmupEndTime ); + outMsg.WriteInt( warmupEndTime ); networkSystem->ServerSendReliableMessage( -1, outMsg ); break; @@ -2183,7 +2183,7 @@ void idMultiplayerGame::PlayGlobalSound( int to, snd_evt_t evt, const char *shad return; } outMsg.WriteByte( GAME_RELIABLE_MESSAGE_SOUND_INDEX ); - outMsg.WriteLong( gameLocal.ServerRemapDecl( to, DECL_SOUND, shaderDecl->Index() ) ); + outMsg.WriteInt( gameLocal.ServerRemapDecl( to, DECL_SOUND, shaderDecl->Index() ) ); } else { outMsg.WriteByte( GAME_RELIABLE_MESSAGE_SOUND_EVENT ); outMsg.WriteByte( evt ); @@ -3284,7 +3284,7 @@ void idMultiplayerGame::VoiceChat( const idCmdArgs &args, bool team ) { outMsg.Init( msgBuf, sizeof( msgBuf ) ); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_VCHAT ); - outMsg.WriteLong( index ); + outMsg.WriteInt( index ); outMsg.WriteBits( team ? 1 : 0, 1 ); networkSystem->ClientSendReliableMessage( outMsg ); } @@ -3349,7 +3349,7 @@ void idMultiplayerGame::ServerWriteInitialReliableMessages( int clientNum ) { outMsg.WriteByte( GAME_RELIABLE_MESSAGE_STARTSTATE ); // send the game state and start time outMsg.WriteByte( gameState ); - outMsg.WriteLong( matchStartedTime ); + outMsg.WriteInt( matchStartedTime ); outMsg.WriteShort( startFragLimit ); // send the powerup states and the spectate states for( i = 0; i < gameLocal.numClients; i++ ) { @@ -3373,7 +3373,7 @@ void idMultiplayerGame::ServerWriteInitialReliableMessages( int clientNum ) { if ( gameState == COUNTDOWN ) { outMsg.BeginWriting(); outMsg.WriteByte( GAME_RELIABLE_MESSAGE_WARMUPTIME ); - outMsg.WriteLong( warmupEndTime ); + outMsg.WriteInt( warmupEndTime ); networkSystem->ServerSendReliableMessage( clientNum, outMsg ); } } diff --git a/game/Player.cpp b/game/Player.cpp index 3535002..987feb5 100644 --- a/game/Player.cpp +++ b/game/Player.cpp @@ -8165,7 +8165,7 @@ void idPlayer::WritePlayerStateToSnapshot( idBitMsgDelta &msg ) const { int i; msg.WriteByte( bobCycle ); - msg.WriteLong( stepUpTime ); + msg.WriteInt( stepUpTime ); msg.WriteFloat( stepUpDelta ); msg.WriteShort( inventory.weapons ); msg.WriteByte( inventory.armor ); diff --git a/game/Projectile.cpp b/game/Projectile.cpp index a0ea4b0..a459b62 100644 --- a/game/Projectile.cpp +++ b/game/Projectile.cpp @@ -672,7 +672,7 @@ void idProjectile::AddDefaultDamageEffect( const trace_t &collision, const idVec msg.WriteFloat( collision.c.point[1] ); msg.WriteFloat( collision.c.point[2] ); msg.WriteDir( collision.c.normal, 24 ); - msg.WriteLong( ( collision.c.material != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_MATERIAL, collision.c.material->Index() ) : -1 ); + msg.WriteInt( ( collision.c.material != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_MATERIAL, collision.c.material->Index() ) : -1 ); msg.WriteFloat( velocity[0], 5, 10 ); msg.WriteFloat( velocity[1], 5, 10 ); msg.WriteFloat( velocity[2], 5, 10 ); diff --git a/game/Weapon.cpp b/game/Weapon.cpp index 7020ca5..f5ee333 100644 --- a/game/Weapon.cpp +++ b/game/Weapon.cpp @@ -2705,7 +2705,7 @@ void idWeapon::Event_SetSkin( const char *skinname ) { byte msgBuf[MAX_EVENT_PARAM_SIZE]; msg.Init( msgBuf, sizeof( msgBuf ) ); - msg.WriteLong( ( skinDecl != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_SKIN, skinDecl->Index() ) : -1 ); + msg.WriteInt( ( skinDecl != NULL ) ? gameLocal.ServerRemapDecl( -1, DECL_SKIN, skinDecl->Index() ) : -1 ); ServerSendEvent( EVENT_CHANGESKIN, &msg, false, -1 ); } } diff --git a/game/physics/Physics_AF.cpp b/game/physics/Physics_AF.cpp index e416a58..be991a4 100644 --- a/game/physics/Physics_AF.cpp +++ b/game/physics/Physics_AF.cpp @@ -7924,7 +7924,7 @@ void idPhysics_AF::WriteToSnapshot( idBitMsgDelta &msg ) const { int i; idCQuat quat; - msg.WriteLong( current.atRest ); + msg.WriteInt( current.atRest ); msg.WriteFloat( current.noMoveTime ); msg.WriteFloat( current.activateTime ); msg.WriteDeltaFloat( 0.0f, current.pushVelocity[0], AF_VELOCITY_EXPONENT_BITS, AF_VELOCITY_MANTISSA_BITS ); diff --git a/game/physics/Physics_Monster.cpp b/game/physics/Physics_Monster.cpp index 1e48b7f..f3a1606 100644 --- a/game/physics/Physics_Monster.cpp +++ b/game/physics/Physics_Monster.cpp @@ -780,7 +780,7 @@ void idPhysics_Monster::WriteToSnapshot( idBitMsgDelta &msg ) const { msg.WriteDeltaFloat( 0.0f, current.pushVelocity[0], MONSTER_VELOCITY_EXPONENT_BITS, MONSTER_VELOCITY_MANTISSA_BITS ); msg.WriteDeltaFloat( 0.0f, current.pushVelocity[1], MONSTER_VELOCITY_EXPONENT_BITS, MONSTER_VELOCITY_MANTISSA_BITS ); msg.WriteDeltaFloat( 0.0f, current.pushVelocity[2], MONSTER_VELOCITY_EXPONENT_BITS, MONSTER_VELOCITY_MANTISSA_BITS ); - msg.WriteLong( current.atRest ); + msg.WriteInt( current.atRest ); msg.WriteBits( current.onGround, 1 ); } diff --git a/game/physics/Physics_Parametric.cpp b/game/physics/Physics_Parametric.cpp index c502ba5..ced21a3 100644 --- a/game/physics/Physics_Parametric.cpp +++ b/game/physics/Physics_Parametric.cpp @@ -1031,8 +1031,8 @@ idPhysics_Parametric::WriteToSnapshot ================ */ void idPhysics_Parametric::WriteToSnapshot( idBitMsgDelta &msg ) const { - msg.WriteLong( current.time ); - msg.WriteLong( current.atRest ); + msg.WriteInt( current.time ); + msg.WriteInt( current.atRest ); msg.WriteFloat( current.origin[0] ); msg.WriteFloat( current.origin[1] ); msg.WriteFloat( current.origin[2] ); diff --git a/game/physics/Physics_RigidBody.cpp b/game/physics/Physics_RigidBody.cpp index 2bd77cc..e1990ef 100644 --- a/game/physics/Physics_RigidBody.cpp +++ b/game/physics/Physics_RigidBody.cpp @@ -1466,7 +1466,7 @@ void idPhysics_RigidBody::WriteToSnapshot( idBitMsgDelta &msg ) const { quat = current.i.orientation.ToCQuat(); localQuat = current.localAxis.ToCQuat(); - msg.WriteLong( current.atRest ); + msg.WriteInt( current.atRest ); msg.WriteFloat( current.i.position[0] ); msg.WriteFloat( current.i.position[1] ); msg.WriteFloat( current.i.position[2] ); diff --git a/idlib/BitMsg.h b/idlib/BitMsg.h index 82edfa4..cc7cfa0 100644 --- a/idlib/BitMsg.h +++ b/idlib/BitMsg.h @@ -84,7 +84,7 @@ public: void WriteByte( int c ); void WriteShort( int c ); void WriteUShort( int c ); - void WriteLong( int c ); + void WriteInt( int c ); void WriteFloat( float f ); void WriteFloat( float f, int exponentBits, int mantissaBits ); void WriteAngle8( float f ); @@ -296,7 +296,7 @@ ID_INLINE void idBitMsg::WriteUShort( int c ) { WriteBits( c, 16 ); } -ID_INLINE void idBitMsg::WriteLong( int c ) { +ID_INLINE void idBitMsg::WriteInt( int c ) { WriteBits( c, 32 ); } @@ -454,7 +454,7 @@ public: void WriteByte( int c ); void WriteShort( int c ); void WriteUShort( int c ); - void WriteLong( int c ); + void WriteInt( int c ); void WriteFloat( float f ); void WriteFloat( float f, int exponentBits, int mantissaBits ); void WriteAngle8( float f ); @@ -555,7 +555,7 @@ ID_INLINE void idBitMsgDelta::WriteUShort( int c ) { WriteBits( c, 16 ); } -ID_INLINE void idBitMsgDelta::WriteLong( int c ) { +ID_INLINE void idBitMsgDelta::WriteInt( int c ) { WriteBits( c, 32 ); }