Skip to content

Commit 8f822df

Browse files
committed
refactor(client): rename model -> m_model
1 parent bdb88ed commit 8f822df

2 files changed

Lines changed: 26 additions & 26 deletions

File tree

src/game/client/c_baseentity.cpp

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ void C_BaseEntity::Clear( void )
11451145
m_pClientAlphaProperty = static_cast< CClientAlphaProperty * >( g_pClientAlphaPropertyMgr->CreateClientAlphaProperty( this ) );
11461146
SetLocalOrigin( vec3_origin );
11471147
SetLocalAngles( vec3_angle );
1148-
model = NULL;
1148+
m_model = NULL;
11491149
m_vecAbsOrigin.Init();
11501150
m_angAbsRotation.Init();
11511151
m_vecVelocity.Init();
@@ -1488,11 +1488,11 @@ void C_BaseEntity::SetDistanceFade( float flMinDist, float flMaxDist )
14881488
void C_BaseEntity::SetGlobalFadeScale( float flFadeScale )
14891489
{
14901490
m_flFadeScale = flFadeScale;
1491-
int modelType = modelinfo->GetModelType( model );
1491+
int modelType = modelinfo->GetModelType( m_model );
14921492
if ( modelType == mod_studio )
14931493
{
14941494
MDLCACHE_CRITICAL_SECTION();
1495-
MDLHandle_t hStudioHdr = modelinfo->GetCacheHandle( model );
1495+
MDLHandle_t hStudioHdr = modelinfo->GetCacheHandle( m_model );
14961496
if ( hStudioHdr != MDLHANDLE_INVALID )
14971497
{
14981498
const studiohdr_t *pStudioHdr = mdlcache->LockStudioHdr( hStudioHdr );
@@ -1703,7 +1703,7 @@ bool C_BaseEntity::ShouldDraw()
17031703
return false;
17041704
}
17051705

1706-
return (model != 0) && !IsEffectActive(EF_NODRAW) && (m_index != 0);
1706+
return (m_model != 0) && !IsEffectActive(EF_NODRAW) && (m_index != 0);
17071707
}
17081708

17091709
bool C_BaseEntity::TestCollision( const Ray_t& ray, unsigned int mask, trace_t& trace )
@@ -1760,7 +1760,7 @@ ShadowType_t C_BaseEntity::ShadowCastType()
17601760
if (IsEffectActive(EF_NODRAW | EF_NOSHADOW))
17611761
return SHADOWS_NONE;
17621762

1763-
int modelType = modelinfo->GetModelType( model );
1763+
int modelType = modelinfo->GetModelType( m_model );
17641764
return (modelType == mod_studio) ? SHADOWS_RENDER_TO_TEXTURE : SHADOWS_NONE;
17651765
}
17661766

@@ -1839,7 +1839,7 @@ bool C_BaseEntity::ShouldReceiveProjectedTextures( int flags )
18391839
if ( IsEffectActive( EF_NORECEIVESHADOW ) )
18401840
return false;
18411841

1842-
if (modelinfo->GetModelType( model ) == mod_studio)
1842+
if (modelinfo->GetModelType( m_model ) == mod_studio)
18431843
return false;
18441844

18451845
return true;
@@ -1935,7 +1935,7 @@ IPVSNotify* C_BaseEntity::GetPVSNotifyInterface()
19351935
//-----------------------------------------------------------------------------
19361936
void C_BaseEntity::GetRenderBounds( Vector& theMins, Vector& theMaxs )
19371937
{
1938-
int nModelType = modelinfo->GetModelType( model );
1938+
int nModelType = modelinfo->GetModelType( m_model );
19391939
if (nModelType == mod_studio || nModelType == mod_brush)
19401940
{
19411941
modelinfo->GetModelRenderBounds( GetModel(), theMins, theMaxs );
@@ -2050,7 +2050,7 @@ const QAngle& C_BaseEntity::GetNetworkAngles() const
20502050
//-----------------------------------------------------------------------------
20512051
const model_t *C_BaseEntity::GetModel( void ) const
20522052
{
2053-
return model;
2053+
return m_model;
20542054
}
20552055

20562056

@@ -2077,10 +2077,10 @@ void C_BaseEntity::SetModelIndex( int index )
20772077

20782078
void C_BaseEntity::SetModelPointer( const model_t *pModel )
20792079
{
2080-
if ( pModel != model )
2080+
if ( pModel != m_model )
20812081
{
20822082
DestroyModelInstance();
2083-
model = pModel;
2083+
m_model = pModel;
20842084
OnNewModel();
20852085
UpdateVisibility();
20862086
}
@@ -2118,7 +2118,7 @@ RenderableTranslucencyType_t C_BaseEntity::ComputeTranslucencyType()
21182118
{
21192119
if ( m_bIsBlurred )
21202120
return RENDERABLE_IS_TRANSLUCENT;
2121-
return modelinfo->ComputeTranslucencyType( model, GetSkin(), GetBody() );
2121+
return modelinfo->ComputeTranslucencyType( m_model, GetSkin(), GetBody() );
21222122
}
21232123

21242124

@@ -2270,11 +2270,11 @@ int C_BaseEntity::DrawBrushModel( bool bSort, bool bShadowDepth )
22702270

22712271
if ( bShadowDepth )
22722272
{
2273-
render->DrawBrushModelShadowDepth( this, (model_t *)model, GetAbsOrigin(), GetAbsAngles(), bSort );
2273+
render->DrawBrushModelShadowDepth( this, (model_t *)m_model, GetAbsOrigin(), GetAbsAngles(), bSort );
22742274
}
22752275
else
22762276
{
2277-
render->DrawBrushModel( this, (model_t *)model, GetAbsOrigin(), GetAbsAngles(), bSort );
2277+
render->DrawBrushModel( this, (model_t *)m_model, GetAbsOrigin(), GetAbsAngles(), bSort );
22782278
}
22792279

22802280
return 1;
@@ -2290,12 +2290,12 @@ int C_BaseEntity::DrawModel( int flags, const RenderableInstance_t &instance )
22902290
return 0;
22912291

22922292
int drawn = 0;
2293-
if ( !model )
2293+
if ( !m_model )
22942294
{
22952295
return drawn;
22962296
}
22972297

2298-
int modelType = modelinfo->GetModelType( model );
2298+
int modelType = modelinfo->GetModelType( m_model );
22992299
switch ( modelType )
23002300
{
23012301
case mod_brush:
@@ -2305,7 +2305,7 @@ int C_BaseEntity::DrawModel( int flags, const RenderableInstance_t &instance )
23052305
case mod_studio:
23062306
// All studio models must be derived from C_BaseAnimating. Issue warning.
23072307
Warning( "ERROR: Can't draw studio model %s because %s is not derived from C_BaseAnimating\n",
2308-
modelinfo->GetModelName( model ), GetClientClass()->m_pNetworkName ? GetClientClass()->m_pNetworkName : "unknown" );
2308+
modelinfo->GetModelName( m_model ), GetClientClass()->m_pNetworkName ? GetClientClass()->m_pNetworkName : "unknown" );
23092309
break;
23102310
case mod_sprite:
23112311
//drawn = DrawSprite();
@@ -3261,9 +3261,9 @@ bool C_BaseEntity::Teleported( void )
32613261
//-----------------------------------------------------------------------------
32623262
bool C_BaseEntity::IsSubModel( void )
32633263
{
3264-
if ( model &&
3265-
modelinfo->GetModelType( model ) == mod_brush &&
3266-
modelinfo->GetModelName( model )[0] == '*' )
3264+
if ( m_model &&
3265+
modelinfo->GetModelType( m_model ) == mod_brush &&
3266+
modelinfo->GetModelName( m_model )[0] == '*' )
32673267
{
32683268
return true;
32693269
}
@@ -3641,14 +3641,14 @@ void C_BaseEntity::GetColorModulation( float* color )
36413641
//-----------------------------------------------------------------------------
36423642
CollideType_t C_BaseEntity::GetCollideType( void )
36433643
{
3644-
if ( !m_nModelIndex || !model )
3644+
if ( !m_nModelIndex || !m_model )
36453645
return ENTITY_SHOULD_NOT_COLLIDE;
36463646

36473647
if ( !IsSolid( ) )
36483648
return ENTITY_SHOULD_NOT_COLLIDE;
36493649

36503650
// If the model is a bsp or studio (i.e. it can collide with the player
3651-
if ( ( modelinfo->GetModelType( model ) != mod_brush ) && ( modelinfo->GetModelType( model ) != mod_studio ) )
3651+
if ( ( modelinfo->GetModelType( m_model ) != mod_brush ) && ( modelinfo->GetModelType( m_model ) != mod_studio ) )
36523652
return ENTITY_SHOULD_NOT_COLLIDE;
36533653

36543654
// Don't get stuck on point sized entities ( world doesn't count )
@@ -3667,7 +3667,7 @@ CollideType_t C_BaseEntity::GetCollideType( void )
36673667
//-----------------------------------------------------------------------------
36683668
bool C_BaseEntity::IsBrushModel() const
36693669
{
3670-
int modelType = modelinfo->GetModelType( model );
3670+
int modelType = modelinfo->GetModelType( m_model );
36713671
return (modelType == mod_brush);
36723672
}
36733673

@@ -3739,7 +3739,7 @@ void C_BaseEntity::AddBrushModelDecal( const Ray_t& ray, const Vector& decalCent
37393739
}
37403740

37413741
effects->DecalShoot( decalIndex, m_index,
3742-
model, GetAbsOrigin(), GetAbsAngles(), decalCenter, NULL, 0, &vecNormal );
3742+
m_model, GetAbsOrigin(), GetAbsAngles(), decalCenter, NULL, 0, &vecNormal );
37433743
}
37443744

37453745

@@ -3756,7 +3756,7 @@ void C_BaseEntity::AddDecal( const Vector& rayStart, const Vector& rayEnd,
37563756
// Bloat a little bit so we get the intersection
37573757
ray.m_Delta *= 1.1f;
37583758

3759-
int modelType = modelinfo->GetModelType( model );
3759+
int modelType = modelinfo->GetModelType( m_model );
37603760
switch ( modelType )
37613761
{
37623762
case mod_studio:
@@ -3780,7 +3780,7 @@ void C_BaseEntity::AddDecal( const Vector& rayStart, const Vector& rayEnd,
37803780
void C_BaseEntity::RemoveAllDecals( void )
37813781
{
37823782
// For now, we only handle removing decals from studiomodels
3783-
if ( modelinfo->GetModelType( model ) == mod_studio )
3783+
if ( modelinfo->GetModelType( m_model ) == mod_studio )
37843784
{
37853785
CreateModelInstance();
37863786
modelrender->RemoveAllDecals( m_ModelInstance );

src/game/client/c_baseentity.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,7 @@ class C_BaseEntity : public IClientEntity
13951395
private:
13961396

13971397
// Model for rendering
1398-
const model_t *model;
1398+
const model_t *m_model;
13991399
CNetworkColor32( m_clrRender );
14001400

14011401
public:

0 commit comments

Comments
 (0)