Skip to content

Commit 8fa2cc0

Browse files
committed
refactor(client): misc minor renames and changes to appease compiler
inline getstat move dir and angles inside rename overshadowed i -> j move int i inside for rename te -> tempEntity inline effects rename observerTarget inline bVisible specify ParticleEffect and ControlPoint variables rename idx rename iBuffAttachment rename outer i remove unused var tPos rename p -> p2 move int declare into for rename info -> infoNew fix i -> t fix i -> j rename i -> idx rename pMaterialWf rename msg -> kvMsg move white and blue remove duplicate fDelay rename buf ->pathBuf remove duplicate nNumHistogramBuckets rename textTall -> smallTextTall rename kv -> kvActive add scope for player helper rename matrix -> matrix2 rename i -> tail renames in bWireframe rename msg -> kvMsg rename pButton -> phButton rename pProfile -> pProfilePref rename uvScale -> uvScale2 inline GetModelType rename pEntry -> pEntry2 rename nNumShadows -> nNumBlobbyShadows rename angle -> angle_yaw/angle_pitch rename input -> x_input rename w/h -> text_w/text_h rename iRenderCache -> tail remove unused GetBounds add ifndef INFESTED_DLL for hudCloseCaption definition remove duplicated definition of fBracketTime rename entry -> repeatEntry rename target -> targetI rename entry -> repeatEntry rename pParticle/offset -> pFlameParticle/randomOffset remove unused variable offset remove second local player check remove second local base player check suppress warning p4 hides global declaration
1 parent 4da7a5f commit 8fa2cc0

40 files changed

Lines changed: 305 additions & 325 deletions

src/game/client/c_baseanimating.cpp

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,43 +1204,43 @@ void C_BaseAnimating::ParseModelEffects( KeyValues *modelKeyValues )
12041204
for ( KeyValues *pSingleEffect = pkvAllParticleEffects->GetFirstSubKey(); pSingleEffect; pSingleEffect = pSingleEffect->GetNextKey() )
12051205
{
12061206
const char *pszParticleEffect = pSingleEffect->GetString( "name", "" );
1207-
const char *pszAttachment = pSingleEffect->GetString( "attachment_point", "" );
1208-
const char *pszAttachType = pSingleEffect->GetString( "attachment_type", "" );
1209-
const char *pszAttachOffset = pSingleEffect->GetString( "attachment_offset", "" );
1207+
const char *pszPEAttachment = pSingleEffect->GetString( "attachment_point", "" );
1208+
const char *pszPEAttachType = pSingleEffect->GetString( "attachment_type", "" );
1209+
const char *pszPEAttachOffset = pSingleEffect->GetString( "attachment_offset", "" );
12101210

12111211
// Convert attach type
1212-
int iAttachType = GetAttachTypeFromString( pszAttachType );
1213-
if ( iAttachType == -1 )
1212+
int iPEAttachType = GetAttachTypeFromString( pszPEAttachType );
1213+
if ( iPEAttachType == -1 )
12141214
{
1215-
Warning("Invalid attach type specified for particle effect in model '%s' keyvalues section. Trying to spawn effect '%s' with attach type of '%s'\n", GetModelName(), pszParticleEffect, pszAttachType );
1215+
Warning("Invalid attach type specified for particle effect in model '%s' keyvalues section. Trying to spawn effect '%s' with attach type of '%s'\n", GetModelName(), pszParticleEffect, pszPEAttachType );
12161216
return;
12171217
}
12181218

12191219
// Convert attachment point
1220-
int iAttachment = atoi(pszAttachment);
1220+
int iAttachment = atoi(pszPEAttachment);
12211221
// See if we can find any attachment points matching the name
1222-
if ( pszAttachment[0] != '0' && iAttachment == 0 )
1222+
if ( pszPEAttachment[0] != '0' && iAttachment == 0 )
12231223
{
1224-
iAttachment = LookupAttachment( pszAttachment );
1224+
iAttachment = LookupAttachment( pszPEAttachment );
12251225
if ( iAttachment == -1 )
12261226
{
1227-
Warning("Failed to find attachment point specified for particle effect in model '%s' keyvalues section. Trying to spawn effect '%s' on attachment named '%s'\n", GetModelName(), pszParticleEffect, pszAttachment );
1227+
Warning("Failed to find attachment point specified for particle effect in model '%s' keyvalues section. Trying to spawn effect '%s' on attachment named '%s'\n", GetModelName(), pszParticleEffect, pszPEAttachment );
12281228
return;
12291229
}
12301230
}
12311231

1232-
Vector vecOffset = vec3_origin;
1232+
Vector vecOffsetPE = vec3_origin;
12331233

1234-
if ( pszAttachOffset )
1234+
if ( pszPEAttachOffset )
12351235
{
12361236
float flVec[3];
1237-
UTIL_StringToVector( flVec, pszAttachOffset );
1238-
vecOffset = Vector( flVec[0], flVec[1], flVec[2] );
1237+
UTIL_StringToVector( flVec, pszPEAttachOffset );
1238+
vecOffsetPE = Vector( flVec[0], flVec[1], flVec[2] );
12391239
}
12401240

12411241
CUtlReference<CNewParticleEffect> hModelEffect;
12421242
// Spawn the particle effectw
1243-
hModelEffect = ParticleProp()->Create( pszParticleEffect, (ParticleAttachment_t)iAttachType, iAttachment, vecOffset );
1243+
hModelEffect = ParticleProp()->Create( pszParticleEffect, (ParticleAttachment_t)iPEAttachType, iAttachment, vecOffsetPE );
12441244

12451245
KeyValues *pkvAllControlPoints = pSingleEffect->FindKey("ControlPoints");
12461246
if ( pkvAllControlPoints )
@@ -1249,37 +1249,37 @@ void C_BaseAnimating::ParseModelEffects( KeyValues *modelKeyValues )
12491249
for ( KeyValues *pSingleCP = pkvAllControlPoints->GetFirstSubKey(); pSingleCP; pSingleCP = pSingleCP->GetNextKey() )
12501250
{
12511251
const char *pszControlPoint = pSingleCP->GetString( "cp_number", "" );
1252-
const char *pszAttachment = pSingleCP->GetString( "attachment_point", "" );
1253-
const char *pszAttachType = pSingleCP->GetString( "attachment_type", "" );
1254-
const char *pszAttachOffset = pSingleCP->GetString( "attachment_offset", "" );
1252+
const char *pszCPAttachment = pSingleCP->GetString( "attachment_point", "" );
1253+
const char *pszCPAttachType = pSingleCP->GetString( "attachment_type", "" );
1254+
const char *pszCPAttachOffset = pSingleCP->GetString( "attachment_offset", "" );
12551255

12561256
// Convert control point
12571257
int iControlPoint = atoi(pszControlPoint);
12581258

12591259
// Convert attach type
1260-
int iAttachType = GetAttachTypeFromString( pszAttachType );
1261-
if ( iAttachType == -1 )
1260+
int iCPAttachType = GetAttachTypeFromString( pszCPAttachType );
1261+
if ( iCPAttachType == -1 )
12621262
{
1263-
Warning("Invalid attach type specified for particle effect in model '%s' keyvalues section. Trying to spawn effect '%s' with attach type of '%s'\n", GetModelName(), pszParticleEffect, pszAttachType );
1263+
Warning("Invalid attach type specified for particle effect in model '%s' keyvalues section. Trying to spawn effect '%s' with attach type of '%s'\n", GetModelName(), pszParticleEffect, pszCPAttachType );
12641264
return;
12651265
}
12661266

1267-
Vector vecOffset = vec3_origin;
1267+
Vector vecOffsetCP = vec3_origin;
12681268

1269-
if ( pszAttachOffset )
1269+
if ( pszCPAttachOffset )
12701270
{
12711271
float flVec[3];
1272-
UTIL_StringToVector( flVec, pszAttachOffset );
1273-
vecOffset = Vector( flVec[0], flVec[1], flVec[2] );
1272+
UTIL_StringToVector( flVec, pszCPAttachOffset );
1273+
vecOffsetCP = Vector( flVec[0], flVec[1], flVec[2] );
12741274
}
12751275

12761276
// Add the control point if we already have the effect
12771277
if ( hModelEffect )
12781278
{
1279-
if ( iAttachType == PATTACH_WORLDORIGIN )
1280-
ParticleProp()->AddControlPoint( hModelEffect, iControlPoint, NULL, (ParticleAttachment_t)iAttachType, NULL, vecOffset );
1279+
if ( iCPAttachType == PATTACH_WORLDORIGIN )
1280+
ParticleProp()->AddControlPoint( hModelEffect, iControlPoint, NULL, (ParticleAttachment_t)iCPAttachType, NULL, vecOffsetCP );
12811281
else
1282-
ParticleProp()->AddControlPoint( hModelEffect, iControlPoint, this, (ParticleAttachment_t)iAttachType, pszAttachment, vecOffset );
1282+
ParticleProp()->AddControlPoint( hModelEffect, iControlPoint, this, (ParticleAttachment_t)iCPAttachType, pszCPAttachment, vecOffsetCP );
12831283
}
12841284

12851285
}
@@ -3403,9 +3403,9 @@ void C_BaseAnimating::DoInternalDrawModel( ClientModelRenderInfo_t *pInfo, DrawM
34033403
if ( VPhysicsGetObject() )
34043404
{
34053405
static color32 debugColorPhys = {255,0,0,0};
3406-
matrix3x4_t matrix;
3407-
VPhysicsGetObject()->GetPositionMatrix( &matrix );
3408-
engine->DebugDrawPhysCollide( pCollide->solids[0], NULL, matrix, debugColorPhys );
3406+
matrix3x4_t matrix2;
3407+
VPhysicsGetObject()->GetPositionMatrix( &matrix2 );
3408+
engine->DebugDrawPhysCollide( pCollide->solids[0], NULL, matrix2, debugColorPhys );
34093409
}
34103410
}
34113411
}

src/game/client/c_baseflex.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,7 @@ class CFlexSceneFileManager : CAutoGameSystem
478478
Q_FixSlashes( szFilename );
479479

480480
// See if it's already loaded
481-
int i;
482-
for ( i = 0; i < m_FileList.Count(); i++ )
481+
for ( int i = 0; i < m_FileList.Count(); i++ )
483482
{
484483
CFlexSceneFile *file = m_FileList[ i ];
485484
if ( file && !V_stricmp( file->filename, szFilename ) )

src/game/client/c_baseplayer.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,7 @@ void C_BasePlayer::Spawn( void )
457457
ClearFlags();
458458
AddFlag( FL_CLIENT );
459459

460-
int effects = GetEffects() & EF_NOSHADOW;
461-
SetEffects( effects );
460+
SetEffects( GetEffects() & EF_NOSHADOW );
462461

463462
m_iFOV = 0; // init field of view.
464463

@@ -1526,17 +1525,17 @@ void C_BasePlayer::CalcChaseCamView(Vector& eyeOrigin, QAngle& eyeAngles, float&
15261525

15271526
void C_BasePlayer::CalcRoamingView(Vector& eyeOrigin, QAngle& eyeAngles, float& fov)
15281527
{
1529-
C_BaseEntity *target = GetObserverTarget();
1530-
1531-
if ( !target )
1528+
C_BaseEntity *observerTarget = GetObserverTarget();
1529+
1530+
if ( !observerTarget )
15321531
{
1533-
target = this;
1532+
observerTarget = this;
15341533
}
15351534

15361535
m_flObserverChaseDistance = 0.0;
15371536

1538-
eyeOrigin = target->EyePosition();
1539-
eyeAngles = target->EyeAngles();
1537+
eyeOrigin = observerTarget->EyePosition();
1538+
eyeAngles = observerTarget->EyeAngles();
15401539

15411540
if ( spec_track.GetInt() > 0 )
15421541
{

src/game/client/c_basetempentity.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ void C_BaseTempEntity::Precache( void )
9292
//-----------------------------------------------------------------------------
9393
void C_BaseTempEntity::PrecacheTempEnts( void )
9494
{
95-
C_BaseTempEntity *te = GetList();
96-
while ( te )
95+
C_BaseTempEntity *tempEntity = GetList();
96+
while ( tempEntity )
9797
{
98-
te->Precache();
99-
te = te->GetNext();
98+
tempEntity->Precache();
99+
tempEntity = tempEntity->GetNext();
100100
}
101101
}
102102

@@ -106,12 +106,12 @@ void C_BaseTempEntity::PrecacheTempEnts( void )
106106
void C_BaseTempEntity::ClearDynamicTempEnts( void )
107107
{
108108
C_BaseTempEntity *next;
109-
C_BaseTempEntity *te = s_pDynamicEntities;
110-
while ( te )
109+
C_BaseTempEntity *tempEntity = s_pDynamicEntities;
110+
while ( tempEntity )
111111
{
112-
next = te->GetNextDynamic();
113-
delete te;
114-
te = next;
112+
next = tempEntity->GetNextDynamic();
113+
delete tempEntity;
114+
tempEntity = next;
115115
}
116116

117117
s_pDynamicEntities = NULL;
@@ -123,20 +123,20 @@ void C_BaseTempEntity::ClearDynamicTempEnts( void )
123123
void C_BaseTempEntity::CheckDynamicTempEnts( void )
124124
{
125125
C_BaseTempEntity *next, *newlist = NULL;
126-
C_BaseTempEntity *te = s_pDynamicEntities;
127-
while ( te )
126+
C_BaseTempEntity *tempEntity = s_pDynamicEntities;
127+
while ( tempEntity )
128128
{
129-
next = te->GetNextDynamic();
130-
if ( te->ShouldDestroy() )
129+
next = tempEntity->GetNextDynamic();
130+
if ( tempEntity->ShouldDestroy() )
131131
{
132-
delete te;
132+
delete tempEntity;
133133
}
134134
else
135135
{
136-
te->m_pNextDynamic = newlist;
137-
newlist = te;
136+
tempEntity->m_pNextDynamic = newlist;
137+
newlist = tempEntity;
138138
}
139-
te = next;
139+
tempEntity = next;
140140
}
141141

142142
s_pDynamicEntities = newlist;

src/game/client/c_env_projectedtexture.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,8 @@ void C_EnvProjectedTexture::UpdateLight( void )
312312

313313
NDebugOverlay::Box( vec3_origin, mins, maxs, 0, 255, 0, 100, 0.0f );
314314
#endif
315-
316-
bool bVisible = IsBBoxVisible( mins, maxs );
317-
if (!bVisible)
315+
316+
if ( !IsBBoxVisible( mins, maxs ) )
318317
{
319318
// Spotlight's extents aren't in view
320319
if ( m_LightHandle != CLIENTSHADOW_INVALID_HANDLE )

src/game/client/c_particle_smokegrenade.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -909,12 +909,12 @@ void C_ParticleSmokeGrenade::CleanupToolRecordingState( KeyValues *msg )
909909

910910
int nId = AllocateToolParticleEffectId();
911911

912-
KeyValues *msg = new KeyValues( "OldParticleSystem_Create" );
913-
msg->SetString( "name", "C_ParticleSmokeGrenade" );
914-
msg->SetInt( "id", nId );
915-
msg->SetFloat( "time", gpGlobals->curtime );
912+
KeyValues *kvMsg = new KeyValues( "OldParticleSystem_Create" );
913+
kvMsg->SetString( "name", "C_ParticleSmokeGrenade" );
914+
kvMsg->SetInt( "id", nId );
915+
kvMsg->SetFloat( "time", gpGlobals->curtime );
916916

917-
KeyValues *pEmitter = msg->FindKey( "DmeSpriteEmitter", true );
917+
KeyValues *pEmitter = kvMsg->FindKey( "DmeSpriteEmitter", true );
918918
pEmitter->SetInt( "count", NUM_PARTICLES_PER_DIMENSION * NUM_PARTICLES_PER_DIMENSION * NUM_PARTICLES_PER_DIMENSION );
919919
pEmitter->SetFloat( "duration", 0 );
920920
pEmitter->SetString( "material", "particle/particle_smokegrenade1" );
@@ -991,8 +991,8 @@ void C_ParticleSmokeGrenade::CleanupToolRecordingState( KeyValues *msg )
991991
pSmokeGrenadeUpdater->SetFloat( "radiusExpandTime", SMOKESPHERE_EXPAND_TIME );
992992
pSmokeGrenadeUpdater->SetFloat( "cutoffFraction", 0.7f );
993993

994-
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
995-
msg->deleteThis();
994+
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, kvMsg );
995+
kvMsg->deleteThis();
996996
}
997997
}
998998

src/game/client/c_rope.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@ void CRopeManager::AddToRenderCache( C_RopeKeyframe *pRope )
234234
// If we didn't find one, then allocate the mofo.
235235
if ( iRenderCache == nRenderCacheCount )
236236
{
237-
int iRenderCache = m_aRenderCache.AddToTail();
238-
m_aRenderCache[iRenderCache].m_pSolidMaterial = pRope->GetSolidMaterial();
239-
m_aRenderCache[iRenderCache].m_nCacheCount = 0;
237+
int tail = m_aRenderCache.AddToTail();
238+
m_aRenderCache[tail].m_pSolidMaterial = pRope->GetSolidMaterial();
239+
m_aRenderCache[tail].m_nCacheCount = 0;
240240
}
241241

242242
if ( m_aRenderCache[iRenderCache].m_nCacheCount >= MAX_ROPE_RENDERCACHE )
@@ -1506,6 +1506,7 @@ struct catmull_t
15061506
};
15071507

15081508
// bake out the terms of the catmull rom spline
1509+
#pragma warning(suppress : 4459) // declaration of 'p4' hides global declaration
15091510
void Catmull_Rom_Spline_Matrix( const Vector &p1, const Vector &p2, const Vector &p3, const Vector &p4, catmull_t &output )
15101511
{
15111512
output.t3 = 0.5f * ((-1*p1) + (3*p2) + (-3*p3) + p4); // 0.5 t^3 * [ (-1*p1) + ( 3*p2) + (-3*p3) + p4 ]
@@ -1618,10 +1619,10 @@ bool C_RopeKeyframe::CalculateEndPointAttachment( C_BaseEntity *pEnt, int iAttac
16181619
if ( !pModel )
16191620
return false;
16201621

1621-
int iAttachment = pModel->LookupAttachment( "buff_attach" );
1622+
int iBuffAttachment = pModel->LookupAttachment( "buff_attach" );
16221623
if ( pAngles )
1623-
return pModel->GetAttachment( iAttachment, vPos, *pAngles );
1624-
return pModel->GetAttachment( iAttachment, vPos );
1624+
return pModel->GetAttachment( iBuffAttachment, vPos, *pAngles );
1625+
return pModel->GetAttachment( iBuffAttachment, vPos );
16251626
}
16261627
}
16271628

src/game/client/c_sceneentity.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,11 +1145,11 @@ void C_SceneEntity::PrefetchAnimBlocks( CChoreoScene *pScene )
11451145
{
11461146
// Now look up the animblock
11471147
mstudioseqdesc_t &seqdesc = pStudioHdr->pSeqdesc( iSequence );
1148-
for ( int i = 0 ; i < seqdesc.groupsize[ 0 ] ; ++i )
1148+
for ( int j = 0 ; j < seqdesc.groupsize[ 0 ] ; ++j )
11491149
{
1150-
for ( int j = 0; j < seqdesc.groupsize[ 1 ]; ++j )
1150+
for ( int k = 0; k < seqdesc.groupsize[ 1 ]; ++k )
11511151
{
1152-
int iAnimation = seqdesc.anim( i, j );
1152+
int iAnimation = seqdesc.anim( j, k );
11531153
int iBaseAnimation = pStudioHdr->iRelativeAnim( iSequence, iAnimation );
11541154
mstudioanimdesc_t &animdesc = pStudioHdr->pAnimdesc( iBaseAnimation );
11551155

@@ -1168,14 +1168,14 @@ void C_SceneEntity::PrefetchAnimBlocks( CChoreoScene *pScene )
11681168
++nResident;
11691169
if ( nSpew > 1 )
11701170
{
1171-
Msg( "%s:%s[%i:%i] was resident\n", pStudioHdr->pszName(), animdesc.pszName(), i, j );
1171+
Msg( "%s:%s[%i:%i] was resident\n", pStudioHdr->pszName(), animdesc.pszName(), j, k );
11721172
}
11731173
}
11741174
else
11751175
{
11761176
if ( nSpew != 0 )
11771177
{
1178-
Msg( "%s:%s[%i:%i] async load\n", pStudioHdr->pszName(), animdesc.pszName(), i, j );
1178+
Msg( "%s:%s[%i:%i] async load\n", pStudioHdr->pszName(), animdesc.pszName(), j, k );
11791179
}
11801180
}
11811181
}
@@ -1193,4 +1193,4 @@ void C_SceneEntity::PrefetchAnimBlocks( CChoreoScene *pScene )
11931193
return;
11941194

11951195
Msg( "%d of %d animations resident\n", nResident, nChecked );
1196-
}
1196+
}

0 commit comments

Comments
 (0)