Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/game/client/C_WaterLODControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ END_RECV_TABLE()
//------------------------------------------------------------------------------
void C_WaterLODControl::OnDataChanged(DataUpdateType_t updateType)
{
view->SetCheapWaterStartDistance( m_flCheapWaterStartDistance );
view->SetCheapWaterEndDistance( m_flCheapWaterEndDistance );
g_view->SetCheapWaterStartDistance( m_flCheapWaterStartDistance );
g_view->SetCheapWaterEndDistance( m_flCheapWaterEndDistance );
}

//------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/game/client/WaterLODMaterialProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void CWaterLODMaterialProxy::OnBind( void *pC_BaseEntity )
return;
}
float start, end;
view->GetWaterLODParams( start, end );
g_view->GetWaterLODParams( start, end );
m_pCheapWaterStartDistanceVar->SetFloatValue( start );
m_pCheapWaterEndDistanceVar->SetFloatValue( end );
}
Expand Down
6 changes: 3 additions & 3 deletions src/game/client/c_baseanimating.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2741,7 +2741,7 @@ bool C_BaseAnimating::SetupBones( matrix3x4a_t *pBoneToWorldOut, int nMaxBones,
// Prevent spammage!!!
if ( gpGlobals->realtime >= lastWarning + 1.0f )
{
DevMsgRT( "*** ERROR: Bone access not allowed (entity %i:%s)\n", index, GetClassname() );
DevMsgRT( "*** ERROR: Bone access not allowed (entity %i:%s)\n", m_index, GetClassname() );
lastWarning = gpGlobals->realtime;
}
}
Expand Down Expand Up @@ -3504,7 +3504,7 @@ int C_BaseAnimating::InternalDrawModel( int flags, const RenderableInstance_t &i
pInfo->flags = flags;
pInfo->pRenderable = this;
pInfo->instance = GetModelInstance();
pInfo->entity_index = index;
pInfo->entity_index = m_index;
pInfo->pModel = GetModel();
pInfo->origin = GetRenderOrigin();
pInfo->angles = GetRenderAngles();
Expand Down Expand Up @@ -3579,7 +3579,7 @@ void C_BaseAnimating::ProcessMuzzleFlashEvent()
GetAttachment( 1, vAttachment, dummyAngles );

// Make an elight
dlight_t *el = effects->CL_AllocElight( LIGHT_INDEX_MUZZLEFLASH + index );
dlight_t *el = g_effects->CL_AllocElight( LIGHT_INDEX_MUZZLEFLASH + m_index );
el->origin = vAttachment;
el->radius = random->RandomInt( 32, 64 );
el->decay = el->radius / 0.05f;
Expand Down
84 changes: 42 additions & 42 deletions src/game/client/c_baseentity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1139,13 +1139,13 @@ void C_BaseEntity::Clear( void )
m_hThink = INVALID_THINK_HANDLE;
m_AimEntsListHandle = INVALID_AIMENTS_LIST_HANDLE;

index = -1;
m_index = -1;
m_Collision.Init( this );
CleanUpAlphaProperty();
m_pClientAlphaProperty = static_cast< CClientAlphaProperty * >( g_pClientAlphaPropertyMgr->CreateClientAlphaProperty( this ) );
SetLocalOrigin( vec3_origin );
SetLocalAngles( vec3_angle );
model = NULL;
m_model = NULL;
m_vecAbsOrigin.Init();
m_angAbsRotation.Init();
m_vecVelocity.Init();
Expand Down Expand Up @@ -1237,8 +1237,8 @@ bool C_BaseEntity::Init( int entnum, int iSerialNum )
{
Assert( entnum >= 0 && entnum < NUM_ENT_ENTRIES );

index = entnum;
m_pClientAlphaProperty->SetDesyncOffset( index );
m_index = entnum;
m_pClientAlphaProperty->SetDesyncOffset( m_index );

cl_entitylist->AddNetworkableEntity( GetIClientUnknown(), entnum, iSerialNum );

Expand Down Expand Up @@ -1301,7 +1301,7 @@ bool C_BaseEntity::InitializeAsClientEntityByIndex( int iIndex, bool bRenderWith
// Add the client entity to the spatial partition. (Collidable)
CollisionProp()->CreatePartitionHandle();

index = -1;
m_index = -1;
m_pClientAlphaProperty->SetDesyncOffset( rand() % 1024 );

SpawnClientEntity();
Expand Down Expand Up @@ -1350,7 +1350,7 @@ void C_BaseEntity::Term()
CollisionProp()->DestroyPartitionHandle();

// If Client side only entity index will be -1
if ( index != -1 )
if ( m_index != -1 )
{
beams->KillDeadBeams( this );
}
Expand Down Expand Up @@ -1488,11 +1488,11 @@ void C_BaseEntity::SetDistanceFade( float flMinDist, float flMaxDist )
void C_BaseEntity::SetGlobalFadeScale( float flFadeScale )
{
m_flFadeScale = flFadeScale;
int modelType = modelinfo->GetModelType( model );
int modelType = modelinfo->GetModelType( m_model );
if ( modelType == mod_studio )
{
MDLCACHE_CRITICAL_SECTION();
MDLHandle_t hStudioHdr = modelinfo->GetCacheHandle( model );
MDLHandle_t hStudioHdr = modelinfo->GetCacheHandle( m_model );
if ( hStudioHdr != MDLHANDLE_INVALID )
{
const studiohdr_t *pStudioHdr = mdlcache->LockStudioHdr( hStudioHdr );
Expand Down Expand Up @@ -1703,7 +1703,7 @@ bool C_BaseEntity::ShouldDraw()
return false;
}

return (model != 0) && !IsEffectActive(EF_NODRAW) && (index != 0);
return (m_model != 0) && !IsEffectActive(EF_NODRAW) && (m_index != 0);
}

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

int modelType = modelinfo->GetModelType( model );
int modelType = modelinfo->GetModelType( m_model );
return (modelType == mod_studio) ? SHADOWS_RENDER_TO_TEXTURE : SHADOWS_NONE;
}

Expand Down Expand Up @@ -1839,7 +1839,7 @@ bool C_BaseEntity::ShouldReceiveProjectedTextures( int flags )
if ( IsEffectActive( EF_NORECEIVESHADOW ) )
return false;

if (modelinfo->GetModelType( model ) == mod_studio)
if (modelinfo->GetModelType( m_model ) == mod_studio)
return false;

return true;
Expand Down Expand Up @@ -1891,15 +1891,15 @@ IClientRenderable *C_BaseEntity::NextShadowPeer()
//-----------------------------------------------------------------------------
int C_BaseEntity::entindex( void ) const
{
return index;
return m_index;
}

int C_BaseEntity::GetSoundSourceIndex() const
{
#ifdef _DEBUG
if ( index != -1 )
if ( m_index != -1 )
{
Assert( index == GetRefEHandle().GetEntryIndex() );
Assert( m_index == GetRefEHandle().GetEntryIndex() );
}
#endif
return GetRefEHandle().GetEntryIndex();
Expand Down Expand Up @@ -1935,7 +1935,7 @@ IPVSNotify* C_BaseEntity::GetPVSNotifyInterface()
//-----------------------------------------------------------------------------
void C_BaseEntity::GetRenderBounds( Vector& theMins, Vector& theMaxs )
{
int nModelType = modelinfo->GetModelType( model );
int nModelType = modelinfo->GetModelType( m_model );
if (nModelType == mod_studio || nModelType == mod_brush)
{
modelinfo->GetModelRenderBounds( GetModel(), theMins, theMaxs );
Expand Down Expand Up @@ -2050,7 +2050,7 @@ const QAngle& C_BaseEntity::GetNetworkAngles() const
//-----------------------------------------------------------------------------
const model_t *C_BaseEntity::GetModel( void ) const
{
return model;
return m_model;
}


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

void C_BaseEntity::SetModelPointer( const model_t *pModel )
{
if ( pModel != model )
if ( pModel != m_model )
{
DestroyModelInstance();
model = pModel;
m_model = pModel;
OnNewModel();
UpdateVisibility();
}
Expand Down Expand Up @@ -2118,7 +2118,7 @@ RenderableTranslucencyType_t C_BaseEntity::ComputeTranslucencyType()
{
if ( m_bIsBlurred )
return RENDERABLE_IS_TRANSLUCENT;
return modelinfo->ComputeTranslucencyType( model, GetSkin(), GetBody() );
return modelinfo->ComputeTranslucencyType( m_model, GetSkin(), GetBody() );
}


Expand Down Expand Up @@ -2266,15 +2266,15 @@ int C_BaseEntity::DrawBrushModel( bool bSort, bool bShadowDepth )
{
VPROF_BUDGET( "C_BaseEntity::DrawBrushModel", VPROF_BUDGETGROUP_BRUSHMODEL_RENDERING );
// Identity brushes are drawn in view->DrawWorld as an optimization
Assert ( modelinfo->GetModelType( model ) == mod_brush );
Assert ( modelinfo->GetModelType( m_model ) == mod_brush );

if ( bShadowDepth )
{
render->DrawBrushModelShadowDepth( this, (model_t *)model, GetAbsOrigin(), GetAbsAngles(), bSort );
render->DrawBrushModelShadowDepth( this, (model_t *)m_model, GetAbsOrigin(), GetAbsAngles(), bSort );
}
else
{
render->DrawBrushModel( this, (model_t *)model, GetAbsOrigin(), GetAbsAngles(), bSort );
render->DrawBrushModel( this, (model_t *)m_model, GetAbsOrigin(), GetAbsAngles(), bSort );
}

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

int drawn = 0;
if ( !model )
if ( !m_model )
{
return drawn;
}

int modelType = modelinfo->GetModelType( model );
int modelType = modelinfo->GetModelType( m_model );
switch ( modelType )
{
case mod_brush:
Expand All @@ -2305,7 +2305,7 @@ int C_BaseEntity::DrawModel( int flags, const RenderableInstance_t &instance )
case mod_studio:
// All studio models must be derived from C_BaseAnimating. Issue warning.
Warning( "ERROR: Can't draw studio model %s because %s is not derived from C_BaseAnimating\n",
modelinfo->GetModelName( model ), GetClientClass()->m_pNetworkName ? GetClientClass()->m_pNetworkName : "unknown" );
modelinfo->GetModelName( m_model ), GetClientClass()->m_pNetworkName ? GetClientClass()->m_pNetworkName : "unknown" );
break;
case mod_sprite:
//drawn = DrawSprite();
Expand Down Expand Up @@ -2833,7 +2833,7 @@ void C_BaseEntity::PostDataUpdate( DataUpdateType_t updateType )
}

// If it's the world, force solid flags
if ( index == 0 )
if ( m_index == 0 )
{
m_nModelIndex = 1;
SetSolid( SOLID_BSP );
Expand Down Expand Up @@ -3261,9 +3261,9 @@ bool C_BaseEntity::Teleported( void )
//-----------------------------------------------------------------------------
bool C_BaseEntity::IsSubModel( void )
{
if ( model &&
modelinfo->GetModelType( model ) == mod_brush &&
modelinfo->GetModelName( model )[0] == '*' )
if ( m_model &&
modelinfo->GetModelType( m_model ) == mod_brush &&
modelinfo->GetModelName( m_model )[0] == '*' )
{
return true;
}
Expand All @@ -3285,7 +3285,7 @@ bool C_BaseEntity::CreateLightEffects( void )
if (IsEffectActive(EF_BRIGHTLIGHT))
{
bHasLightEffects = true;
dl = effects->CL_AllocDlight ( index );
dl = g_effects->CL_AllocDlight ( m_index );
dl->origin = GetAbsOrigin();
dl->origin[2] += 16;
dl->color.r = dl->color.g = dl->color.b = 250;
Expand All @@ -3295,7 +3295,7 @@ bool C_BaseEntity::CreateLightEffects( void )
if (IsEffectActive(EF_DIMLIGHT))
{
bHasLightEffects = true;
dl = effects->CL_AllocDlight ( index );
dl = g_effects->CL_AllocDlight ( m_index );
dl->origin = GetAbsOrigin();
dl->color.r = dl->color.g = dl->color.b = 100;
dl->radius = random->RandomFloat(200,231);
Expand All @@ -3319,7 +3319,7 @@ bool C_BaseEntity::ShouldInterpolate()
if ( IsViewEntity() )
return true;

if ( index == 0 || !GetModel() )
if ( m_index == 0 || !GetModel() )
return false;

// always interpolate if visible
Expand Down Expand Up @@ -3607,7 +3607,7 @@ void C_BaseEntity::OnDataChanged( DataUpdateType_t type )

// These may have changed in the network update
AlphaProp()->SetRenderFX( GetRenderFX(), GetRenderMode() );
AlphaProp()->SetDesyncOffset( index );
AlphaProp()->SetDesyncOffset( m_index );

// Copy in fade parameters
AlphaProp()->SetFade( m_flFadeScale, m_fadeMinDist, m_fadeMaxDist );
Expand Down Expand Up @@ -3641,14 +3641,14 @@ void C_BaseEntity::GetColorModulation( float* color )
//-----------------------------------------------------------------------------
CollideType_t C_BaseEntity::GetCollideType( void )
{
if ( !m_nModelIndex || !model )
if ( !m_nModelIndex || !m_model )
return ENTITY_SHOULD_NOT_COLLIDE;

if ( !IsSolid( ) )
return ENTITY_SHOULD_NOT_COLLIDE;

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

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

Expand Down Expand Up @@ -3738,8 +3738,8 @@ void C_BaseEntity::AddBrushModelDecal( const Ray_t& ray, const Vector& decalCent
vecNormal *= -1.0f;
}

effects->DecalShoot( decalIndex, index,
model, GetAbsOrigin(), GetAbsAngles(), decalCenter, NULL, 0, &vecNormal );
g_effects->DecalShoot( decalIndex, m_index,
m_model, GetAbsOrigin(), GetAbsAngles(), decalCenter, NULL, 0, &vecNormal );
}


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

int modelType = modelinfo->GetModelType( model );
int modelType = modelinfo->GetModelType( m_model );
switch ( modelType )
{
case mod_studio:
Expand All @@ -3780,7 +3780,7 @@ void C_BaseEntity::AddDecal( const Vector& rayStart, const Vector& rayEnd,
void C_BaseEntity::RemoveAllDecals( void )
{
// For now, we only handle removing decals from studiomodels
if ( modelinfo->GetModelType( model ) == mod_studio )
if ( modelinfo->GetModelType( m_model ) == mod_studio )
{
CreateModelInstance();
modelrender->RemoveAllDecals( m_ModelInstance );
Expand Down Expand Up @@ -4045,7 +4045,7 @@ void C_BaseEntity::SetDormant( bool bDormant )
ParticleProp()->OwnerSetDormantTo( bDormant );

OnSetDormant( bDormant );
cl_entitylist->SetDormant(index, bDormant);
cl_entitylist->SetDormant(m_index, bDormant);
}

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -4891,7 +4891,7 @@ CON_COMMAND( cl_sizeof, "Determines the size of the specified client class." )

CON_COMMAND_F( dlight_debug, "Creates a dlight in front of the player", FCVAR_CHEAT )
{
dlight_t *el = effects->CL_AllocDlight( 1 );
dlight_t *el = g_effects->CL_AllocDlight( 1 );
C_BasePlayer *player = C_BasePlayer::GetLocalPlayer();
if ( !player )
return;
Expand Down
6 changes: 3 additions & 3 deletions src/game/client/c_baseentity.h
Original file line number Diff line number Diff line change
Expand Up @@ -1387,15 +1387,15 @@ class C_BaseEntity : public IClientEntity
public:

// Determine what entity this corresponds to
int index;
int m_index;

// Entity flags that are only for the client (ENTCLIENTFLAG_ defines).
unsigned short m_EntClientFlags;

private:

// Model for rendering
const model_t *model;
const model_t *m_model;
CNetworkColor32( m_clrRender );

public:
Expand Down Expand Up @@ -1908,7 +1908,7 @@ inline const CParticleProperty *C_BaseEntity::ParticleProp() const
//-----------------------------------------------------------------------------
inline bool C_BaseEntity::IsServerEntity( void )
{
return index != -1;
return m_index != -1;
}

//-----------------------------------------------------------------------------
Expand Down
Loading