diff --git a/d3xp/Entity.cpp b/d3xp/Entity.cpp index 143ce71..ec636a6 100644 --- a/d3xp/Entity.cpp +++ b/d3xp/Entity.cpp @@ -4845,7 +4845,7 @@ idEntity::ReadColorFromSnapshot void idEntity::ReadColorFromSnapshot( const idBitMsgDelta &msg ) { idVec4 color; - UnpackColor( msg.ReadLong(), color ); + UnpackColor( msg.ReadInt(), color ); renderEntity.shaderParms[ SHADERPARM_RED ] = color[0]; renderEntity.shaderParms[ SHADERPARM_GREEN ] = color[1]; renderEntity.shaderParms[ SHADERPARM_BLUE ] = color[2]; @@ -5012,7 +5012,7 @@ bool idEntity::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) { common->DPrintf( "ent 0x%x: start sound shader too old (%d ms)\n", entityNumber, gameLocal.realClientTime - time ); return true; } - index = gameLocal.ClientRemapDecl( DECL_SOUND, msg.ReadLong() ); + index = gameLocal.ClientRemapDecl( DECL_SOUND, msg.ReadInt() ); if ( index >= 0 && index < declManager->GetNumDecls( DECL_SOUND ) ) { shader = declManager->SoundByIndex( index, false ); channel = (s_channelType)msg.ReadByte(); @@ -5501,8 +5501,8 @@ bool idAnimatedEntity::ClientReceiveEvent( int event, int time, const idBitMsg & localOrigin[2] = msg.ReadFloat(); localNormal = msg.ReadDir( 24 ); localDir = msg.ReadDir( 24 ); - damageDefIndex = gameLocal.ClientRemapDecl( DECL_ENTITYDEF, msg.ReadLong() ); - materialIndex = gameLocal.ClientRemapDecl( DECL_MATERIAL, msg.ReadLong() ); + damageDefIndex = gameLocal.ClientRemapDecl( DECL_ENTITYDEF, msg.ReadInt() ); + materialIndex = gameLocal.ClientRemapDecl( DECL_MATERIAL, msg.ReadInt() ); const idDeclEntityDef *damageDef = static_cast( declManager->DeclByIndex( DECL_ENTITYDEF, damageDefIndex ) ); const idMaterial *collisionMaterial = static_cast( declManager->DeclByIndex( DECL_MATERIAL, materialIndex ) ); AddLocalDamageEffect( jointNum, localOrigin, localNormal, localDir, damageDef, collisionMaterial ); diff --git a/d3xp/Fx.cpp b/d3xp/Fx.cpp index b57116f..ea8a09f 100644 --- a/d3xp/Fx.cpp +++ b/d3xp/Fx.cpp @@ -768,8 +768,8 @@ void idEntityFx::ReadFromSnapshot( const idBitMsgDelta &msg ) { GetPhysics()->ReadFromSnapshot( msg ); ReadBindFromSnapshot( msg ); - fx_index = gameLocal.ClientRemapDecl( DECL_FX, msg.ReadLong() ); - start_time = msg.ReadLong(); + fx_index = gameLocal.ClientRemapDecl( DECL_FX, msg.ReadInt() ); + start_time = msg.ReadInt(); if ( fx_index != -1 && start_time > 0 && !fxEffect && started < 0 ) { spawnArgs.GetInt( "effect_lapse", "1000", max_lapse ); diff --git a/d3xp/Game_network.cpp b/d3xp/Game_network.cpp index 6895a2f..9b43b39 100644 --- a/d3xp/Game_network.cpp +++ b/d3xp/Game_network.cpp @@ -820,7 +820,7 @@ void idGameLocal::ServerProcessReliableMessage( int clientNum, const idBitMsg &m break; } case GAME_RELIABLE_MESSAGE_VCHAT: { - int index = msg.ReadLong(); + int index = msg.ReadInt(); bool team = msg.ReadBits( 1 ) != 0; mpGame.ProcessVoiceChat( clientNum, team, index ); break; @@ -858,7 +858,7 @@ void idGameLocal::ServerProcessReliableMessage( int clientNum, const idBitMsg &m event->spawnId = msg.ReadBits( 32 ); event->event = msg.ReadByte(); - event->time = msg.ReadLong(); + event->time = msg.ReadInt(); event->paramsSize = msg.ReadBits( idMath::BitsForInteger( MAX_EVENT_PARAM_SIZE ) ); if ( event->paramsSize ) { @@ -1025,7 +1025,7 @@ void idGameLocal::ClientReadSnapshot( int clientNum, int sequence, const int gam #if ASYNC_WRITE_TAGS idRandom tagRandom; - tagRandom.SetSeed( msg.ReadLong() ); + tagRandom.SetSeed( msg.ReadInt() ); #endif // read all entities from the snapshot @@ -1103,7 +1103,7 @@ void idGameLocal::ClientReadSnapshot( int clientNum, int sequence, const int gam ent->snapshotBits = msg.GetNumBitsRead() - numBitsRead; #if ASYNC_WRITE_TAGS - if ( msg.ReadLong() != tagRandom.RandomInt() ) { + if ( msg.ReadInt() != tagRandom.RandomInt() ) { cmdSystem->BufferCommandText( CMD_EXEC_NOW, "writeGameState" ); if ( entityDefNumber >= 0 && entityDefNumber < declManager->GetNumDecls( DECL_ENTITYDEF ) ) { classname = declManager->DeclByIndex( DECL_ENTITYDEF, entityDefNumber, false )->GetName(); @@ -1156,7 +1156,7 @@ void idGameLocal::ClientReadSnapshot( int clientNum, int sequence, const int gam sourceAreas[ i++ ] = 0; } for ( i = 0; i < idEntity::MAX_PVS_AREAS; i++ ) { - serverPVS[ i ] = msg.ReadLong(); + serverPVS[ i ] = msg.ReadInt(); } if ( memcmp( sourceAreas, serverPVS, idEntity::MAX_PVS_AREAS * sizeof( int ) ) ) { common->Warning( "client PVS areas != server PVS areas, sequence 0x%x", sequence ); @@ -1347,7 +1347,7 @@ void idGameLocal::ClientProcessReliableMessage( int clientNum, const idBitMsg &m char name[MAX_STRING_CHARS]; type = msg.ReadByte(); - index = msg.ReadLong(); + index = msg.ReadInt(); msg.ReadString( name, sizeof( name ) ); const idDecl *decl = declManager->FindType( (declType_t)type, name, false ); @@ -1361,7 +1361,7 @@ void idGameLocal::ClientProcessReliableMessage( int clientNum, const idBitMsg &m } case GAME_RELIABLE_MESSAGE_SPAWN_PLAYER: { int client = msg.ReadByte(); - int spawnId = msg.ReadLong(); + int spawnId = msg.ReadInt(); if ( !entities[ client ] ) { SpawnPlayer( client ); entities[ client ]->FreeModelDef(); @@ -1395,7 +1395,7 @@ void idGameLocal::ClientProcessReliableMessage( int clientNum, const idBitMsg &m break; } case GAME_RELIABLE_MESSAGE_SOUND_INDEX: { - int index = gameLocal.ClientRemapDecl( DECL_SOUND, msg.ReadLong() ); + int index = gameLocal.ClientRemapDecl( DECL_SOUND, msg.ReadInt() ); if ( index >= 0 && index < declManager->GetNumDecls( DECL_SOUND ) ) { const idSoundShader *shader = declManager->SoundByIndex( index ); mpGame.PlayGlobalSound( -1, SND_COUNT, shader->GetName() ); @@ -1419,7 +1419,7 @@ void idGameLocal::ClientProcessReliableMessage( int clientNum, const idBitMsg &m event->spawnId = msg.ReadBits( 32 ); event->event = msg.ReadByte(); - event->time = msg.ReadLong(); + event->time = msg.ReadInt(); event->paramsSize = msg.ReadBits( idMath::BitsForInteger( MAX_EVENT_PARAM_SIZE ) ); if ( event->paramsSize ) { @@ -1474,7 +1474,7 @@ void idGameLocal::ClientProcessReliableMessage( int clientNum, const idBitMsg &m break; } case GAME_RELIABLE_MESSAGE_PORTALSTATES: { - int numPortals = msg.ReadLong(); + int numPortals = msg.ReadInt(); assert( numPortals == gameRenderWorld->NumPortals() ); for ( int i = 0; i < numPortals; i++ ) { gameRenderWorld->SetPortalState( (qhandle_t) (i+1), msg.ReadBits( NUM_RENDER_PORTAL_BITS ) ); @@ -1482,7 +1482,7 @@ void idGameLocal::ClientProcessReliableMessage( int clientNum, const idBitMsg &m break; } case GAME_RELIABLE_MESSAGE_PORTAL: { - qhandle_t portal = msg.ReadLong(); + qhandle_t portal = msg.ReadInt(); int blockingBits = msg.ReadBits( NUM_RENDER_PORTAL_BITS ); assert( portal > 0 && portal <= gameRenderWorld->NumPortals() ); gameRenderWorld->SetPortalState( portal, blockingBits ); diff --git a/d3xp/Light.cpp b/d3xp/Light.cpp index 5f10a70..8db6eb3 100644 --- a/d3xp/Light.cpp +++ b/d3xp/Light.cpp @@ -1107,14 +1107,14 @@ void idLight::ReadFromSnapshot( const idBitMsgDelta &msg ) { Off(); } } - UnpackColor( msg.ReadLong(), baseColor ); + UnpackColor( msg.ReadInt(), baseColor ); // lightParentEntityNum = msg.ReadBits( GENTITYNUM_BITS ); /* // only helps prediction - UnpackColor( msg.ReadLong(), fadeFrom ); - UnpackColor( msg.ReadLong(), fadeTo ); - fadeStart = msg.ReadLong(); - fadeEnd = msg.ReadLong(); + UnpackColor( msg.ReadInt(), fadeFrom ); + UnpackColor( msg.ReadInt(), fadeTo ); + fadeStart = msg.ReadInt(); + fadeEnd = msg.ReadInt(); */ // FIXME: read renderLight.shader @@ -1122,14 +1122,14 @@ void idLight::ReadFromSnapshot( const idBitMsgDelta &msg ) { renderLight.lightRadius[1] = msg.ReadFloat( 5, 10 ); renderLight.lightRadius[2] = msg.ReadFloat( 5, 10 ); - UnpackColor( msg.ReadLong(), shaderColor ); + UnpackColor( msg.ReadInt(), shaderColor ); renderLight.shaderParms[SHADERPARM_RED] = shaderColor[0]; renderLight.shaderParms[SHADERPARM_GREEN] = shaderColor[1]; renderLight.shaderParms[SHADERPARM_BLUE] = shaderColor[2]; renderLight.shaderParms[SHADERPARM_ALPHA] = shaderColor[3]; renderLight.shaderParms[SHADERPARM_TIMESCALE] = msg.ReadFloat( 5, 10 ); - renderLight.shaderParms[SHADERPARM_TIMEOFFSET] = msg.ReadLong(); + renderLight.shaderParms[SHADERPARM_TIMEOFFSET] = msg.ReadInt(); //renderLight.shaderParms[SHADERPARM_DIVERSITY] = msg.ReadFloat(); renderLight.shaderParms[SHADERPARM_MODE] = msg.ReadShort(); diff --git a/d3xp/Moveable.cpp b/d3xp/Moveable.cpp index b5f95d2..0ba26a8 100644 --- a/d3xp/Moveable.cpp +++ b/d3xp/Moveable.cpp @@ -1346,7 +1346,7 @@ bool idExplodingBarrel::ClientReceiveEvent( int event, int time, const idBitMsg switch( event ) { case EVENT_EXPLODE: - if ( gameLocal.realClientTime - msg.ReadLong() < spawnArgs.GetInt( "explode_lapse", "1000" ) ) { + if ( gameLocal.realClientTime - msg.ReadInt() < spawnArgs.GetInt( "explode_lapse", "1000" ) ) { ExplodingEffects( ); } return true; diff --git a/d3xp/MultiplayerGame.cpp b/d3xp/MultiplayerGame.cpp index d0368ec..ec9dfa8 100644 --- a/d3xp/MultiplayerGame.cpp +++ b/d3xp/MultiplayerGame.cpp @@ -4122,7 +4122,7 @@ void idMultiplayerGame::ClientReadStartState( const idBitMsg &msg ) { // read the state in preparation for reading snapshot updates gameState = (idMultiplayerGame::gameState_t)msg.ReadByte(); - matchStartedTime = msg.ReadLong( ); + matchStartedTime = msg.ReadInt( ); startFragLimit = msg.ReadShort( ); while ( ( client = msg.ReadShort() ) != MAX_CLIENTS ) { assert( gameLocal.entities[ client ] && gameLocal.entities[ client ]->IsType( idPlayer::Type ) ); @@ -4143,7 +4143,7 @@ idMultiplayerGame::ClientReadWarmupTime ================ */ void idMultiplayerGame::ClientReadWarmupTime( const idBitMsg &msg ) { - warmupEndTime = msg.ReadLong(); + warmupEndTime = msg.ReadInt(); } /* diff --git a/d3xp/Player.cpp b/d3xp/Player.cpp index c4f110f..9483eb6 100644 --- a/d3xp/Player.cpp +++ b/d3xp/Player.cpp @@ -9727,10 +9727,10 @@ void idPlayer::ReadPlayerStateFromSnapshot( const idBitMsgDelta &msg ) { int i, ammo; bobCycle = msg.ReadByte(); - stepUpTime = msg.ReadLong(); + stepUpTime = msg.ReadInt(); stepUpDelta = msg.ReadFloat(); #ifdef _D3XP - inventory.weapons = msg.ReadLong(); + inventory.weapons = msg.ReadInt(); #else inventory.weapons = msg.ReadShort(); #endif diff --git a/d3xp/Projectile.cpp b/d3xp/Projectile.cpp index 935323d..51023b6 100644 --- a/d3xp/Projectile.cpp +++ b/d3xp/Projectile.cpp @@ -1375,7 +1375,7 @@ bool idProjectile::ClientReceiveEvent( int event, int time, const idBitMsg &msg collision.c.point[1] = msg.ReadFloat(); collision.c.point[2] = msg.ReadFloat(); collision.c.normal = msg.ReadDir( 24 ); - int index = gameLocal.ClientRemapDecl( DECL_MATERIAL, msg.ReadLong() ); + int index = gameLocal.ClientRemapDecl( DECL_MATERIAL, msg.ReadInt() ); collision.c.material = ( index != -1 ) ? static_cast( declManager->DeclByIndex( DECL_MATERIAL, index ) ) : NULL; velocity[0] = msg.ReadFloat( 5, 10 ); velocity[1] = msg.ReadFloat( 5, 10 ); diff --git a/d3xp/Weapon.cpp b/d3xp/Weapon.cpp index 802b7f8..06a0fab 100644 --- a/d3xp/Weapon.cpp +++ b/d3xp/Weapon.cpp @@ -2749,7 +2749,7 @@ bool idWeapon::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) { return true; } case EVENT_CHANGESKIN: { - int index = gameLocal.ClientRemapDecl( DECL_SKIN, msg.ReadLong() ); + int index = gameLocal.ClientRemapDecl( DECL_SKIN, msg.ReadInt() ); renderEntity.customSkin = ( index != -1 ) ? static_cast( declManager->DeclByIndex( DECL_SKIN, index ) ) : NULL; UpdateVisuals(); if ( worldModel.GetEntity() ) { diff --git a/d3xp/physics/Physics_AF.cpp b/d3xp/physics/Physics_AF.cpp index 2aea5e4..b716b74 100644 --- a/d3xp/physics/Physics_AF.cpp +++ b/d3xp/physics/Physics_AF.cpp @@ -7972,7 +7972,7 @@ void idPhysics_AF::ReadFromSnapshot( const idBitMsgDelta &msg ) { int i, num id_attribute((unused)); idCQuat quat; - current.atRest = msg.ReadLong(); + current.atRest = msg.ReadInt(); current.noMoveTime = msg.ReadFloat(); current.activateTime = msg.ReadFloat(); current.pushVelocity[0] = msg.ReadDeltaFloat( 0.0f, AF_VELOCITY_EXPONENT_BITS, AF_VELOCITY_MANTISSA_BITS ); diff --git a/d3xp/physics/Physics_Monster.cpp b/d3xp/physics/Physics_Monster.cpp index f3a1606..8b74d3a 100644 --- a/d3xp/physics/Physics_Monster.cpp +++ b/d3xp/physics/Physics_Monster.cpp @@ -802,6 +802,6 @@ void idPhysics_Monster::ReadFromSnapshot( const idBitMsgDelta &msg ) { current.pushVelocity[0] = msg.ReadDeltaFloat( 0.0f, MONSTER_VELOCITY_EXPONENT_BITS, MONSTER_VELOCITY_MANTISSA_BITS ); current.pushVelocity[1] = msg.ReadDeltaFloat( 0.0f, MONSTER_VELOCITY_EXPONENT_BITS, MONSTER_VELOCITY_MANTISSA_BITS ); current.pushVelocity[2] = msg.ReadDeltaFloat( 0.0f, MONSTER_VELOCITY_EXPONENT_BITS, MONSTER_VELOCITY_MANTISSA_BITS ); - current.atRest = msg.ReadLong(); + current.atRest = msg.ReadInt(); current.onGround = msg.ReadBits( 1 ) != 0; } diff --git a/d3xp/physics/Physics_Parametric.cpp b/d3xp/physics/Physics_Parametric.cpp index ced21a3..123439c 100644 --- a/d3xp/physics/Physics_Parametric.cpp +++ b/d3xp/physics/Physics_Parametric.cpp @@ -1106,8 +1106,8 @@ void idPhysics_Parametric::ReadFromSnapshot( const idBitMsgDelta &msg ) { idVec3 linearStartValue, linearSpeed, linearBaseSpeed, startPos, endPos; idAngles angularStartValue, angularSpeed, angularBaseSpeed, startAng, endAng; - current.time = msg.ReadLong(); - current.atRest = msg.ReadLong(); + current.time = msg.ReadInt(); + current.atRest = msg.ReadInt(); current.origin[0] = msg.ReadFloat(); current.origin[1] = msg.ReadFloat(); current.origin[2] = msg.ReadFloat(); diff --git a/d3xp/physics/Physics_RigidBody.cpp b/d3xp/physics/Physics_RigidBody.cpp index e1990ef..8380656 100644 --- a/d3xp/physics/Physics_RigidBody.cpp +++ b/d3xp/physics/Physics_RigidBody.cpp @@ -1504,7 +1504,7 @@ idPhysics_RigidBody::ReadFromSnapshot void idPhysics_RigidBody::ReadFromSnapshot( const idBitMsgDelta &msg ) { idCQuat quat, localQuat; - current.atRest = msg.ReadLong(); + current.atRest = msg.ReadInt(); current.i.position[0] = msg.ReadFloat(); current.i.position[1] = msg.ReadFloat(); current.i.position[2] = msg.ReadFloat(); diff --git a/game/Entity.cpp b/game/Entity.cpp index 2f4c59c..8ae5f13 100644 --- a/game/Entity.cpp +++ b/game/Entity.cpp @@ -4671,7 +4671,7 @@ idEntity::ReadColorFromSnapshot void idEntity::ReadColorFromSnapshot( const idBitMsgDelta &msg ) { idVec4 color; - UnpackColor( msg.ReadLong(), color ); + UnpackColor( msg.ReadInt(), color ); renderEntity.shaderParms[ SHADERPARM_RED ] = color[0]; renderEntity.shaderParms[ SHADERPARM_GREEN ] = color[1]; renderEntity.shaderParms[ SHADERPARM_BLUE ] = color[2]; @@ -4838,7 +4838,7 @@ bool idEntity::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) { common->DPrintf( "ent 0x%x: start sound shader too old (%d ms)\n", entityNumber, gameLocal.realClientTime - time ); return true; } - index = gameLocal.ClientRemapDecl( DECL_SOUND, msg.ReadLong() ); + index = gameLocal.ClientRemapDecl( DECL_SOUND, msg.ReadInt() ); if ( index >= 0 && index < declManager->GetNumDecls( DECL_SOUND ) ) { shader = declManager->SoundByIndex( index, false ); channel = (s_channelType)msg.ReadByte(); @@ -5289,8 +5289,8 @@ bool idAnimatedEntity::ClientReceiveEvent( int event, int time, const idBitMsg & localOrigin[2] = msg.ReadFloat(); localNormal = msg.ReadDir( 24 ); localDir = msg.ReadDir( 24 ); - damageDefIndex = gameLocal.ClientRemapDecl( DECL_ENTITYDEF, msg.ReadLong() ); - materialIndex = gameLocal.ClientRemapDecl( DECL_MATERIAL, msg.ReadLong() ); + damageDefIndex = gameLocal.ClientRemapDecl( DECL_ENTITYDEF, msg.ReadInt() ); + materialIndex = gameLocal.ClientRemapDecl( DECL_MATERIAL, msg.ReadInt() ); const idDeclEntityDef *damageDef = static_cast( declManager->DeclByIndex( DECL_ENTITYDEF, damageDefIndex ) ); const idMaterial *collisionMaterial = static_cast( declManager->DeclByIndex( DECL_MATERIAL, materialIndex ) ); AddLocalDamageEffect( jointNum, localOrigin, localNormal, localDir, damageDef, collisionMaterial ); diff --git a/game/Fx.cpp b/game/Fx.cpp index 1ab4f75..549f9e1 100644 --- a/game/Fx.cpp +++ b/game/Fx.cpp @@ -738,8 +738,8 @@ void idEntityFx::ReadFromSnapshot( const idBitMsgDelta &msg ) { GetPhysics()->ReadFromSnapshot( msg ); ReadBindFromSnapshot( msg ); - fx_index = gameLocal.ClientRemapDecl( DECL_FX, msg.ReadLong() ); - start_time = msg.ReadLong(); + fx_index = gameLocal.ClientRemapDecl( DECL_FX, msg.ReadInt() ); + start_time = msg.ReadInt(); if ( fx_index != -1 && start_time > 0 && !fxEffect && started < 0 ) { spawnArgs.GetInt( "effect_lapse", "1000", max_lapse ); diff --git a/game/Game_network.cpp b/game/Game_network.cpp index 5e2cfe1..f43c96a 100644 --- a/game/Game_network.cpp +++ b/game/Game_network.cpp @@ -806,7 +806,7 @@ void idGameLocal::ServerProcessReliableMessage( int clientNum, const idBitMsg &m break; } case GAME_RELIABLE_MESSAGE_VCHAT: { - int index = msg.ReadLong(); + int index = msg.ReadInt(); bool team = msg.ReadBits( 1 ) != 0; mpGame.ProcessVoiceChat( clientNum, team, index ); break; @@ -844,7 +844,7 @@ void idGameLocal::ServerProcessReliableMessage( int clientNum, const idBitMsg &m event->spawnId = msg.ReadBits( 32 ); event->event = msg.ReadByte(); - event->time = msg.ReadLong(); + event->time = msg.ReadInt(); event->paramsSize = msg.ReadBits( idMath::BitsForInteger( MAX_EVENT_PARAM_SIZE ) ); if ( event->paramsSize ) { @@ -1011,7 +1011,7 @@ void idGameLocal::ClientReadSnapshot( int clientNum, int sequence, const int gam #if ASYNC_WRITE_TAGS idRandom tagRandom; - tagRandom.SetSeed( msg.ReadLong() ); + tagRandom.SetSeed( msg.ReadInt() ); #endif // read all entities from the snapshot @@ -1089,7 +1089,7 @@ void idGameLocal::ClientReadSnapshot( int clientNum, int sequence, const int gam ent->snapshotBits = msg.GetNumBitsRead() - numBitsRead; #if ASYNC_WRITE_TAGS - if ( msg.ReadLong() != tagRandom.RandomInt() ) { + if ( msg.ReadInt() != tagRandom.RandomInt() ) { cmdSystem->BufferCommandText( CMD_EXEC_NOW, "writeGameState" ); if ( entityDefNumber >= 0 && entityDefNumber < declManager->GetNumDecls( DECL_ENTITYDEF ) ) { classname = declManager->DeclByIndex( DECL_ENTITYDEF, entityDefNumber, false )->GetName(); @@ -1128,7 +1128,7 @@ void idGameLocal::ClientReadSnapshot( int clientNum, int sequence, const int gam sourceAreas[ i++ ] = 0; } for ( i = 0; i < idEntity::MAX_PVS_AREAS; i++ ) { - serverPVS[ i ] = msg.ReadLong(); + serverPVS[ i ] = msg.ReadInt(); } if ( memcmp( sourceAreas, serverPVS, idEntity::MAX_PVS_AREAS * sizeof( int ) ) ) { common->Warning( "client PVS areas != server PVS areas, sequence 0x%x", sequence ); @@ -1315,7 +1315,7 @@ void idGameLocal::ClientProcessReliableMessage( int clientNum, const idBitMsg &m char name[MAX_STRING_CHARS]; type = msg.ReadByte(); - index = msg.ReadLong(); + index = msg.ReadInt(); msg.ReadString( name, sizeof( name ) ); const idDecl *decl = declManager->FindType( (declType_t)type, name, false ); @@ -1329,7 +1329,7 @@ void idGameLocal::ClientProcessReliableMessage( int clientNum, const idBitMsg &m } case GAME_RELIABLE_MESSAGE_SPAWN_PLAYER: { int client = msg.ReadByte(); - int spawnId = msg.ReadLong(); + int spawnId = msg.ReadInt(); if ( !entities[ client ] ) { SpawnPlayer( client ); entities[ client ]->FreeModelDef(); @@ -1363,7 +1363,7 @@ void idGameLocal::ClientProcessReliableMessage( int clientNum, const idBitMsg &m break; } case GAME_RELIABLE_MESSAGE_SOUND_INDEX: { - int index = gameLocal.ClientRemapDecl( DECL_SOUND, msg.ReadLong() ); + int index = gameLocal.ClientRemapDecl( DECL_SOUND, msg.ReadInt() ); if ( index >= 0 && index < declManager->GetNumDecls( DECL_SOUND ) ) { const idSoundShader *shader = declManager->SoundByIndex( index ); mpGame.PlayGlobalSound( -1, SND_COUNT, shader->GetName() ); @@ -1387,7 +1387,7 @@ void idGameLocal::ClientProcessReliableMessage( int clientNum, const idBitMsg &m event->spawnId = msg.ReadBits( 32 ); event->event = msg.ReadByte(); - event->time = msg.ReadLong(); + event->time = msg.ReadInt(); event->paramsSize = msg.ReadBits( idMath::BitsForInteger( MAX_EVENT_PARAM_SIZE ) ); if ( event->paramsSize ) { @@ -1434,7 +1434,7 @@ void idGameLocal::ClientProcessReliableMessage( int clientNum, const idBitMsg &m break; } case GAME_RELIABLE_MESSAGE_PORTALSTATES: { - int numPortals = msg.ReadLong(); + int numPortals = msg.ReadInt(); assert( numPortals == gameRenderWorld->NumPortals() ); for ( int i = 0; i < numPortals; i++ ) { gameRenderWorld->SetPortalState( (qhandle_t) (i+1), msg.ReadBits( NUM_RENDER_PORTAL_BITS ) ); @@ -1442,7 +1442,7 @@ void idGameLocal::ClientProcessReliableMessage( int clientNum, const idBitMsg &m break; } case GAME_RELIABLE_MESSAGE_PORTAL: { - qhandle_t portal = msg.ReadLong(); + qhandle_t portal = msg.ReadInt(); int blockingBits = msg.ReadBits( NUM_RENDER_PORTAL_BITS ); assert( portal > 0 && portal <= gameRenderWorld->NumPortals() ); gameRenderWorld->SetPortalState( portal, blockingBits ); diff --git a/game/Light.cpp b/game/Light.cpp index 75a3c1b..cc24a42 100644 --- a/game/Light.cpp +++ b/game/Light.cpp @@ -1100,14 +1100,14 @@ void idLight::ReadFromSnapshot( const idBitMsgDelta &msg ) { Off(); } } - UnpackColor( msg.ReadLong(), baseColor ); + UnpackColor( msg.ReadInt(), baseColor ); // lightParentEntityNum = msg.ReadBits( GENTITYNUM_BITS ); /* // only helps prediction - UnpackColor( msg.ReadLong(), fadeFrom ); - UnpackColor( msg.ReadLong(), fadeTo ); - fadeStart = msg.ReadLong(); - fadeEnd = msg.ReadLong(); + UnpackColor( msg.ReadInt(), fadeFrom ); + UnpackColor( msg.ReadInt(), fadeTo ); + fadeStart = msg.ReadInt(); + fadeEnd = msg.ReadInt(); */ // FIXME: read renderLight.shader @@ -1115,14 +1115,14 @@ void idLight::ReadFromSnapshot( const idBitMsgDelta &msg ) { renderLight.lightRadius[1] = msg.ReadFloat( 5, 10 ); renderLight.lightRadius[2] = msg.ReadFloat( 5, 10 ); - UnpackColor( msg.ReadLong(), shaderColor ); + UnpackColor( msg.ReadInt(), shaderColor ); renderLight.shaderParms[SHADERPARM_RED] = shaderColor[0]; renderLight.shaderParms[SHADERPARM_GREEN] = shaderColor[1]; renderLight.shaderParms[SHADERPARM_BLUE] = shaderColor[2]; renderLight.shaderParms[SHADERPARM_ALPHA] = shaderColor[3]; renderLight.shaderParms[SHADERPARM_TIMESCALE] = msg.ReadFloat( 5, 10 ); - renderLight.shaderParms[SHADERPARM_TIMEOFFSET] = msg.ReadLong(); + renderLight.shaderParms[SHADERPARM_TIMEOFFSET] = msg.ReadInt(); //renderLight.shaderParms[SHADERPARM_DIVERSITY] = msg.ReadFloat(); renderLight.shaderParms[SHADERPARM_MODE] = msg.ReadShort(); diff --git a/game/Moveable.cpp b/game/Moveable.cpp index 942196c..e13ecd6 100644 --- a/game/Moveable.cpp +++ b/game/Moveable.cpp @@ -1182,7 +1182,7 @@ bool idExplodingBarrel::ClientReceiveEvent( int event, int time, const idBitMsg switch( event ) { case EVENT_EXPLODE: - if ( gameLocal.realClientTime - msg.ReadLong() < spawnArgs.GetInt( "explode_lapse", "1000" ) ) { + if ( gameLocal.realClientTime - msg.ReadInt() < spawnArgs.GetInt( "explode_lapse", "1000" ) ) { ExplodingEffects( ); } return true; diff --git a/game/MultiplayerGame.cpp b/game/MultiplayerGame.cpp index f600fca..94a0aff 100644 --- a/game/MultiplayerGame.cpp +++ b/game/MultiplayerGame.cpp @@ -3388,7 +3388,7 @@ void idMultiplayerGame::ClientReadStartState( const idBitMsg &msg ) { // read the state in preparation for reading snapshot updates gameState = (idMultiplayerGame::gameState_t)msg.ReadByte(); - matchStartedTime = msg.ReadLong( ); + matchStartedTime = msg.ReadInt( ); startFragLimit = msg.ReadShort( ); while ( ( client = msg.ReadShort() ) != MAX_CLIENTS ) { assert( gameLocal.entities[ client ] && gameLocal.entities[ client ]->IsType( idPlayer::Type ) ); @@ -3409,5 +3409,5 @@ idMultiplayerGame::ClientReadWarmupTime ================ */ void idMultiplayerGame::ClientReadWarmupTime( const idBitMsg &msg ) { - warmupEndTime = msg.ReadLong(); + warmupEndTime = msg.ReadInt(); } diff --git a/game/Player.cpp b/game/Player.cpp index 987feb5..0789286 100644 --- a/game/Player.cpp +++ b/game/Player.cpp @@ -8187,7 +8187,7 @@ void idPlayer::ReadPlayerStateFromSnapshot( const idBitMsgDelta &msg ) { int i, ammo; bobCycle = msg.ReadByte(); - stepUpTime = msg.ReadLong(); + stepUpTime = msg.ReadInt(); stepUpDelta = msg.ReadFloat(); inventory.weapons = msg.ReadShort(); inventory.armor = msg.ReadByte(); diff --git a/game/Projectile.cpp b/game/Projectile.cpp index a459b62..c353ca0 100644 --- a/game/Projectile.cpp +++ b/game/Projectile.cpp @@ -1202,7 +1202,7 @@ bool idProjectile::ClientReceiveEvent( int event, int time, const idBitMsg &msg collision.c.point[1] = msg.ReadFloat(); collision.c.point[2] = msg.ReadFloat(); collision.c.normal = msg.ReadDir( 24 ); - int index = gameLocal.ClientRemapDecl( DECL_MATERIAL, msg.ReadLong() ); + int index = gameLocal.ClientRemapDecl( DECL_MATERIAL, msg.ReadInt() ); collision.c.material = ( index != -1 ) ? static_cast( declManager->DeclByIndex( DECL_MATERIAL, index ) ) : NULL; velocity[0] = msg.ReadFloat( 5, 10 ); velocity[1] = msg.ReadFloat( 5, 10 ); diff --git a/game/Weapon.cpp b/game/Weapon.cpp index f5ee333..d889c68 100644 --- a/game/Weapon.cpp +++ b/game/Weapon.cpp @@ -2321,7 +2321,7 @@ bool idWeapon::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) { return true; } case EVENT_CHANGESKIN: { - int index = gameLocal.ClientRemapDecl( DECL_SKIN, msg.ReadLong() ); + int index = gameLocal.ClientRemapDecl( DECL_SKIN, msg.ReadInt() ); renderEntity.customSkin = ( index != -1 ) ? static_cast( declManager->DeclByIndex( DECL_SKIN, index ) ) : NULL; UpdateVisuals(); if ( worldModel.GetEntity() ) { diff --git a/game/physics/Physics_AF.cpp b/game/physics/Physics_AF.cpp index be991a4..69ea4a2 100644 --- a/game/physics/Physics_AF.cpp +++ b/game/physics/Physics_AF.cpp @@ -7971,7 +7971,7 @@ void idPhysics_AF::ReadFromSnapshot( const idBitMsgDelta &msg ) { int i, num id_attribute((unused)); idCQuat quat; - current.atRest = msg.ReadLong(); + current.atRest = msg.ReadInt(); current.noMoveTime = msg.ReadFloat(); current.activateTime = msg.ReadFloat(); current.pushVelocity[0] = msg.ReadDeltaFloat( 0.0f, AF_VELOCITY_EXPONENT_BITS, AF_VELOCITY_MANTISSA_BITS ); diff --git a/game/physics/Physics_Monster.cpp b/game/physics/Physics_Monster.cpp index f3a1606..8b74d3a 100644 --- a/game/physics/Physics_Monster.cpp +++ b/game/physics/Physics_Monster.cpp @@ -802,6 +802,6 @@ void idPhysics_Monster::ReadFromSnapshot( const idBitMsgDelta &msg ) { current.pushVelocity[0] = msg.ReadDeltaFloat( 0.0f, MONSTER_VELOCITY_EXPONENT_BITS, MONSTER_VELOCITY_MANTISSA_BITS ); current.pushVelocity[1] = msg.ReadDeltaFloat( 0.0f, MONSTER_VELOCITY_EXPONENT_BITS, MONSTER_VELOCITY_MANTISSA_BITS ); current.pushVelocity[2] = msg.ReadDeltaFloat( 0.0f, MONSTER_VELOCITY_EXPONENT_BITS, MONSTER_VELOCITY_MANTISSA_BITS ); - current.atRest = msg.ReadLong(); + current.atRest = msg.ReadInt(); current.onGround = msg.ReadBits( 1 ) != 0; } diff --git a/game/physics/Physics_Parametric.cpp b/game/physics/Physics_Parametric.cpp index ced21a3..123439c 100644 --- a/game/physics/Physics_Parametric.cpp +++ b/game/physics/Physics_Parametric.cpp @@ -1106,8 +1106,8 @@ void idPhysics_Parametric::ReadFromSnapshot( const idBitMsgDelta &msg ) { idVec3 linearStartValue, linearSpeed, linearBaseSpeed, startPos, endPos; idAngles angularStartValue, angularSpeed, angularBaseSpeed, startAng, endAng; - current.time = msg.ReadLong(); - current.atRest = msg.ReadLong(); + current.time = msg.ReadInt(); + current.atRest = msg.ReadInt(); current.origin[0] = msg.ReadFloat(); current.origin[1] = msg.ReadFloat(); current.origin[2] = msg.ReadFloat(); diff --git a/game/physics/Physics_RigidBody.cpp b/game/physics/Physics_RigidBody.cpp index e1990ef..8380656 100644 --- a/game/physics/Physics_RigidBody.cpp +++ b/game/physics/Physics_RigidBody.cpp @@ -1504,7 +1504,7 @@ idPhysics_RigidBody::ReadFromSnapshot void idPhysics_RigidBody::ReadFromSnapshot( const idBitMsgDelta &msg ) { idCQuat quat, localQuat; - current.atRest = msg.ReadLong(); + current.atRest = msg.ReadInt(); current.i.position[0] = msg.ReadFloat(); current.i.position[1] = msg.ReadFloat(); current.i.position[2] = msg.ReadFloat(); diff --git a/idlib/BitMsg.h b/idlib/BitMsg.h index cc7cfa0..cd61047 100644 --- a/idlib/BitMsg.h +++ b/idlib/BitMsg.h @@ -113,7 +113,7 @@ public: int ReadByte( void ) const; int ReadShort( void ) const; int ReadUShort( void ) const; - int ReadLong( void ) const; + int ReadInt( void ) const; float ReadFloat( void ) const; float ReadFloat( int exponentBits, int mantissaBits ) const; float ReadAngle8( void ) const; @@ -376,7 +376,7 @@ ID_INLINE int idBitMsg::ReadUShort( void ) const { return (unsigned short)ReadBits( 16 ); } -ID_INLINE int idBitMsg::ReadLong( void ) const { +ID_INLINE int idBitMsg::ReadInt( void ) const { return ReadBits( 32 ); } @@ -479,7 +479,7 @@ public: int ReadByte( void ) const; int ReadShort( void ) const; int ReadUShort( void ) const; - int ReadLong( void ) const; + int ReadInt( void ) const; float ReadFloat( void ) const; float ReadFloat( int exponentBits, int mantissaBits ) const; float ReadAngle8( void ) const; @@ -622,7 +622,7 @@ ID_INLINE int idBitMsgDelta::ReadUShort( void ) const { return (unsigned short)ReadBits( 16 ); } -ID_INLINE int idBitMsgDelta::ReadLong( void ) const { +ID_INLINE int idBitMsgDelta::ReadInt( void ) const { return ReadBits( 32 ); }