diff --git a/src/game/client/C_WaterLODControl.cpp b/src/game/client/C_WaterLODControl.cpp index f77e7fd29..b97b2341f 100644 --- a/src/game/client/C_WaterLODControl.cpp +++ b/src/game/client/C_WaterLODControl.cpp @@ -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 ); } //------------------------------------------------------------------------------ diff --git a/src/game/client/WaterLODMaterialProxy.cpp b/src/game/client/WaterLODMaterialProxy.cpp index c15fb3fb0..ef7e27cb9 100644 --- a/src/game/client/WaterLODMaterialProxy.cpp +++ b/src/game/client/WaterLODMaterialProxy.cpp @@ -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 ); } diff --git a/src/game/client/c_baseanimating.cpp b/src/game/client/c_baseanimating.cpp index 52f195b3b..56b9413d7 100644 --- a/src/game/client/c_baseanimating.cpp +++ b/src/game/client/c_baseanimating.cpp @@ -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; } } @@ -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(); @@ -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; diff --git a/src/game/client/c_baseentity.cpp b/src/game/client/c_baseentity.cpp index f2816dce3..75ec56b7a 100644 --- a/src/game/client/c_baseentity.cpp +++ b/src/game/client/c_baseentity.cpp @@ -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(); @@ -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 ); @@ -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(); @@ -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 ); } @@ -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 ); @@ -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 ) @@ -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; } @@ -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; @@ -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(); @@ -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 ); @@ -2050,7 +2050,7 @@ const QAngle& C_BaseEntity::GetNetworkAngles() const //----------------------------------------------------------------------------- const model_t *C_BaseEntity::GetModel( void ) const { - return model; + return m_model; } @@ -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(); } @@ -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() ); } @@ -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; @@ -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: @@ -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(); @@ -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 ); @@ -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; } @@ -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; @@ -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); @@ -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 @@ -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 ); @@ -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 ) @@ -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); } @@ -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 ); } @@ -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: @@ -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 ); @@ -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); } //----------------------------------------------------------------------------- @@ -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; diff --git a/src/game/client/c_baseentity.h b/src/game/client/c_baseentity.h index 64e477210..b1f9adcb2 100644 --- a/src/game/client/c_baseentity.h +++ b/src/game/client/c_baseentity.h @@ -1387,7 +1387,7 @@ 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; @@ -1395,7 +1395,7 @@ class C_BaseEntity : public IClientEntity private: // Model for rendering - const model_t *model; + const model_t *m_model; CNetworkColor32( m_clrRender ); public: @@ -1908,7 +1908,7 @@ inline const CParticleProperty *C_BaseEntity::ParticleProp() const //----------------------------------------------------------------------------- inline bool C_BaseEntity::IsServerEntity( void ) { - return index != -1; + return m_index != -1; } //----------------------------------------------------------------------------- diff --git a/src/game/client/c_baseplayer.cpp b/src/game/client/c_baseplayer.cpp index c76c879a3..4f9a08922 100644 --- a/src/game/client/c_baseplayer.cpp +++ b/src/game/client/c_baseplayer.cpp @@ -688,7 +688,7 @@ void C_BasePlayer::CheckForLocalPlayer( int nSplitScreenSlot ) if ( g_nKillCamMode ) iLocalPlayerIndex = g_nKillCamTarget1; - if ( iLocalPlayerIndex == index ) + if ( iLocalPlayerIndex == m_index ) { Assert( s_pLocalPlayer[ nSplitScreenSlot ] == NULL ); s_pLocalPlayer[ nSplitScreenSlot ] = this; @@ -737,7 +737,7 @@ void C_BasePlayer::PostDataUpdate( DataUpdateType_t updateType ) FOR_EACH_VALID_SPLITSCREEN_PLAYER( i ) { int nIndex = engine->GetSplitScreenPlayer( i ); - if ( nIndex == index ) + if ( nIndex == m_index ) { nSlot = i; break; @@ -825,7 +825,7 @@ void C_BasePlayer::PostDataUpdate( DataUpdateType_t updateType ) gameeventmanager->FireEventClientSide( pEvent ); } - view->FreezeFrame(0); + g_view->FreezeFrame(0); ConVar *pVar = (ConVar *)cvar->FindVar( "snd_soundmixer" ); pVar->Revert(); @@ -1181,7 +1181,7 @@ void C_BasePlayer::UpdateFlashlight() if ( pFlashlightPlayer ) { - FlashlightEffectManager().SetEntityIndex( pFlashlightPlayer->index ); + FlashlightEffectManager().SetEntityIndex( pFlashlightPlayer->m_index ); } // The dim light is the flashlight. @@ -1194,12 +1194,12 @@ void C_BasePlayer::UpdateFlashlight() // Turned on the headlight; create it. if ( pszTextureName ) { - FlashlightEffectManager().TurnOnFlashlight( pFlashlightPlayer->index, pszTextureName, pFlashlightPlayer->GetFlashlightFOV(), + FlashlightEffectManager().TurnOnFlashlight( pFlashlightPlayer->m_index, pszTextureName, pFlashlightPlayer->GetFlashlightFOV(), pFlashlightPlayer->GetFlashlightFarZ(), pFlashlightPlayer->GetFlashlightLinearAtten() ); } else { - FlashlightEffectManager().TurnOnFlashlight( pFlashlightPlayer->index ); + FlashlightEffectManager().TurnOnFlashlight( pFlashlightPlayer->m_index ); } m_bFlashlightEnabled[ iSsPlayer ] = true; } @@ -1639,7 +1639,7 @@ void C_BasePlayer::CalcFreezeCamView( Vector& eyeOrigin, QAngle& eyeAngles, floa } m_bSentFreezeFrame = true; - view->FreezeFrame( spec_freeze_time.GetFloat() ); + g_view->FreezeFrame( spec_freeze_time.GetFloat() ); } } @@ -2002,8 +2002,8 @@ void C_BasePlayer::GetToolRecordingState( KeyValues *msg ) static CameraRecordingState_t state; state.m_flFOV = GetFOV(); - float flZNear = view->GetZNear(); - float flZFar = view->GetZFar(); + float flZNear = g_view->GetZNear(); + float flZFar = g_view->GetZFar(); CalcView( state.m_vecEyePosition, state.m_vecEyeAngles, flZNear, flZFar, state.m_flFOV ); state.m_bThirdPerson = !engine->IsPaused() && ::input->CAM_IsThirdPerson(); diff --git a/src/game/client/c_baseviewmodel.cpp b/src/game/client/c_baseviewmodel.cpp index 6e4c0786c..4a3cd07af 100644 --- a/src/game/client/c_baseviewmodel.cpp +++ b/src/game/client/c_baseviewmodel.cpp @@ -54,7 +54,7 @@ void FormatViewModelAttachment( C_BasePlayer *pPlayer, Vector &vOrigin, bool bIn Assert( nSlot != -1 ); // Presumably, SetUpView has been called so we know our FOV and render origin. - const CViewSetup *pViewSetup = view->GetPlayerViewSetup( nSlot ); + const CViewSetup *pViewSetup = g_view->GetPlayerViewSetup( nSlot ); float worldx = tan( pViewSetup->fov * M_PI/360.0 ); float viewx = tan( pViewSetup->fovViewmodel * M_PI/360.0 ); @@ -215,7 +215,7 @@ void C_BaseViewModel::ApplyBoneMatrixTransform( matrix3x4_t& transform ) // We could get MATERIAL_VIEW here, but this is called sometimes before the renderer // has set that matrix. Luckily, this is called AFTER the CViewSetup has been initialized. - const CViewSetup *pSetup = view->GetPlayerViewSetup(); + const CViewSetup *pSetup = g_view->GetPlayerViewSetup(); AngleMatrix( pSetup->angles, pSetup->origin, viewMatrixInverse ); MatrixInvert( viewMatrixInverse, viewMatrix ); diff --git a/src/game/client/c_beamspotlight.cpp b/src/game/client/c_beamspotlight.cpp index ceeb7d70d..782cb7750 100644 --- a/src/game/client/c_beamspotlight.cpp +++ b/src/game/client/c_beamspotlight.cpp @@ -337,9 +337,9 @@ void C_BeamSpotLight::ComputeRenderInfo() return; // Deal with the environment light - if ( !m_pDynamicLight || (m_pDynamicLight->key != index) ) + if ( !m_pDynamicLight || (m_pDynamicLight->key != m_index) ) { - m_pDynamicLight = effects->CL_AllocDlight( index ); + m_pDynamicLight = g_effects->CL_AllocDlight( m_index ); assert (m_pDynamicLight); } diff --git a/src/game/client/c_dynamiclight.cpp b/src/game/client/c_dynamiclight.cpp index 323abe961..890f99c95 100644 --- a/src/game/client/c_dynamiclight.cpp +++ b/src/game/client/c_dynamiclight.cpp @@ -134,14 +134,14 @@ void C_DynamicLight::ClientThink(void) if ( (m_Flags & DLIGHT_NO_MODEL_ILLUMINATION) == 0 ) { // Deal with the model light - if ( !m_pDynamicLight || (m_pDynamicLight->key != index) ) + if ( !m_pDynamicLight || (m_pDynamicLight->key != m_index) ) { #if DLIGHT_NO_WORLD_USES_ELIGHT m_pDynamicLight = ShouldBeElight() != 0 - ? effects->CL_AllocElight( index ) - : effects->CL_AllocDlight( index ); + ? g_effects->CL_AllocElight( m_index ) + : g_effects->CL_AllocDlight( m_index ); #else - m_pDynamicLight = effects->CL_AllocDlight( index ); + m_pDynamicLight = effects->CL_AllocDlight( m_index ); #endif Assert (m_pDynamicLight); m_pDynamicLight->minlight = 0; @@ -181,9 +181,9 @@ void C_DynamicLight::ClientThink(void) { // Raycast to where the endpoint goes // Deal with the environment light - if ( !m_pSpotlightEnd || (m_pSpotlightEnd->key != -index) ) + if ( !m_pSpotlightEnd || (m_pSpotlightEnd->key != -m_index) ) { - m_pSpotlightEnd = effects->CL_AllocDlight( -index ); + m_pSpotlightEnd = g_effects->CL_AllocDlight( -m_index ); Assert (m_pSpotlightEnd); } diff --git a/src/game/client/c_effects.cpp b/src/game/client/c_effects.cpp index c5a10491f..3ee8f73cb 100644 --- a/src/game/client/c_effects.cpp +++ b/src/game/client/c_effects.cpp @@ -517,7 +517,7 @@ void CClient_Precipitation::Render() if ( CurrentViewID() == VIEW_MONITOR ) return; - if ( view->GetDrawFlags() & (DF_RENDER_REFLECTION | DF_RENDER_REFRACTION) ) + if ( g_view->GetDrawFlags() & (DF_RENDER_REFLECTION | DF_RENDER_REFRACTION) ) return; if ( m_nPrecipType == PRECIPITATION_TYPE_ASH ) diff --git a/src/game/client/c_entityflame.cpp b/src/game/client/c_entityflame.cpp index 19f389649..7dcb89d8e 100644 --- a/src/game/client/c_entityflame.cpp +++ b/src/game/client/c_entityflame.cpp @@ -131,7 +131,7 @@ bool C_EntityFlame::Simulate( void ) #ifdef HL2_EPISODIC if ( IsEffectActive(EF_BRIGHTLIGHT) || IsEffectActive(EF_DIMLIGHT) ) { - dlight_t *dl = effects->CL_AllocDlight( index ); + dlight_t *dl = g_effects->CL_AllocDlight( m_index ); dl->origin = GetAbsOrigin(); dl->origin[2] += 16; dl->color.r = 254; diff --git a/src/game/client/c_env_screenoverlay.cpp b/src/game/client/c_env_screenoverlay.cpp index 3be5c6f0a..b8d5544d2 100644 --- a/src/game/client/c_env_screenoverlay.cpp +++ b/src/game/client/c_env_screenoverlay.cpp @@ -87,7 +87,7 @@ void C_EnvScreenOverlay::PostDataUpdate( DataUpdateType_t updateType ) BaseClass::PostDataUpdate( updateType ); // If we have a start time now, start the overlays going - if ( m_bIsActive && m_flStartTime > 0 && view->GetScreenOverlayMaterial() == NULL ) + if ( m_bIsActive && m_flStartTime > 0 && g_view->GetScreenOverlayMaterial() == NULL ) { StartOverlays(); } @@ -121,7 +121,7 @@ void C_EnvScreenOverlay::StopOverlays( void ) if ( m_bWasActive && !m_bIsActive ) { - view->SetScreenOverlayMaterial( NULL ); + g_view->SetScreenOverlayMaterial( NULL ); } } @@ -173,7 +173,7 @@ void C_EnvScreenOverlay::StartCurrentOverlay( void ) IMaterial *pMaterial = materials->FindMaterial( m_iszOverlayNames[m_iCurrentOverlay], TEXTURE_GROUP_CLIENT_EFFECTS, false ); if ( !IsErrorMaterial( pMaterial ) ) { - view->SetScreenOverlayMaterial( pMaterial ); + g_view->SetScreenOverlayMaterial( pMaterial ); } else { diff --git a/src/game/client/c_particle_smokegrenade.cpp b/src/game/client/c_particle_smokegrenade.cpp index 0e5ead326..aa575e745 100644 --- a/src/game/client/c_particle_smokegrenade.cpp +++ b/src/game/client/c_particle_smokegrenade.cpp @@ -605,7 +605,7 @@ void C_ParticleSmokeGrenade::Update(float fTimeDelta) void C_ParticleSmokeGrenade::UpdateDynamicLightList( const Vector &vMins, const Vector &vMaxs ) { dlight_t *lights[MAX_DLIGHTS]; - int nLights = effects->CL_GetActiveDLights( lights ); + int nLights = g_effects->CL_GetActiveDLights( lights ); m_nActiveLights = 0; for ( int i=0; i < nLights; i++ ) { diff --git a/src/game/client/c_plasma.cpp b/src/game/client/c_plasma.cpp index 75223420c..a9e63635f 100644 --- a/src/game/client/c_plasma.cpp +++ b/src/game/client/c_plasma.cpp @@ -342,7 +342,7 @@ void C_Plasma::Start( void ) m_entFlames[i].SetRenderColor( 255, 255, 255 ); m_entFlames[i].SetRenderAlpha( 255 ); m_entFlames[i].SetBrightness( 255 ); - m_entFlames[i].index = -1; + m_entFlames[i].m_index = -1; if ( i == 0 ) { @@ -364,7 +364,7 @@ void C_Plasma::Start( void ) m_entGlow.SetRenderColor( 255, 255, 255 ); m_entGlow.SetRenderAlpha( 255 ); m_entGlow.SetBrightness( 255 ); - m_entGlow.index = -1; + m_entGlow.m_index = -1; m_flGlowScale = m_flStartScale; @@ -478,7 +478,7 @@ void C_Plasma::Update( void ) int index = decalsystem->GetDecalIndexForName( "PlasmaGlowFade" ); if ( index >= 0 ) { - effects->DecalShoot( index, 0, ent->GetModel(), ent->GetAbsOrigin(), ent->GetAbsAngles(), GetAbsOrigin(), 0, 0 ); + g_effects->DecalShoot( index, 0, ent->GetModel(), ent->GetAbsOrigin(), ent->GetAbsAngles(), GetAbsOrigin(), 0, 0 ); } } } diff --git a/src/game/client/c_recipientfilter.cpp b/src/game/client/c_recipientfilter.cpp index 0c29546b5..b42e2a5ca 100644 --- a/src/game/client/c_recipientfilter.cpp +++ b/src/game/client/c_recipientfilter.cpp @@ -95,7 +95,7 @@ void C_RecipientFilter::AddRecipient( C_BasePlayer *player ) if ( !player ) return; - int index = player->index; + int index = player->m_index; // If we're predicting and this is not the first time we've predicted this sound // then don't send it to the local player again. @@ -127,7 +127,7 @@ void C_RecipientFilter::RemoveRecipient( C_BasePlayer *player ) if ( !player ) return; - int index = player->index; + int index = player->m_index; // Remove it if it's in the list m_Recipients.FindAndRemove( index ); @@ -153,7 +153,7 @@ void C_RecipientFilter::AddPlayersFromBitMask( CPlayerBitVec& playerbits ) continue; // only add the local player on client side - if ( !playerbits[ pPlayer->index ] ) + if ( !playerbits[ pPlayer->m_index ] ) continue; AddRecipient( pPlayer ); diff --git a/src/game/client/c_spotlight_end.cpp b/src/game/client/c_spotlight_end.cpp index b9007df57..b758f878d 100644 --- a/src/game/client/c_spotlight_end.cpp +++ b/src/game/client/c_spotlight_end.cpp @@ -111,9 +111,9 @@ void C_SpotlightEnd::ClientThink(void) return; // Deal with the environment light - if ( !m_pDynamicLight || (m_pDynamicLight->key != index) ) + if ( !m_pDynamicLight || (m_pDynamicLight->key != m_index) ) { - m_pDynamicLight = effects->CL_AllocDlight( index ); + m_pDynamicLight = g_effects->CL_AllocDlight( m_index ); assert (m_pDynamicLight); } @@ -128,9 +128,9 @@ void C_SpotlightEnd::ClientThink(void) VectorCopy (m_vSpotlightDir, m_pDynamicLight->m_Direction); // Deal with the model light - if ( !m_pModelLight || (m_pModelLight->key != -index) ) + if ( !m_pModelLight || (m_pModelLight->key != -m_index) ) { - m_pModelLight = effects->CL_AllocDlight( -index ); + m_pModelLight = effects->CL_AllocDlight( -m_index ); assert (m_pModelLight); } diff --git a/src/game/client/c_te.cpp b/src/game/client/c_te.cpp index c07438c73..fc4507ec5 100644 --- a/src/game/client/c_te.cpp +++ b/src/game/client/c_te.cpp @@ -673,4 +673,4 @@ class C_TempEntsSystem : public ITempEntsSystem static C_TempEntsSystem g_TESystem; // Expose to rest of engine -ITempEntsSystem *te = &g_TESystem; \ No newline at end of file +ITempEntsSystem *te = &g_TESystem; diff --git a/src/game/client/c_te_bspdecal.cpp b/src/game/client/c_te_bspdecal.cpp index a237dd024..34a8b1298 100644 --- a/src/game/client/c_te_bspdecal.cpp +++ b/src/game/client/c_te_bspdecal.cpp @@ -76,7 +76,7 @@ void TE_BSPDecal( IRecipientFilter& filter, float delay, if ( r_decals.GetInt() ) { - effects->DecalShoot( index, entity, ent->GetModel(), ent->GetAbsOrigin(), ent->GetAbsAngles(), *pos, 0, FDECAL_PERMANENT ); + g_effects->DecalShoot( index, entity, ent->GetModel(), ent->GetAbsOrigin(), ent->GetAbsAngles(), *pos, 0, FDECAL_PERMANENT ); } } @@ -97,7 +97,7 @@ void C_TEBSPDecal::PostDataUpdate( DataUpdateType_t updateType ) if ( r_decals.GetInt() ) { - effects->DecalShoot( m_nIndex, m_nEntity, ent->GetModel(), ent->GetAbsOrigin(), ent->GetAbsAngles(), m_vecOrigin, 0, FDECAL_PERMANENT ); + g_effects->DecalShoot( m_nIndex, m_nEntity, ent->GetModel(), ent->GetAbsOrigin(), ent->GetAbsAngles(), m_vecOrigin, 0, FDECAL_PERMANENT ); } } diff --git a/src/game/client/c_te_decal.cpp b/src/game/client/c_te_decal.cpp index 262a35e5d..05677c46f 100644 --- a/src/game/client/c_te_decal.cpp +++ b/src/game/client/c_te_decal.cpp @@ -108,7 +108,7 @@ static inline void RecordDecal( const Vector &pos, const Vector &start, msg->SetFloat( "starty", start.y ); msg->SetFloat( "startz", start.z ); msg->SetInt( "hitbox", hitbox ); - msg->SetString( "decalname", effects->Draw_DecalNameFromIndex( index ) ); + msg->SetString( "decalname", g_effects->Draw_DecalNameFromIndex( index ) ); ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg ); @@ -175,5 +175,5 @@ void TE_Decal( IRecipientFilter& filter, float delay, KeyValues *pKeyValues ) int nHitbox = pKeyValues->GetInt( "hitbox" ); const char *pDecalName = pKeyValues->GetString( "decalname" ); - TE_Decal( filter, 0.0f, &vecOrigin, &vecStart, 0, nHitbox, effects->Draw_DecalIndexFromName( (char*)pDecalName ) ); + TE_Decal( filter, 0.0f, &vecOrigin, &vecStart, 0, nHitbox, g_effects->Draw_DecalIndexFromName( (char*)pDecalName ) ); } diff --git a/src/game/client/c_te_dynamiclight.cpp b/src/game/client/c_te_dynamiclight.cpp index cfd5e5fb7..6092fb1f8 100644 --- a/src/game/client/c_te_dynamiclight.cpp +++ b/src/game/client/c_te_dynamiclight.cpp @@ -83,7 +83,7 @@ C_TEDynamicLight::~C_TEDynamicLight( void ) void TE_DynamicLight( IRecipientFilter& filter, float delay, const Vector* org, int r, int g, int b, int exponent, float radius, float time, float decay, int nLightIndex ) { - dlight_t *dl = effects->CL_AllocDlight( nLightIndex ); + dlight_t *dl = g_effects->CL_AllocDlight( nLightIndex ); if ( !dl ) return; diff --git a/src/game/client/c_te_footprint.cpp b/src/game/client/c_te_footprint.cpp index a100be624..584d6a5f3 100644 --- a/src/game/client/c_te_footprint.cpp +++ b/src/game/client/c_te_footprint.cpp @@ -90,7 +90,7 @@ void C_TEFootprintDecal::PostDataUpdate( DataUpdateType_t updateType ) C_BaseEntity *ent = cl_entitylist->GetEnt( m_nEntity ); if ( ent ) { - effects->DecalShoot( m_nIndex, + g_effects->DecalShoot( m_nIndex, m_nEntity, ent->GetModel(), ent->GetAbsOrigin(), ent->GetAbsAngles(), m_vecOrigin, &m_vecDirection, 0 ); } } @@ -104,7 +104,7 @@ void TE_FootprintDecal( IRecipientFilter& filter, float delay, const Vector *ori C_BaseEntity *ent = cl_entitylist->GetEnt( entity ); if ( ent ) { - effects->DecalShoot( index, entity, ent->GetModel(), ent->GetAbsOrigin(), ent->GetAbsAngles(), *origin, right, 0 ); + g_effects->DecalShoot( index, entity, ent->GetModel(), ent->GetAbsOrigin(), ent->GetAbsAngles(), *origin, right, 0 ); } } -} \ No newline at end of file +} diff --git a/src/game/client/c_te_legacytempents.cpp b/src/game/client/c_te_legacytempents.cpp index dc8c6d015..ff0981d1c 100644 --- a/src/game/client/c_te_legacytempents.cpp +++ b/src/game/client/c_te_legacytempents.cpp @@ -105,11 +105,11 @@ void C_LocalTempEntity::Prepare( model_t *pmodel, float time ) { Interp_SetupMappings( GetVarMapping() ); - index = -1; + m_index = -1; Clear(); // Use these to set per-frame and termination conditions / actions - flags = FTENT_NONE; + m_flags = FTENT_NONE; die = time + 0.75; SetModelPointer( pmodel ); SetRenderMode( kRenderNormal ); @@ -168,7 +168,7 @@ int C_LocalTempEntity::DrawStudioModel( int flags ) flags, this, MODEL_INSTANCE_INVALID, - index, + m_index, GetModel(), GetAbsOrigin(), GetAbsAngles(), @@ -192,7 +192,7 @@ int C_LocalTempEntity::DrawModel( int flags, const RenderableInstance_t &instanc return drawn; } - if ( this->flags & FTENT_BEOCCLUDED ) + if ( this->m_flags & FTENT_BEOCCLUDED ) { int nSlot = GET_ACTIVE_SPLITSCREEN_SLOT(); // Check normal @@ -249,7 +249,7 @@ bool C_LocalTempEntity::IsActive( void ) if ( life < 0 ) { - if ( flags & FTENT_FADEOUT ) + if ( m_flags & FTENT_FADEOUT ) { int alpha; if (GetRenderMode() == kRenderNormal) @@ -274,7 +274,7 @@ bool C_LocalTempEntity::IsActive( void ) } // Never die tempents only die when their die is cleared - if ( flags & FTENT_NEVERDIE ) + if ( m_flags & FTENT_NEVERDIE ) { active = (die != 0); } @@ -295,14 +295,14 @@ bool C_LocalTempEntity::Frame( float frametime, int framenumber ) m_vecTempEntVelocity = m_vecTempEntVelocity + ( m_vecTempEntAcceleration * frametime ); - if ( flags & FTENT_PLYRATTACHMENT ) + if ( m_flags & FTENT_PLYRATTACHMENT ) { if ( IClientEntity *pClient = cl_entitylist->GetClientEntity( clientIndex ) ) { SetLocalOrigin( pClient->GetAbsOrigin() + tentOffset ); } } - else if ( flags & FTENT_SINEWAVE ) + else if ( m_flags & FTENT_SINEWAVE ) { x += m_vecTempEntVelocity[0] * frametime; y += m_vecTempEntVelocity[1] * frametime; @@ -312,7 +312,7 @@ bool C_LocalTempEntity::Frame( float frametime, int framenumber ) y + sin( m_vecTempEntVelocity[2] + fastFreq + 0.7 ) * (8*m_flSpriteScale), GetLocalOriginDim( Z_INDEX ) + m_vecTempEntVelocity[2] * frametime ) ); } - else if ( flags & FTENT_SPIRAL ) + else if ( m_flags & FTENT_SPIRAL ) { float s, c; SinCos( m_vecTempEntVelocity[2] + fastFreq, &s, &c ); @@ -327,14 +327,14 @@ bool C_LocalTempEntity::Frame( float frametime, int framenumber ) SetLocalOrigin( GetLocalOrigin() + m_vecTempEntVelocity * frametime ); } - if ( flags & FTENT_SPRANIMATE ) + if ( m_flags & FTENT_SPRANIMATE ) { m_flFrame += frametime * m_flFrameRate; if ( m_flFrame >= m_flFrameMax ) { m_flFrame = m_flFrame - (int)(m_flFrame); - if ( !(flags & FTENT_SPRANIMATELOOP) ) + if ( !(m_flags & FTENT_SPRANIMATELOOP) ) { // this animating sprite isn't set to loop, so destroy it. die = 0.0f; @@ -342,7 +342,7 @@ bool C_LocalTempEntity::Frame( float frametime, int framenumber ) } } } - else if ( flags & FTENT_SPRCYCLE ) + else if ( m_flags & FTENT_SPRCYCLE ) { m_flFrame += frametime * 10; if ( m_flFrame >= m_flFrameMax ) @@ -351,17 +351,17 @@ bool C_LocalTempEntity::Frame( float frametime, int framenumber ) } } - if ( flags & FTENT_SMOKEGROWANDFADE ) + if ( m_flags & FTENT_SMOKEGROWANDFADE ) { m_flSpriteScale += frametime * 0.5f; //m_clrRender.a -= frametime * 1500; } - if ( flags & FTENT_ROTATE ) + if ( m_flags & FTENT_ROTATE ) { SetLocalAngles( GetLocalAngles() + m_vecTempEntAngVelocity * frametime ); } - else if ( flags & FTENT_ALIGNTOMOTION ) + else if ( m_flags & FTENT_ALIGNTOMOTION ) { if ( m_vecTempEntVelocity.Length() > 0.0f ) { @@ -371,7 +371,7 @@ bool C_LocalTempEntity::Frame( float frametime, int framenumber ) } } - if ( flags & (FTENT_COLLIDEALL | FTENT_COLLIDEWORLD) ) + if ( m_flags & (FTENT_COLLIDEALL | FTENT_COLLIDEWORLD) ) { Vector traceNormal; traceNormal.Init(); @@ -379,11 +379,11 @@ bool C_LocalTempEntity::Frame( float frametime, int framenumber ) trace_t trace; - if ( flags & FTENT_COLLIDEALL ) + if ( m_flags & FTENT_COLLIDEALL ) { Vector vPrevOrigin = m_vecPrevLocalOrigin; - if ( cl_fasttempentcollision.GetInt() > 0 && flags & FTENT_USEFASTCOLLISIONS ) + if ( cl_fasttempentcollision.GetInt() > 0 && m_flags & FTENT_USEFASTCOLLISIONS ) { if ( m_iLastCollisionFrame + cl_fasttempentcollision.GetInt() > gpGlobals->framecount ) { @@ -405,7 +405,7 @@ bool C_LocalTempEntity::Frame( float frametime, int framenumber ) { // If the FTENT_COLLISIONGROUP flag is set, use the entity's collision group int collisionGroup = COLLISION_GROUP_NONE; - if ( flags & FTENT_COLLISIONGROUP ) + if ( m_flags & FTENT_COLLISIONGROUP ) { collisionGroup = GetCollisionGroup(); } @@ -426,7 +426,7 @@ bool C_LocalTempEntity::Frame( float frametime, int framenumber ) m_vLastCollisionOrigin = trace.endpos; } } - else if ( flags & FTENT_COLLIDEWORLD ) + else if ( m_flags & FTENT_COLLIDEWORLD ) { CTraceFilterWorldOnly traceFilter; UTIL_TraceLine( m_vecPrevLocalOrigin, GetLocalOrigin(), MASK_SOLID, &traceFilter, &trace ); @@ -444,7 +444,7 @@ bool C_LocalTempEntity::Frame( float frametime, int framenumber ) // Damp velocity damp = bounceFactor; - if ( flags & (FTENT_GRAVITY|FTENT_SLOWGRAVITY) ) + if ( m_flags & (FTENT_GRAVITY|FTENT_SLOWGRAVITY) ) { damp *= 0.5; if ( traceNormal[2] > 0.9 ) // Hit floor? @@ -452,17 +452,17 @@ bool C_LocalTempEntity::Frame( float frametime, int framenumber ) if ( m_vecTempEntVelocity[2] <= 0 && m_vecTempEntVelocity[2] >= gravity*3 ) { damp = 0; // Stop - flags &= ~(FTENT_ROTATE|FTENT_GRAVITY|FTENT_SLOWGRAVITY|FTENT_COLLIDEWORLD|FTENT_SMOKETRAIL); + m_flags &= ~(FTENT_ROTATE|FTENT_GRAVITY|FTENT_SLOWGRAVITY|FTENT_COLLIDEWORLD|FTENT_SMOKETRAIL); SetLocalAnglesDim( X_INDEX, 0 ); SetLocalAnglesDim( Z_INDEX, 0 ); } } } - if ( flags & (FTENT_CHANGERENDERONCOLLIDE) ) + if ( m_flags & (FTENT_CHANGERENDERONCOLLIDE) ) { OnTranslucencyTypeChanged(); - flags &= ~FTENT_CHANGERENDERONCOLLIDE; + m_flags &= ~FTENT_CHANGERENDERONCOLLIDE; } if (hitSound) @@ -500,20 +500,20 @@ bool C_LocalTempEntity::Frame( float frametime, int framenumber ) } // Check for a collision and stop the particle system. - if ( flags & FTENT_CLIENTSIDEPARTICLES ) + if ( m_flags & FTENT_CLIENTSIDEPARTICLES ) { // Stop the emission of particles on collision - removed from the ClientEntityList on removal from the tempent pool. ParticleProp()->StopEmission(); m_bParticleCollision = true; } - if (flags & FTENT_COLLIDEKILL) + if (m_flags & FTENT_COLLIDEKILL) { // die on impact - flags &= ~FTENT_FADEOUT; + m_flags &= ~FTENT_FADEOUT; die = gpGlobals->curtime; } - else if ( flags & FTENT_ATTACHTOTARGET) + else if ( m_flags & FTENT_ATTACHTOTARGET) { // If we've hit the world, just stop moving if ( trace.DidHitWorld() && !( trace.surface.flags & SURF_SKY ) ) @@ -522,12 +522,12 @@ bool C_LocalTempEntity::Frame( float frametime, int framenumber ) m_vecTempEntAcceleration = vec3_origin; // Remove movement flags so we don't keep tracing - flags &= ~(FTENT_COLLIDEALL | FTENT_COLLIDEWORLD); + m_flags &= ~(FTENT_COLLIDEALL | FTENT_COLLIDEWORLD); } else { // Couldn't attach to this entity. Die. - flags &= ~FTENT_FADEOUT; + m_flags &= ~FTENT_FADEOUT; die = gpGlobals->curtime; } } @@ -552,9 +552,9 @@ bool C_LocalTempEntity::Frame( float frametime, int framenumber ) } - if ( (flags & FTENT_FLICKER) && framenumber == m_nFlickerFrame ) + if ( (m_flags & FTENT_FLICKER) && framenumber == m_nFlickerFrame ) { - dlight_t *dl = effects->CL_AllocDlight (LIGHT_INDEX_TE_DYNAMIC); + dlight_t *dl = g_effects->CL_AllocDlight (LIGHT_INDEX_TE_DYNAMIC); VectorCopy (GetLocalOrigin(), dl->origin); dl->radius = 60; dl->color.r = 255; @@ -563,7 +563,7 @@ bool C_LocalTempEntity::Frame( float frametime, int framenumber ) dl->die = gpGlobals->curtime + 0.01; } - if ( flags & FTENT_SMOKETRAIL ) + if ( m_flags & FTENT_SMOKETRAIL ) { Assert( !"FIXME: Rework smoketrail to be client side\n" ); } @@ -571,13 +571,13 @@ bool C_LocalTempEntity::Frame( float frametime, int framenumber ) // add gravity if we didn't collide in this frame if ( traceFraction == 1 ) { - if ( flags & FTENT_GRAVITY ) + if ( m_flags & FTENT_GRAVITY ) m_vecTempEntVelocity[2] += gravity; - else if ( flags & FTENT_SLOWGRAVITY ) + else if ( m_flags & FTENT_SLOWGRAVITY ) m_vecTempEntVelocity[2] += gravitySlow; } - if ( flags & FTENT_WINDBLOWN ) + if ( m_flags & FTENT_WINDBLOWN ) { Vector vecWind; GetWindspeedAtTime( gpGlobals->curtime, vecWind ); @@ -616,7 +616,7 @@ void C_LocalTempEntity::AddParticleEffect( const char *pszParticleEffect ) return; // Check to see that we don't already have a particle effect. - if ( ( flags & FTENT_CLIENTSIDEPARTICLES ) != 0 ) + if ( ( m_flags & FTENT_CLIENTSIDEPARTICLES ) != 0 ) return; // Add the entity to the ClientEntityList and create the particle system. @@ -624,7 +624,7 @@ void C_LocalTempEntity::AddParticleEffect( const char *pszParticleEffect ) ParticleProp()->Create( pszParticleEffect, PATTACH_ABSORIGIN_FOLLOW ); // Set the particle flag on the temp entity and save the name of the particle effect. - flags |= FTENT_CLIENTSIDEPARTICLES; + m_flags |= FTENT_CLIENTSIDEPARTICLES; SetParticleEffect( pszParticleEffect ); } @@ -808,7 +808,7 @@ void CTempEnts::FizzEffect( C_BaseEntity *pent, int modelIndex, int density, int if (!pTemp) return; - pTemp->flags |= FTENT_SINEWAVE; + pTemp->m_flags |= FTENT_SINEWAVE; pTemp->x = origin[0]; pTemp->y = origin[1]; @@ -859,7 +859,7 @@ void CTempEnts::Bubbles( const Vector &mins, const Vector &maxs, float height, i if (!pTemp) return; - pTemp->flags |= FTENT_SINEWAVE; + pTemp->m_flags |= FTENT_SINEWAVE; pTemp->x = origin[0]; pTemp->y = origin[1]; @@ -913,7 +913,7 @@ void CTempEnts::BubbleTrail( const Vector &start, const Vector &end, float flWat if (!pTemp) return; - pTemp->flags |= FTENT_SINEWAVE; + pTemp->m_flags |= FTENT_SINEWAVE; pTemp->x = origin[0]; pTemp->y = origin[1]; @@ -948,7 +948,7 @@ int BreakModelDrawHelper( C_LocalTempEntity *entity, int flags ) sInfo.flags = flags; sInfo.pRenderable = entity; sInfo.instance = MODEL_INSTANCE_INVALID; - sInfo.entity_index = entity->index; + sInfo.entity_index = entity->m_index; sInfo.pModel = entity->GetModel(); sInfo.origin = entity->GetRenderOrigin(); sInfo.angles = entity->GetRenderAngles(); @@ -1037,11 +1037,11 @@ void CTempEnts::BreakModel( const Vector &pos, const QAngle &angles, const Vecto pTemp->SetBody( random->RandomInt(0,frameCount-1) ); } - pTemp->flags |= FTENT_COLLIDEWORLD | FTENT_FADEOUT | FTENT_SLOWGRAVITY; + pTemp->m_flags |= FTENT_COLLIDEWORLD | FTENT_FADEOUT | FTENT_SLOWGRAVITY; if ( random->RandomInt(0,255) < 200 ) { - pTemp->flags |= FTENT_ROTATE; + pTemp->m_flags |= FTENT_ROTATE; pTemp->m_vecTempEntAngVelocity[0] = random->RandomFloat(-256,255); pTemp->m_vecTempEntAngVelocity[1] = random->RandomFloat(-256,255); pTemp->m_vecTempEntAngVelocity[2] = random->RandomFloat(-256,255); @@ -1049,7 +1049,7 @@ void CTempEnts::BreakModel( const Vector &pos, const QAngle &angles, const Vecto if ( (random->RandomInt(0,255) < 100 ) && (flags & BREAK_SMOKE) ) { - pTemp->flags |= FTENT_SMOKETRAIL; + pTemp->m_flags |= FTENT_SMOKETRAIL; } if ((flags & BREAK_GLASS) || (flags & BREAK_TRANS)) @@ -1172,7 +1172,7 @@ C_LocalTempEntity *CTempEnts::ClientProjectile( const Vector& vecOrigin, const V pTemp->SetAbsAngles( angles ); pTemp->SetAbsOrigin( vecOrigin ); pTemp->die = gpGlobals->curtime + lifetime; - pTemp->flags = FTENT_COLLIDEALL | FTENT_ATTACHTOTARGET | FTENT_ALIGNTOMOTION; + pTemp->m_flags = FTENT_COLLIDEALL | FTENT_ATTACHTOTARGET | FTENT_ALIGNTOMOTION; pTemp->clientIndex = ( pOwner != NULL ) ? pOwner->entindex() : 0; pTemp->SetOwnerEntity( pOwner ); pTemp->SetImpactEffect( pszImpactEffect ); @@ -1183,7 +1183,7 @@ C_LocalTempEntity *CTempEnts::ClientProjectile( const Vector& vecOrigin, const V pTemp->ParticleProp()->Create( pszParticleEffect, PATTACH_ABSORIGIN_FOLLOW ); // Set the particle flag on the temp entity and save the name of the particle effect. - pTemp->flags |= FTENT_CLIENTSIDEPARTICLES; + pTemp->m_flags |= FTENT_CLIENTSIDEPARTICLES; pTemp->SetParticleEffect( pszParticleEffect ); } return pTemp; @@ -1234,7 +1234,7 @@ C_LocalTempEntity *CTempEnts::TempSprite( const Vector &pos, const Vector &dir, pTemp->SetRenderColor( 255, 255, 255 ); pTemp->SetRenderAlpha( a * 255 ); - pTemp->flags |= flags; + pTemp->m_flags |= flags; pTemp->SetVelocity( dir ); pTemp->SetLocalOrigin( pos ); @@ -1298,7 +1298,7 @@ void CTempEnts::Sprite_Spray( const Vector &pos, const Vector &dir, int modelInd pTemp->SetRenderFX( kRenderFxNoDissipation ); //pTemp->scale = random->RandomFloat( 0.1, 0.25 ); pTemp->m_flSpriteScale = 0.5; - pTemp->flags |= FTENT_FADEOUT | FTENT_SLOWGRAVITY; + pTemp->m_flags |= FTENT_FADEOUT | FTENT_SLOWGRAVITY; pTemp->fadeSpeed = 2.0; // make the spittle fly the direction indicated, but mix in some noise. @@ -1360,7 +1360,7 @@ void CTempEnts::Sprite_Trail( const Vector &vecStart, const Vector &vecEnd, int if (!pTemp) return; - pTemp->flags |= FTENT_COLLIDEWORLD | FTENT_SPRCYCLE | FTENT_FADEOUT | FTENT_SLOWGRAVITY; + pTemp->m_flags |= FTENT_COLLIDEWORLD | FTENT_SPRCYCLE | FTENT_FADEOUT | FTENT_SLOWGRAVITY; Vector vecVel = vecDir * flSpeed; vecVel.x += random->RandomInt( -127,128 ) * flAmplitude; @@ -1436,14 +1436,14 @@ void CTempEnts::AttachTentToPlayer( int client, int modelIndex, float zoffset, f pTemp->tentOffset[ 1 ] = 0; pTemp->tentOffset[ 2 ] = zoffset; pTemp->die = gpGlobals->curtime + life; - pTemp->flags |= FTENT_PLYRATTACHMENT | FTENT_PERSIST; + pTemp->m_flags |= FTENT_PLYRATTACHMENT | FTENT_PERSIST; // is the model a sprite? if ( modelinfo->GetModelType( pTemp->GetModel() ) == mod_sprite ) { frameCount = modelinfo->GetModelFrameCount( pModel ); pTemp->m_flFrameMax = frameCount - 1; - pTemp->flags |= FTENT_SPRANIMATE | FTENT_SPRANIMATELOOP; + pTemp->m_flags |= FTENT_SPRANIMATE | FTENT_SPRANIMATELOOP; pTemp->m_flFrameRate = 10; } else @@ -1470,7 +1470,7 @@ void CTempEnts::KillAttachedTents( int client ) { C_LocalTempEntity *pTemp = m_TempEnts[ i ]; - if ( pTemp->flags & FTENT_PLYRATTACHMENT ) + if ( pTemp->m_flags & FTENT_PLYRATTACHMENT ) { // this TENT is player attached. // if it is attached to this client, set it to die instantly. @@ -1504,7 +1504,7 @@ void CTempEnts::RicochetSprite( const Vector &pos, model_t *pmodel, float durati pTemp->SetRenderAlpha( 200 ); pTemp->tempent_renderamt = 200; pTemp->m_flSpriteScale = scale; - pTemp->flags = FTENT_FADEOUT; + pTemp->m_flags = FTENT_FADEOUT; pTemp->SetVelocity( vec3_origin ); @@ -1541,7 +1541,7 @@ void CTempEnts::BloodSprite( const Vector &org, int r, int g, int b, int a, int pTemp->SetRenderMode( kRenderTransTexture ); pTemp->SetRenderFX( kRenderFxNone ); pTemp->m_flSpriteScale = random->RandomFloat( size / 25, size / 35); - pTemp->flags = FTENT_SPRANIMATE; + pTemp->m_flags = FTENT_SPRANIMATE; pTemp->SetRenderColor( r, g, b ); pTemp->SetRenderAlpha( a ); @@ -1592,7 +1592,7 @@ C_LocalTempEntity *CTempEnts::DefaultSprite( const Vector &pos, int spriteIndex, pTemp->m_flFrameMax = frameCount - 1; pTemp->m_flSpriteScale = 1.0; - pTemp->flags |= FTENT_SPRANIMATE; + pTemp->m_flags |= FTENT_SPRANIMATE; if ( framerate == 0 ) framerate = 10; @@ -1622,7 +1622,7 @@ void CTempEnts::Sprite_Smoke( C_LocalTempEntity *pTemp, float scale ) pTemp->SetRenderAlpha( 255 ); pTemp->SetLocalOriginDim( Z_INDEX, pTemp->GetLocalOriginDim( Z_INDEX ) + 20 ); pTemp->m_flSpriteScale = scale; - pTemp->flags = FTENT_WINDBLOWN; + pTemp->m_flags = FTENT_WINDBLOWN; } @@ -1641,7 +1641,7 @@ C_LocalTempEntity * CTempEnts::SpawnTempModel( model_t *pModel, const Vector &ve pTemp->SetAbsAngles( vecAngles ); pTemp->SetBody( 0 ); - pTemp->flags |= iFlags; + pTemp->m_flags |= iFlags; pTemp->m_vecTempEntAngVelocity[0] = random->RandomFloat(-255,255); pTemp->m_vecTempEntAngVelocity[1] = random->RandomFloat(-255,255); pTemp->m_vecTempEntAngVelocity[2] = random->RandomFloat(-255,255); @@ -1943,7 +1943,7 @@ void CTempEnts::TempEntFree( int index ) pTemp->RemoveFromLeafSystem(); // Remove the tempent from the ClientEntityList before removing it from the pool. - if ( ( pTemp->flags & FTENT_CLIENTSIDEPARTICLES ) ) + if ( ( pTemp->m_flags & FTENT_CLIENTSIDEPARTICLES ) ) { // Stop the particle emission if this hasn't happened already - collision or system timing out on its own. if ( !pTemp->m_bParticleCollision ) @@ -2189,7 +2189,7 @@ int CTempEnts::AddVisibleTempEntity( C_LocalTempEntity *pEntity ) //if ( engine->IsBoxInViewCluster( mins, maxs ) ) { // Temporary entities have no corresponding element in cl_entitylist - pEntity->index = -1; + pEntity->m_index = -1; // Add to list pEntity->AddToLeafSystem( false ); @@ -2252,12 +2252,12 @@ void CTempEnts::Update(void) // Cull to PVS (not frustum cull, just PVS) if ( !AddVisibleTempEntity( current ) ) { - if ( !( current->flags & FTENT_PERSIST ) ) + if ( !( current->m_flags & FTENT_PERSIST ) ) { // If we can't draw it this frame, just dump it. current->die = gpGlobals->curtime; // Don't fade out, just die - current->flags &= ~FTENT_FADEOUT; + current->m_flags &= ~FTENT_FADEOUT; TempEntFree( i ); } @@ -2643,7 +2643,7 @@ void CTempEnts::MuzzleFlash_Combine_NPC( ClientEntityHandle_t hEntity, int attac C_BaseEntity *pEnt = ClientEntityList().GetBaseEntityFromHandle( hEntity ); if ( pEnt ) { - dlight_t *el = effects->CL_AllocElight( LIGHT_INDEX_MUZZLEFLASH + pEnt->entindex() ); + dlight_t *el = g_effects->CL_AllocElight( LIGHT_INDEX_MUZZLEFLASH + pEnt->entindex() ); el->origin = origin; diff --git a/src/game/client/c_te_playerdecal.cpp b/src/game/client/c_te_playerdecal.cpp index ac02f6e68..377e6d240 100644 --- a/src/game/client/c_te_playerdecal.cpp +++ b/src/game/client/c_te_playerdecal.cpp @@ -225,7 +225,7 @@ void TE_PlayerDecal( IRecipientFilter& filter, float delay, } color32 rgbaColor = { 255, 255, 255, 255 }; - effects->PlayerDecalShoot( + g_effects->PlayerDecalShoot( logo, (void *)player, entity, diff --git a/src/game/client/c_te_projecteddecal.cpp b/src/game/client/c_te_projecteddecal.cpp index 60c6e8292..cdae3554d 100644 --- a/src/game/client/c_te_projecteddecal.cpp +++ b/src/game/client/c_te_projecteddecal.cpp @@ -104,7 +104,7 @@ static inline void RecordProjectDecal( const Vector &pos, const QAngle &angles, msg->SetFloat( "anglesy", angles.y ); msg->SetFloat( "anglesz", angles.z ); msg->SetFloat( "distance", flDistance ); - msg->SetString( "decalname", effects->Draw_DecalNameFromIndex( index ) ); + msg->SetString( "decalname", g_effects->Draw_DecalNameFromIndex( index ) ); ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg ); msg->deleteThis(); @@ -177,6 +177,6 @@ void TE_ProjectDecal( IRecipientFilter& filter, float delay, KeyValues *pKeyValu float flDistance = pKeyValues->GetFloat( "distance" ); const char *pDecalName = pKeyValues->GetString( "decalname" ); - TE_ProjectDecal( filter, 0.0f, &vecOrigin, &angles, flDistance, effects->Draw_DecalIndexFromName( (char*)pDecalName ) ); + TE_ProjectDecal( filter, 0.0f, &vecOrigin, &angles, flDistance, g_effects->Draw_DecalIndexFromName( (char*)pDecalName ) ); } diff --git a/src/game/client/c_te_worlddecal.cpp b/src/game/client/c_te_worlddecal.cpp index 5403853fa..e42115b04 100644 --- a/src/game/client/c_te_worlddecal.cpp +++ b/src/game/client/c_te_worlddecal.cpp @@ -86,7 +86,7 @@ static inline void RecordWorldDecal( const Vector *pos, int index ) msg->SetFloat( "originx", pos->x ); msg->SetFloat( "originy", pos->y ); msg->SetFloat( "originz", pos->z ); - msg->SetString( "decalname", effects->Draw_DecalNameFromIndex( index ) ); + msg->SetString( "decalname", g_effects->Draw_DecalNameFromIndex( index ) ); ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg ); msg->deleteThis(); @@ -106,7 +106,7 @@ void C_TEWorldDecal::PostDataUpdate( DataUpdateType_t updateType ) C_BaseEntity *ent = cl_entitylist->GetEnt( 0 ); if ( ent ) { - effects->DecalShoot( m_nIndex, 0, ent->GetModel(), ent->GetAbsOrigin(), ent->GetAbsAngles(), m_vecOrigin, 0, 0 ); + g_effects->DecalShoot( m_nIndex, 0, ent->GetModel(), ent->GetAbsOrigin(), ent->GetAbsAngles(), m_vecOrigin, 0, 0 ); } } RecordWorldDecal( &m_vecOrigin, m_nIndex ); @@ -123,7 +123,7 @@ void TE_WorldDecal( IRecipientFilter& filter, float delay, const Vector* pos, in C_BaseEntity *ent = cl_entitylist->GetEnt( 0 ); if ( ent ) { - effects->DecalShoot( index, 0, ent->GetModel(), ent->GetAbsOrigin(), ent->GetAbsAngles(), *pos, 0, 0 ); + g_effects->DecalShoot( index, 0, ent->GetModel(), ent->GetAbsOrigin(), ent->GetAbsAngles(), *pos, 0, 0 ); } } RecordWorldDecal( pos, index ); @@ -138,5 +138,5 @@ void TE_WorldDecal( IRecipientFilter& filter, float delay, KeyValues *pKeyValues vecOrigin.z = pKeyValues->GetFloat( "originz" ); const char *pDecalName = pKeyValues->GetString( "decalname" ); - TE_WorldDecal( filter, 0.0f, &vecOrigin, effects->Draw_DecalIndexFromName( (char*)pDecalName ) ); + TE_WorldDecal( filter, 0.0f, &vecOrigin, g_effects->Draw_DecalIndexFromName( (char*)pDecalName ) ); } diff --git a/src/game/client/c_team.cpp b/src/game/client/c_team.cpp index 65395496b..38f5d8139 100644 --- a/src/game/client/c_team.cpp +++ b/src/game/client/c_team.cpp @@ -186,7 +186,7 @@ C_Team *GetLocalTeam( void ) if ( !player ) return NULL; - return GetPlayersTeam( player->index ); + return GetPlayersTeam( player->m_index ); } //----------------------------------------------------------------------------- @@ -253,4 +253,4 @@ bool ArePlayersOnSameTeam( int iPlayerIndex1, int iPlayerIndex2 ) int GetNumberOfTeams( void ) { return g_Teams.Count(); -} \ No newline at end of file +} diff --git a/src/game/client/cdll_client_int.cpp b/src/game/client/cdll_client_int.cpp index 3d8a63f43..7f2dbbb85 100644 --- a/src/game/client/cdll_client_int.cpp +++ b/src/game/client/cdll_client_int.cpp @@ -148,7 +148,7 @@ extern IClientMode *GetClientModeNormal(); // IF YOU ADD AN INTERFACE, EXTERN IT IN THE HEADER FILE. IVEngineClient *engine = NULL; IVModelRender *modelrender = NULL; -IVEfx *effects = NULL; +IVEfx *g_effects = NULL; IVRenderView *render = NULL; IVDebugOverlay *debugoverlay = NULL; IMaterialSystemStub *materials_stub = NULL; @@ -1022,13 +1022,13 @@ bool InitGameSystems( CreateInterfaceFn appSystemFactory ) } // Each mod is required to implement this - view = GetViewRenderInstance(); - if ( !view ) + g_view = GetViewRenderInstance(); + if ( !g_view ) { Error( "GetViewRenderInstance() must be implemented by game." ); } - view->Init(); + g_view->Init(); for ( int hh = 0; hh < MAX_SPLITSCREEN_PLAYERS; ++hh ) { ACTIVE_SPLITSCREEN_PLAYER_GUARD_VGUI( hh ); @@ -1103,7 +1103,7 @@ int CHLClient::Init( CreateInterfaceFn appSystemFactory, CGlobalVarsBase *pGloba return false; if ( (modelrender = (IVModelRender *)appSystemFactory( VENGINE_HUDMODEL_INTERFACE_VERSION, NULL )) == NULL ) return false; - if ( (effects = (IVEfx *)appSystemFactory( VENGINE_EFFECTS_INTERFACE_VERSION, NULL )) == NULL ) + if ( (g_effects = (IVEfx *)appSystemFactory( VENGINE_EFFECTS_INTERFACE_VERSION, NULL )) == NULL ) return false; if ( (enginetrace = (IEngineTrace *)appSystemFactory( INTERFACEVERSION_ENGINETRACE_CLIENT, NULL )) == NULL ) return false; @@ -1313,7 +1313,7 @@ void CHLClient::Shutdown( void ) input->Shutdown_All(); C_BaseTempEntity::ClearDynamicTempEnts(); TermSmokeFogOverlay(); - view->Shutdown(); + g_view->Shutdown(); g_pParticleSystemMgr->UncacheAllParticleSystems(); UncacheAllMaterials(); @@ -1602,7 +1602,7 @@ void CHLClient::View_Render( vrect_t *rect ) if ( rect->width == 0 || rect->height == 0 ) return; - view->Render( rect ); + g_view->Render( rect ); UpdatePerfStats(); } @@ -1612,7 +1612,7 @@ void CHLClient::View_Render( vrect_t *rect ) //----------------------------------------------------------------------------- bool CHLClient::GetPlayerView( CViewSetup &playerView ) { - playerView = *view->GetPlayerViewSetup(); + playerView = *g_view->GetPlayerViewSetup(); return true; } @@ -1782,9 +1782,9 @@ void ConfigureCurrentSystemLevel() } C_BaseEntity::UpdateVisibilityAllEntities(); - if ( view ) + if ( g_view ) { - view->InitFadeData(); + g_view->InitFadeData(); } } @@ -1823,7 +1823,7 @@ void CHLClient::LevelInitPreEntity( char const* pMapName ) C_BaseTempEntity::ClearDynamicTempEnts(); clienteffects->Flush(); - view->LevelInit(); + g_view->LevelInit(); tempents->LevelInit(); for ( int hh = 0; hh < MAX_SPLITSCREEN_PLAYERS; ++hh ) { @@ -1948,7 +1948,7 @@ void CHLClient::LevelShutdown( void ) // Now do the post-entity shutdown of all systems IGameSystem::LevelShutdownPostEntityAllSystems(); - view->LevelShutdown(); + g_view->LevelShutdown(); beams->ClearBeams(); ParticleMgr()->RemoveAllEffects(); @@ -2431,7 +2431,7 @@ void OnRenderStart() // This will place the player + the view models + all parent // entities at the correct abs position so that their attachment points // are at the correct location - view->OnRenderStart(); + g_view->OnRenderStart(); partition->SuppressLists( PARTITION_ALL_CLIENT_EDICTS, false ); // Process OnDataChanged events. @@ -2688,7 +2688,7 @@ void CHLClient::WriteSaveGameScreenshot( const char *pFilename ) { // Single player doesn't support split screen yet!!! ACTIVE_SPLITSCREEN_PLAYER_GUARD( 0 ); - view->WriteSaveGameScreenshot( pFilename ); + g_view->WriteSaveGameScreenshot( pFilename ); } // Given a list of "S(wavname) S(wavname2)" tokens, look up the localized text and emit @@ -2824,14 +2824,14 @@ bool CHLClient::CacheReplayRagdolls( const char* pFilename, int nStartTick ) // save game screenshot writing void CHLClient::WriteSaveGameScreenshotOfSize( const char *pFilename, int width, int height ) { - view->WriteSaveGameScreenshotOfSize( pFilename, width, height ); + g_view->WriteSaveGameScreenshotOfSize( pFilename, width, height ); } // See RenderViewInfo_t void CHLClient::RenderView( const CViewSetup &setup, int nClearFlags, int whatToDraw ) { VPROF("RenderView"); - view->RenderView( setup, setup, nClearFlags, whatToDraw ); + g_view->RenderView( setup, setup, nClearFlags, whatToDraw ); } bool CHLClient::ShouldHideLoadingPlaque( void ) @@ -3049,7 +3049,7 @@ bool CHLClient::SupportsRandomMaps() #endif } -extern IViewRender *view; +extern IViewRender *g_view; //----------------------------------------------------------------------------- // Purpose: interface from materialsystem to client, currently just for recording into tools @@ -3064,7 +3064,7 @@ class CClientMaterialSystem : public IClientMaterialSystem if ( !clienttools->IsInRecordingMode() ) return HTOOLHANDLE_INVALID; - C_BaseEntity *pEnt = view->GetCurrentlyDrawingEntity(); + C_BaseEntity *pEnt = g_view->GetCurrentlyDrawingEntity(); if ( !pEnt || !pEnt->IsToolRecording() ) return HTOOLHANDLE_INVALID; diff --git a/src/game/client/cdll_client_int.h b/src/game/client/cdll_client_int.h index eae300bbc..fce0e62a5 100644 --- a/src/game/client/cdll_client_int.h +++ b/src/game/client/cdll_client_int.h @@ -64,7 +64,7 @@ enum GPUMemLevel_t; extern IVModelRender *modelrender; extern IVEngineClient *engine; extern IVModelRender *modelrender; -extern IVEfx *effects; +extern IVEfx *g_effects; extern IVRenderView *render; extern IVDebugOverlay *debugoverlay; extern IMaterialSystemStub *materials_stub; diff --git a/src/game/client/cdll_util.cpp b/src/game/client/cdll_util.cpp index b42b26ba3..960aa132f 100644 --- a/src/game/client/cdll_util.cpp +++ b/src/game/client/cdll_util.cpp @@ -371,7 +371,7 @@ void UTIL_ImpactTrace( trace_t *pTrace, int iDamageType, char *pCustomImpactName //----------------------------------------------------------------------------- int UTIL_PrecacheDecal( const char *name, bool preload ) { - return effects->Draw_DecalIndexFromName( (char*)name ); + return g_effects->Draw_DecalIndexFromName( (char*)name ); } extern int g_sModelIndexSmoke; diff --git a/src/game/client/clientleafsystem.cpp b/src/game/client/clientleafsystem.cpp index 9a2bbdc7c..4780d05b3 100644 --- a/src/game/client/clientleafsystem.cpp +++ b/src/game/client/clientleafsystem.cpp @@ -2222,7 +2222,7 @@ int CClientLeafSystem::ComputeTranslucency( int nFrameNumber, int nViewID, int n ComputeScreenFade( info, flMinLevelFadeArea, flMaxLevelFadeArea, nCount, pAlphaInfo ); float flMinViewFadeArea, flMaxViewFadeArea; - view->GetScreenFadeDistances( &flMinViewFadeArea, &flMaxViewFadeArea ); + g_view->GetScreenFadeDistances( &flMinViewFadeArea, &flMaxViewFadeArea ); ComputeScreenFade( info, flMinViewFadeArea, flMaxViewFadeArea, nCount, pAlphaInfo ); } diff --git a/src/game/client/clientshadowmgr.cpp b/src/game/client/clientshadowmgr.cpp index 31134b7e4..90bb103d9 100644 --- a/src/game/client/clientshadowmgr.cpp +++ b/src/game/client/clientshadowmgr.cpp @@ -5768,7 +5768,7 @@ void CClientShadowMgr::ComputeShadowDepthTextures( const CViewSetup &viewSetup ) shadowView.m_bRenderFlashlightDepthTranslucents = flashlightState.m_bGlobalLight; // Render to the shadow depth texture with appropriate view - view->UpdateShadowDepthTexture( m_DummyColorTexture, shadowDepthTexture, shadowView ); + g_view->UpdateShadowDepthTexture( m_DummyColorTexture, shadowDepthTexture, shadowView ); // Associate the shadow depth texture and stencil bit with the flashlight for use during scene rendering shadowmgr->SetFlashlightDepthTexture( shadow.m_ShadowHandle, shadowDepthTexture, 0 ); diff --git a/src/game/client/fx.cpp b/src/game/client/fx.cpp index e69d254b0..f98ea8b60 100644 --- a/src/game/client/fx.cpp +++ b/src/game/client/fx.cpp @@ -1223,7 +1223,7 @@ void FX_BuildTeslaHitbox( // Create an elight to illuminate the target if ( pEntity != NULL ) { - dlight_t *el = effects->CL_AllocElight( LIGHT_INDEX_TE_DYNAMIC + pEntity->entindex() ); + dlight_t *el = g_effects->CL_AllocElight( LIGHT_INDEX_TE_DYNAMIC + pEntity->entindex() ); // Randomly place it el->origin = pEntity->WorldSpaceCenter() + RandomVector( -32, 32 ); diff --git a/src/game/client/fx_explosion.cpp b/src/game/client/fx_explosion.cpp index eb3f5cf29..368a1c96c 100644 --- a/src/game/client/fx_explosion.cpp +++ b/src/game/client/fx_explosion.cpp @@ -728,7 +728,7 @@ void C_BaseExplosionEffect::CreateDynamicLight( void ) { if ( m_fFlags & TE_EXPLFLAG_DLIGHT ) { - dlight_t *dl = effects->CL_AllocDlight( 0 ); + dlight_t *dl = g_effects->CL_AllocDlight( 0 ); VectorCopy (m_vecOrigin, dl->origin); diff --git a/src/game/client/fx_sparks.cpp b/src/game/client/fx_sparks.cpp index 3102606bc..80680a599 100644 --- a/src/game/client/fx_sparks.cpp +++ b/src/game/client/fx_sparks.cpp @@ -1369,7 +1369,7 @@ void FX_ConcussiveExplosion( Vector &origin, Vector &normal ) // Dlight // - dlight_t *dl= effects->CL_AllocDlight ( 0 ); + dlight_t *dl= g_effects->CL_AllocDlight ( 0 ); dl->origin = offset; dl->color.r = dl->color.g = dl->color.b = 64; diff --git a/src/game/client/glow_overlay.cpp b/src/game/client/glow_overlay.cpp index 38d6743f2..4dc49266f 100644 --- a/src/game/client/glow_overlay.cpp +++ b/src/game/client/glow_overlay.cpp @@ -201,7 +201,7 @@ void CGlowOverlay::UpdateGlowObstruction( const Vector &vToGlow, bool bCacheFull { if ( m_bInSky ) { - const CViewSetup *pViewSetup = view->GetViewSetup(); + const CViewSetup *pViewSetup = g_view->GetViewSetup(); Vector pos = CurrentViewOrigin() + m_vDirection * (pViewSetup->zFar * 0.999f); pixelvis_queryparams_t params; params.Init( pos, m_flProxyRadius, CalcGlowAspect() ); @@ -383,7 +383,7 @@ void CGlowOverlay::Draw( bool bCacheFullSceneState ) //Get our diagonal radius float radius = (vRight+vUp).Length(); - if ( R_CullSphere( view->GetFrustum(), 5, &vBasePt, radius ) ) + if ( R_CullSphere( g_view->GetFrustum(), 5, &vBasePt, radius ) ) continue; // Get our material (deferred default load) diff --git a/src/game/client/hl2/c_npc_combinegunship.cpp b/src/game/client/hl2/c_npc_combinegunship.cpp index 42fc7e45a..6d4653ba8 100644 --- a/src/game/client/hl2/c_npc_combinegunship.cpp +++ b/src/game/client/hl2/c_npc_combinegunship.cpp @@ -321,7 +321,7 @@ int C_GunshipFX::DrawModel( int, const RenderableInstance_t &instance ) if ( hasParam[GUNSHIPFX_AFTERGLOW_COLOR] ) { // Muzzle effect - dlight_t *dl = effects->CL_AllocDlight( m_entityIndex ); + dlight_t *dl = g_effects->CL_AllocDlight( m_entityIndex ); dl->origin = m_worldPosition; dl->color.r = 40*params[GUNSHIPFX_AFTERGLOW_COLOR].x; dl->color.g = 60*params[GUNSHIPFX_AFTERGLOW_COLOR].x; diff --git a/src/game/client/hl2/c_strider.cpp b/src/game/client/hl2/c_strider.cpp index e6c28fd79..d0e4b2879 100644 --- a/src/game/client/hl2/c_strider.cpp +++ b/src/game/client/hl2/c_strider.cpp @@ -598,7 +598,7 @@ int C_StriderFX::DrawModel( int ) pRenderContext->Bind( pMat, (IClientRenderable*)this ); Strider_DrawSprite( m_worldPosition, size, color ); - dlight_t *dl = effects->CL_AllocDlight( m_entityIndex ); + dlight_t *dl = g_effects->CL_AllocDlight( m_entityIndex ); dl->origin = m_worldPosition; dl->color.r = 40; dl->color.g = 60; @@ -926,7 +926,7 @@ void MuzzleFlash_Strider( ClientEntityHandle_t hEntity, int attachmentIndex ) int entityIndex = ClientEntityList().HandleToEntIndex( hEntity ); if ( entityIndex >= 0 ) { - dlight_t *el = effects->CL_AllocElight( LIGHT_INDEX_MUZZLEFLASH + entityIndex ); + dlight_t *el = g_effects->CL_AllocElight( LIGHT_INDEX_MUZZLEFLASH + entityIndex ); el->origin = origin; diff --git a/src/game/client/hl2/fx_hl2_tracers.cpp b/src/game/client/hl2/fx_hl2_tracers.cpp index 306c154f2..98814ebfe 100644 --- a/src/game/client/hl2/fx_hl2_tracers.cpp +++ b/src/game/client/hl2/fx_hl2_tracers.cpp @@ -269,7 +269,7 @@ void AR2TracerCallback( const CEffectData &data ) bool bWhiz = (data.m_fFlags & TRACER_FLAG_WHIZ); int iEntIndex = data.entindex(); - if ( iEntIndex && iEntIndex == player->index ) + if ( iEntIndex && iEntIndex == player->m_index ) { Vector foo = data.m_vStart; QAngle vangles; @@ -411,7 +411,7 @@ void CreateMuzzleflashELight( const Vector &origin, int exponent, int nMinRadius int entityIndex = ClientEntityList().HandleToEntIndex( hEntity ); if ( entityIndex >= 0 ) { - dlight_t *el = effects->CL_AllocElight( LIGHT_INDEX_MUZZLEFLASH + entityIndex ); + dlight_t *el = g_effects->CL_AllocElight( LIGHT_INDEX_MUZZLEFLASH + entityIndex ); el->origin = origin; @@ -669,7 +669,7 @@ void MuzzleFlash_Hunter( ClientEntityHandle_t hEntity, int attachmentIndex ) Vector origin; MatrixGetColumn( matAttachment, 3, &origin ); - dlight_t *el = effects->CL_AllocElight( LIGHT_INDEX_MUZZLEFLASH ); + dlight_t *el = g_effects->CL_AllocElight( LIGHT_INDEX_MUZZLEFLASH ); el->origin = origin;// + Vector( 12.0f, 0, 0 ); el->color.r = 50; diff --git a/src/game/client/in_joystick.cpp b/src/game/client/in_joystick.cpp index d9e490e28..4a3bcee2d 100644 --- a/src/game/client/in_joystick.cpp +++ b/src/game/client/in_joystick.cpp @@ -1002,14 +1002,14 @@ void CInput::JoyStickTurn( CUserCmd *cmd, float &yaw, float &pitch, float framet } viewangles[PITCH] += angle_pitch; cmd->mousedy = angle_pitch; - view->StopPitchDrift(); + g_view->StopPitchDrift(); if ( pitch == 0.f && lookspring.GetFloat() == 0.f ) { // no pitch movement // disable pitch return-to-center unless requested by user // *** this code can be removed when the lookspring bug is fixed // *** the bug always has the lookspring feature on - view->StopPitchDrift(); + g_view->StopPitchDrift(); } } diff --git a/src/game/client/in_main.cpp b/src/game/client/in_main.cpp index b504dcdfd..4f8a62c98 100644 --- a/src/game/client/in_main.cpp +++ b/src/game/client/in_main.cpp @@ -807,7 +807,7 @@ void CInput::AdjustPitch( int nSlot, float speed, QAngle& viewangles ) if ( in_klook.GetPerUser( nSlot ).state & 1 ) { - view->StopPitchDrift (); + g_view->StopPitchDrift (); viewangles[PITCH] -= speed*cl_pitchspeed.GetFloat() * KeyState (&in_forward); viewangles[PITCH] += speed*cl_pitchspeed.GetFloat() * KeyState (&in_back); } @@ -820,7 +820,7 @@ void CInput::AdjustPitch( int nSlot, float speed, QAngle& viewangles ) if ( up || down ) { - view->StopPitchDrift (); + g_view->StopPitchDrift (); } } } diff --git a/src/game/client/in_mouse.cpp b/src/game/client/in_mouse.cpp index 25294a6ee..98a1a539e 100644 --- a/src/game/client/in_mouse.cpp +++ b/src/game/client/in_mouse.cpp @@ -613,7 +613,7 @@ void CInput::MouseMove( int nSlot, CUserCmd *cmd ) CheckMouseAcclerationVars(); // Don't drift pitch at all while mouselooking. - view->StopPitchDrift (); + g_view->StopPitchDrift (); //jjb - this disables normal mouse control if the user is trying to // move the camera, or if the mouse cursor is visible @@ -728,4 +728,4 @@ void CInput::ClearStates (void) GetPerUser().m_flAccumulatedMouseXMovement = 0; GetPerUser().m_flAccumulatedMouseYMovement = 0; } -} \ No newline at end of file +} diff --git a/src/game/client/iviewrender.h b/src/game/client/iviewrender.h index 2d19e0f49..c60208fb9 100644 --- a/src/game/client/iviewrender.h +++ b/src/game/client/iviewrender.h @@ -146,7 +146,7 @@ abstract_class IViewRender virtual void InitFadeData( void ) = 0; }; -extern IViewRender *view; +extern IViewRender *g_view; extern IViewRender *GetViewRenderInstance(); diff --git a/src/game/client/particlemgr.cpp b/src/game/client/particlemgr.cpp index 88fd55485..f08374233 100644 --- a/src/game/client/particlemgr.cpp +++ b/src/game/client/particlemgr.cpp @@ -1657,7 +1657,7 @@ bool CParticleMgr::EarlyRetireParticleSystems( int nCount, CNewParticleEffect ** VMatrix worldToScreen[ MAX_SPLITSCREEN_PLAYERS ]; FOR_EACH_VALID_SPLITSCREEN_PLAYER( hh ) { - pViewSetup[ hh ] = view->GetPlayerViewSetup( hh ); + pViewSetup[ hh ] = g_view->GetPlayerViewSetup( hh ); if ( pViewSetup[ hh ]->width == 0 || pViewSetup[ hh ]->height == 0 ) return false; } diff --git a/src/game/client/swarm/asw_room_thumbnails.cpp b/src/game/client/swarm/asw_room_thumbnails.cpp index 3874bfd12..77e7d096a 100644 --- a/src/game/client/swarm/asw_room_thumbnails.cpp +++ b/src/game/client/swarm/asw_room_thumbnails.cpp @@ -66,7 +66,7 @@ static void TakeRoomThumbnailSnapshot( CRoomThumbnail *pRoom ) CViewSetup setup; SetupThumbnailView( setup, pRoom ); - view->RenderView( setup, setup, VIEW_CLEAR_COLOR | VIEW_CLEAR_DEPTH | VIEW_CLEAR_FULL_TARGET, 0 ); + g_view->RenderView( setup, setup, VIEW_CLEAR_COLOR | VIEW_CLEAR_DEPTH | VIEW_CLEAR_FULL_TARGET, 0 ); unsigned char *pImage = ( unsigned char * )malloc( setup.width * 3 * setup.height ); @@ -149,4 +149,4 @@ CON_COMMAND( asw_buildroomthumbnails, "Outputs room thumbnail TGAs for all rooms thumbnails.PurgeAndDeleteElements(); pKV->deleteThis(); } -#endif // DEDICATED \ No newline at end of file +#endif // DEDICATED diff --git a/src/game/client/swarm/c_asw_aoegrenade_projectile.cpp b/src/game/client/swarm/c_asw_aoegrenade_projectile.cpp index b86731dd2..4317f017b 100644 --- a/src/game/client/swarm/c_asw_aoegrenade_projectile.cpp +++ b/src/game/client/swarm/c_asw_aoegrenade_projectile.cpp @@ -381,7 +381,7 @@ void C_ASW_AOEGrenade_Projectile::ClientThink( void ) { if ( !m_pDLight ) { - m_pDLight = effects->CL_AllocDlight( index ); + m_pDLight = g_effects->CL_AllocDlight( m_index ); Color rgbaGrenadeColor = GetGrenadeColor(); diff --git a/src/game/client/swarm/c_asw_dynamic_light.cpp b/src/game/client/swarm/c_asw_dynamic_light.cpp index 9abbcb3ed..4271d9f00 100644 --- a/src/game/client/swarm/c_asw_dynamic_light.cpp +++ b/src/game/client/swarm/c_asw_dynamic_light.cpp @@ -46,9 +46,9 @@ void C_ASW_DynamicLight::ClientThink( void ) { if ( ( m_Flags & ( DLIGHT_NO_WORLD_ILLUMINATION | DLIGHT_NO_MODEL_ILLUMINATION ) ) != ( DLIGHT_NO_WORLD_ILLUMINATION | DLIGHT_NO_MODEL_ILLUMINATION ) ) { - if ( !m_pDynamicLight || m_pDynamicLight->key != ASW_LIGHT_INDEX_FIRES + index ) + if ( !m_pDynamicLight || m_pDynamicLight->key != ASW_LIGHT_INDEX_FIRES + m_index ) { - m_pDynamicLight = effects->CL_AllocDlight( ASW_LIGHT_INDEX_FIRES + index ); + m_pDynamicLight = g_effects->CL_AllocDlight( ASW_LIGHT_INDEX_FIRES + m_index ); } m_pDynamicLight->color.b = GetRenderColorB(); m_pDynamicLight->color.g = GetRenderColorG(); diff --git a/src/game/client/swarm/c_asw_flamer_projectile.cpp b/src/game/client/swarm/c_asw_flamer_projectile.cpp index c1deed7cc..42f4cb727 100644 --- a/src/game/client/swarm/c_asw_flamer_projectile.cpp +++ b/src/game/client/swarm/c_asw_flamer_projectile.cpp @@ -36,7 +36,7 @@ C_ASW_Flamer_Projectile::~C_ASW_Flamer_Projectile() void C_ASW_Flamer_Projectile::CreateLight() { - m_pDynamicLight = effects->CL_AllocDlight( index ); + m_pDynamicLight = g_effects->CL_AllocDlight( m_index ); m_pDynamicLight->origin = GetAbsOrigin(); m_pDynamicLight->radius = 61.6 * asw_flamer_light_scale.GetFloat(); m_pDynamicLight->decay = 0 / 0.05f; @@ -74,4 +74,4 @@ void C_ASW_Flamer_Projectile::OnDataChanged(DataUpdateType_t updateType) SetNextClientThink(CLIENT_THINK_ALWAYS); } BaseClass::OnDataChanged(updateType); -} \ No newline at end of file +} diff --git a/src/game/client/swarm/c_asw_flare_projectile.cpp b/src/game/client/swarm/c_asw_flare_projectile.cpp index 62661f37f..49401d9ba 100644 --- a/src/game/client/swarm/c_asw_flare_projectile.cpp +++ b/src/game/client/swarm/c_asw_flare_projectile.cpp @@ -178,7 +178,7 @@ void C_ASW_Flare_Projectile::ClientThink( void ) } if (!m_pDLight) { - m_pDLight = effects->CL_AllocDlight( index ); + m_pDLight = g_effects->CL_AllocDlight( m_index ); m_pDLight->color.r = asw_flare_r.GetInt(); m_pDLight->color.g = asw_flare_g.GetInt(); m_pDLight->color.b = asw_flare_b.GetInt(); diff --git a/src/game/client/swarm/c_asw_marine.cpp b/src/game/client/swarm/c_asw_marine.cpp index 4e9b69c6d..e26eb2d99 100644 --- a/src/game/client/swarm/c_asw_marine.cpp +++ b/src/game/client/swarm/c_asw_marine.cpp @@ -1128,7 +1128,7 @@ void C_ASW_Marine::ProcessMuzzleFlashEvent() // If we have an attachment, then stick a light on it. if ( bFoundAttachment ) { - dlight_t *el = effects->CL_AllocDlight( LIGHT_INDEX_MUZZLEFLASH + index ); + dlight_t *el = effects->CL_AllocDlight( LIGHT_INDEX_MUZZLEFLASH + m_index ); el->origin = vector; el->radius = 70; el->decay = el->radius / 0.05f; @@ -1537,7 +1537,7 @@ void C_ASW_Marine::UpdateFlashlight() if ( !m_pFlashlight ) { // Turned on the headlight; create it. - m_pFlashlight = new CFlashlightEffect(index); + m_pFlashlight = new CFlashlightEffect(m_index); if (!m_pFlashlight) return; @@ -1547,9 +1547,9 @@ void C_ASW_Marine::UpdateFlashlight() //#ifdef ASW_FLASHLIGHT_DLIGHT if (rd_flashlight_dlight_enable.GetBool()) { - if (!m_pFlashlightDLight || (m_pFlashlightDLight->key != index)) + if (!m_pFlashlightDLight || (m_pFlashlightDLight->key != m_index)) { - m_pFlashlightDLight = effects->CL_AllocDlight(index); + m_pFlashlightDLight = g_effects->CL_AllocDlight(m_index); } } //#endif diff --git a/src/game/client/swarm/c_asw_mesh_emitter_entity.cpp b/src/game/client/swarm/c_asw_mesh_emitter_entity.cpp index 0e614889e..5cbc1d355 100644 --- a/src/game/client/swarm/c_asw_mesh_emitter_entity.cpp +++ b/src/game/client/swarm/c_asw_mesh_emitter_entity.cpp @@ -211,7 +211,7 @@ int C_ASW_Mesh_Emitter::InternalDrawModel( int flags, const RenderableInstance_t sInfo.flags = flags; sInfo.pRenderable = this; sInfo.instance = GetModelInstance(); - sInfo.entity_index = index; + sInfo.entity_index = m_index; sInfo.pModel = GetModel(); sInfo.origin = GetRenderOrigin(); sInfo.angles = GetRenderAngles(); @@ -272,7 +272,7 @@ int C_ASW_Mesh_Emitter::DrawParticle(Vector &vecPos) sInfo.flags = STUDIO_RENDER; sInfo.pRenderable = this; sInfo.instance = GetModelInstance(); - sInfo.entity_index = index; + sInfo.entity_index = m_index; sInfo.pModel = GetModel(); sInfo.origin = vecPos; sInfo.angles = QAngle(0,0,0); @@ -293,4 +293,4 @@ void C_ASW_Mesh_Emitter::GetRenderBounds( Vector& theMins, Vector& theMaxs ) return; } BaseClass::GetRenderBounds(theMins, theMaxs); -} \ No newline at end of file +} diff --git a/src/game/client/swarm/c_asw_player.cpp b/src/game/client/swarm/c_asw_player.cpp index 072a54471..804a5fc57 100644 --- a/src/game/client/swarm/c_asw_player.cpp +++ b/src/game/client/swarm/c_asw_player.cpp @@ -1271,7 +1271,7 @@ void C_ASW_Player::ClientThink() if ( asw_dlight_list.GetBool() ) { dlight_t *lights[MAX_DLIGHTS]; - int nLights = effects->CL_GetActiveDLights( lights ); + int nLights = g_effects->CL_GetActiveDLights( lights ); for ( int i = 0; i < MAX_DLIGHTS; i++ ) { if ( i >= nLights ) @@ -2704,7 +2704,7 @@ void C_ASW_Player::UpdateLocalMarineGlow() { if ( !m_pLocalMarineGlow ) { - m_pLocalMarineGlow = effects->CL_AllocDlight( index ); + m_pLocalMarineGlow = g_effects->CL_AllocDlight( m_index ); } if ( m_pLocalMarineGlow ) diff --git a/src/game/client/swarm/c_asw_weapon.cpp b/src/game/client/swarm/c_asw_weapon.cpp index 9d28f6bf6..47a008576 100644 --- a/src/game/client/swarm/c_asw_weapon.cpp +++ b/src/game/client/swarm/c_asw_weapon.cpp @@ -445,7 +445,7 @@ void C_ASW_Weapon::ProcessMuzzleFlashEvent() if ( GetAttachment( GetMuzzleAttachment(), vAttachment, dummyAngles ) ) { // Make an elight - dlight_t *el = effects->CL_AllocDlight( LIGHT_INDEX_MUZZLEFLASH + index ); + dlight_t *el = g_effects->CL_AllocDlight( LIGHT_INDEX_MUZZLEFLASH + m_index ); el->origin = vAttachment; el->radius = random->RandomFloat( asw_muzzle_light_radius_min.GetFloat(), asw_muzzle_light_radius_max.GetFloat() ); el->decay = el->radius / 0.05f; diff --git a/src/game/client/swarm/clientmode_asw.cpp b/src/game/client/swarm/clientmode_asw.cpp index 9d5b794c4..4e2f5907e 100644 --- a/src/game/client/swarm/clientmode_asw.cpp +++ b/src/game/client/swarm/clientmode_asw.cpp @@ -806,7 +806,7 @@ void ClientModeASW::FireGameEvent( IGameEvent *event ) for ( C_BaseEntity *pEntity = ClientEntityList().FirstBaseEntity(); pEntity; pEntity = ClientEntityList().NextBaseEntity( pEntity ) ) { - if ( pEntity->index != -1 ) + if ( pEntity->m_index != -1 ) continue; if ( C_ClientRagdoll *pRagdoll = dynamic_cast( pEntity ) ) diff --git a/src/game/client/tempent.h b/src/game/client/tempent.h index f9a4e7511..b6893b317 100644 --- a/src/game/client/tempent.h +++ b/src/game/client/tempent.h @@ -93,7 +93,7 @@ class C_LocalTempEntity : public C_BaseAnimating, public C_SpriteRenderer pfnDrawHelper m_pfnDrawHelper; public: - int flags; + int m_flags; float die; float m_flFrameMax; float x; @@ -142,4 +142,4 @@ class C_LocalTempEntity : public C_BaseAnimating, public C_SpriteRenderer }; -#endif // TEMPENTITY_H \ No newline at end of file +#endif // TEMPENTITY_H diff --git a/src/game/client/toolframework_client.cpp b/src/game/client/toolframework_client.cpp index f98dc75e6..d115581a3 100644 --- a/src/game/client/toolframework_client.cpp +++ b/src/game/client/toolframework_client.cpp @@ -17,7 +17,7 @@ #include "tier0/memdbgon.h" -extern IViewRender *view; +extern IViewRender *g_view; class CToolFrameworkClient : public CBaseGameSystemPerFrame { diff --git a/src/game/client/view.cpp b/src/game/client/view.cpp index 22b11002e..5a9ced97b 100644 --- a/src/game/client/view.cpp +++ b/src/game/client/view.cpp @@ -91,7 +91,7 @@ extern ConVar sensitivity; ConVar zoom_sensitivity_ratio( "zoom_sensitivity_ratio", "1.0", 0, "Additional mouse sensitivity scale factor applied when FOV is zoomed in." ); // Each MOD implements GetViewRenderInstance() and provides either a default object or a subclassed object!!! -IViewRender *view = NULL; // set in cldll_client_init.cpp if no mod creates their own +IViewRender *g_view = NULL; // set in cldll_client_init.cpp if no mod creates their own #if _DEBUG bool g_bRenderingCameraView = false; @@ -267,7 +267,7 @@ bool R_CullSphere( //----------------------------------------------------------------------------- static void StartPitchDrift( void ) { - view->StartPitchDrift(); + g_view->StartPitchDrift(); } static ConCommand centerview( "centerview", StartPitchDrift ); diff --git a/src/game/client/view_scene.h b/src/game/client/view_scene.h index df21e7f0b..c65d86dc6 100644 --- a/src/game/client/view_scene.h +++ b/src/game/client/view_scene.h @@ -142,7 +142,7 @@ inline void UpdateFrontBufferTexturesForMaterial( IMaterial *pMaterial, bool bFo } else if( pMaterial->NeedsFullFrameBufferTexture() ) { - const CViewSetup *pView = view->GetViewSetup(); + const CViewSetup *pView = g_view->GetViewSetup(); UpdateScreenEffectTexture( 0, pView->x, pView->y, pView->width, pView->height ); } } @@ -151,7 +151,7 @@ inline void UpdateScreenEffectTexture( void ) { Assert( !DrawingShadowDepthView() ); - const CViewSetup *pViewSetup = view->GetViewSetup(); + const CViewSetup *pViewSetup = g_view->GetViewSetup(); UpdateScreenEffectTexture( 0, pViewSetup->x, pViewSetup->y, pViewSetup->width, pViewSetup->height); } diff --git a/src/game/client/viewdebug.cpp b/src/game/client/viewdebug.cpp index aa1c0d9f4..e487717b8 100644 --- a/src/game/client/viewdebug.cpp +++ b/src/game/client/viewdebug.cpp @@ -563,7 +563,7 @@ void CDebugViewRender::Draw2DDebuggingInfo( const CViewSetup &view ) // Draw debugging lightmaps if ( mat_showlightmappage.GetInt() != -1 ) { - CLightmapDebugView clientView( assert_cast( ::view ) ); + CLightmapDebugView clientView( assert_cast( ::g_view ) ); clientView.Setup( view ); clientView.Draw(); } @@ -632,24 +632,24 @@ CON_COMMAND_F( r_screenoverlay, "Draw specified material as an overlay", FCVAR_C { if ( !Q_stricmp( "off", args[1] ) ) { - view->SetScreenOverlayMaterial( NULL ); + g_view->SetScreenOverlayMaterial( NULL ); } else { IMaterial *pMaterial = materials->FindMaterial( args[1], TEXTURE_GROUP_OTHER, false ); if ( !IsErrorMaterial( pMaterial ) ) { - view->SetScreenOverlayMaterial( pMaterial ); + g_view->SetScreenOverlayMaterial( pMaterial ); } else { - view->SetScreenOverlayMaterial( NULL ); + g_view->SetScreenOverlayMaterial( NULL ); } } } else { - IMaterial *pMaterial = view->GetScreenOverlayMaterial(); + IMaterial *pMaterial = g_view->GetScreenOverlayMaterial(); Warning( "r_screenoverlay: %s\n", pMaterial ? pMaterial->GetName() : "off" ); } } diff --git a/src/game/client/viewpostprocess.cpp b/src/game/client/viewpostprocess.cpp index ed1302850..af70b2170 100644 --- a/src/game/client/viewpostprocess.cpp +++ b/src/game/client/viewpostprocess.cpp @@ -2540,7 +2540,7 @@ static float GetFarBlurRadius() bool IsDepthOfFieldEnabled() { - const CViewSetup *pViewSetup = view->GetViewSetup(); + const CViewSetup *pViewSetup = g_view->GetViewSetup(); if ( !pViewSetup ) return false; diff --git a/src/game/client/viewrender.cpp b/src/game/client/viewrender.cpp index 3f62ae5df..a5297f2cd 100644 --- a/src/game/client/viewrender.cpp +++ b/src/game/client/viewrender.cpp @@ -78,7 +78,7 @@ static void testfreezeframe_f( void ) { - view->FreezeFrame( 3.0 ); + g_view->FreezeFrame( 3.0 ); } static ConCommand test_freezeframe( "test_freezeframe", testfreezeframe_f, "Test the freeze frame code.", FCVAR_CHEAT ); @@ -233,12 +233,12 @@ CON_COMMAND( r_cheapwaterstart, "" ) if( args.ArgC() == 2 ) { float dist = atof( args[ 1 ] ); - view->SetCheapWaterStartDistance( dist ); + g_view->SetCheapWaterStartDistance( dist ); } else { float start, end; - view->GetWaterLODParams( start, end ); + g_view->GetWaterLODParams( start, end ); Warning( "r_cheapwaterstart: %f\n", start ); } } @@ -248,12 +248,12 @@ CON_COMMAND( r_cheapwaterend, "" ) if( args.ArgC() == 2 ) { float dist = atof( args[ 1 ] ); - view->SetCheapWaterEndDistance( dist ); + g_view->SetCheapWaterEndDistance( dist ); } else { float start, end; - view->GetWaterLODParams( start, end ); + g_view->GetWaterLODParams( start, end ); Warning( "r_cheapwaterend: %f\n", end ); } } @@ -904,7 +904,7 @@ void SetupCurrentView( const Vector &vecOrigin, const QAngle &angles, view_id_t // Cache off fade distances float flScreenFadeMinSize, flScreenFadeMaxSize; - view->GetScreenFadeDistances( &flScreenFadeMinSize, &flScreenFadeMaxSize ); + g_view->GetScreenFadeDistances( &flScreenFadeMinSize, &flScreenFadeMaxSize ); modelinfo->SetViewScreenFadeRange( flScreenFadeMinSize, flScreenFadeMaxSize ); CMatRenderContextPtr pRenderContext( materials ); @@ -4008,7 +4008,7 @@ static inline bool BlurTest( IClientRenderable *pRenderable, int drawFlags, bool if( pClientEntity->IsBlurred() ) { - const CViewSetup *pViewSetup = view->GetViewSetup(); + const CViewSetup *pViewSetup = g_view->GetViewSetup(); if( pViewSetup ) { BlurEntity( pRenderable, bPreDraw, drawFlags, instance, *pViewSetup, pViewSetup->x, pViewSetup->y, pViewSetup->width, pViewSetup->height ); @@ -4024,16 +4024,16 @@ static inline bool BlurTest( IClientRenderable *pRenderable, int drawFlags, bool //----------------------------------------------------------------------------- static inline void DrawRenderableEntity( IClientRenderable* pEnt, int flags, const RenderableInstance_t& instance ) { - Assert( view->GetCurrentlyDrawingEntity() == NULL ); + Assert( g_view->GetCurrentlyDrawingEntity() == NULL ); - view->SetCurrentlyDrawingEntity( pEnt->GetIClientUnknown() && pEnt->GetIClientUnknown()->GetClientRenderable() ? pEnt->GetIClientUnknown()->GetBaseEntity() : NULL ); + g_view->SetCurrentlyDrawingEntity( pEnt->GetIClientUnknown() && pEnt->GetIClientUnknown()->GetClientRenderable() ? pEnt->GetIClientUnknown()->GetBaseEntity() : NULL ); //bool bBlockNormalDraw = BlurTest( pEnt, flags, true, instance ); //if( !bBlockNormalDraw ) pEnt->DrawModel( flags, instance ); //BlurTest( pEnt, flags, false, instance ); - view->SetCurrentlyDrawingEntity( NULL ); + g_view->SetCurrentlyDrawingEntity( NULL ); } diff --git a/src/game/client/viewrender.h b/src/game/client/viewrender.h index 236863ff4..c0460e3b6 100644 --- a/src/game/client/viewrender.h +++ b/src/game/client/viewrender.h @@ -324,7 +324,7 @@ class CViewRender : public IViewRender virtual void OnRenderStart(); void DriftPitch (void); - static CViewRender * GetMainView() { return assert_cast( view ); } + static CViewRender * GetMainView() { return assert_cast( g_view ); } void AddViewToScene( CRendering3dView *pView ) { m_SimpleExecutor.AddView( pView ); } diff --git a/src/game/shared/baseplayer_shared.cpp b/src/game/shared/baseplayer_shared.cpp index f5c1e573f..01276329e 100644 --- a/src/game/shared/baseplayer_shared.cpp +++ b/src/game/shared/baseplayer_shared.cpp @@ -1541,7 +1541,7 @@ void CBasePlayer::CalcPlayerView( Vector& eyeOrigin, QAngle& eyeAngles, float& f if ( !prediction->InPrediction() ) { // FIXME: Move into prediction - view->DriftPitch(); + g_view->DriftPitch(); } #endif diff --git a/src/game/shared/decals.cpp b/src/game/shared/decals.cpp index 81e013578..3c1d42c8c 100644 --- a/src/game/shared/decals.cpp +++ b/src/game/shared/decals.cpp @@ -167,7 +167,7 @@ void CDecalEmitterSystem::LevelInitPreEntity() { DecalListEntry& e = m_AllDecals[ i ]; #if defined( CLIENT_DLL ) - e.precache_index = effects->Draw_DecalIndexFromName( (char *)m_DecalFileNames.String( e.name ) ); + e.precache_index = g_effects->Draw_DecalIndexFromName( (char *)m_DecalFileNames.String( e.name ) ); #else e.precache_index = engine->PrecacheDecal( m_DecalFileNames.String( e.name ) ); #endif diff --git a/src/game/shared/predictioncopy_helpers.cpp b/src/game/shared/predictioncopy_helpers.cpp index db2c7b2d4..7e112f77f 100644 --- a/src/game/shared/predictioncopy_helpers.cpp +++ b/src/game/shared/predictioncopy_helpers.cpp @@ -186,7 +186,7 @@ void CValueChangeTracker::SetupTracking( C_BaseEntity *ent, char const *pchField datamap_t *dmap = ent->GetPredDescMap(); if ( !dmap ) { - Msg( "No prediction datamap_t for entity %d/%s\n", ent->index, ent->GetClassname() ); + Msg( "No prediction datamap_t for entity %d/%s\n", ent->m_index, ent->GetClassname() ); return; } @@ -195,7 +195,7 @@ void CValueChangeTracker::SetupTracking( C_BaseEntity *ent, char const *pchField m_pTrackField = CPredictionCopy::FindFlatFieldByName( pchFieldName, dmap ); if ( !m_pTrackField ) { - Msg( "No field '%s' in datamap_t for entity %d/%s\n", pchFieldName, ent->index, ent->GetClassname() ); + Msg( "No field '%s' in datamap_t for entity %d/%s\n", pchFieldName, ent->m_index, ent->GetClassname() ); return; } @@ -252,4 +252,4 @@ CON_COMMAND_F( cl_pred_track, " : Track changes to entity g_pChangeTracker->SetupTracking( ent, args[2] ); } -#endif // NO_ENTITY_PREDICTION \ No newline at end of file +#endif // NO_ENTITY_PREDICTION diff --git a/src/game/shared/swarm/asw_deathmatch_mode.cpp b/src/game/shared/swarm/asw_deathmatch_mode.cpp index 57baa66e4..84d5d636d 100644 --- a/src/game/shared/swarm/asw_deathmatch_mode.cpp +++ b/src/game/shared/swarm/asw_deathmatch_mode.cpp @@ -1193,7 +1193,7 @@ int CASW_Deathmatch_Mode::GetFragCount( CASW_Marine_Resource *pMR ) #ifdef GAME_DLL return pPlayer->FragCount(); #else - return g_PR->GetPlayerScore( pPlayer->index ); + return g_PR->GetPlayerScore( pPlayer->m_index ); #endif } return 0; @@ -1211,7 +1211,7 @@ int CASW_Deathmatch_Mode::GetDeathCount( CASW_Marine_Resource *pMR ) #ifdef GAME_DLL return pPlayer->DeathCount(); #else - return g_PR->GetDeaths( pPlayer->index ); + return g_PR->GetDeaths( pPlayer->m_index ); #endif } return 0; diff --git a/src/game/shared/swarm/asw_weapon_energy_shield_shared.cpp b/src/game/shared/swarm/asw_weapon_energy_shield_shared.cpp index 775b250f1..125bb8c0c 100644 --- a/src/game/shared/swarm/asw_weapon_energy_shield_shared.cpp +++ b/src/game/shared/swarm/asw_weapon_energy_shield_shared.cpp @@ -514,7 +514,7 @@ void CASW_Energy_Shield::ClientThink() if ( !m_pDLight || m_pDLight->key != entindex() ) { - m_pDLight = effects->CL_AllocDlight( entindex() ); + m_pDLight = g_effects->CL_AllocDlight( entindex() ); } m_pDLight->origin = GetAbsOrigin() + Vector( 0, 0, 16 ) - Forward() * 16; m_pDLight->color.r = 220; diff --git a/src/game/shared/swarm/asw_weapon_revive_tool_shared.cpp b/src/game/shared/swarm/asw_weapon_revive_tool_shared.cpp index 8f587e762..1203c3a51 100644 --- a/src/game/shared/swarm/asw_weapon_revive_tool_shared.cpp +++ b/src/game/shared/swarm/asw_weapon_revive_tool_shared.cpp @@ -313,7 +313,7 @@ void CASW_Revive_Tombstone::ClientThink() if ( bShouldHologramsBeActive && rd_revive_tombstone_dlight.GetBool() ) { - m_pLightGlow = effects->CL_AllocDlight( index ); + m_pLightGlow = g_effects->CL_AllocDlight( m_index ); m_pLightGlow->origin = GetAbsOrigin() + Vector( 0, 0, m_bIsReviving ? rd_revive_tombstone_dlight_active_z_offset.GetFloat() : rd_revive_tombstone_dlight_z_offset.GetFloat() ); Color lightColor; switch ( iProfileSkinMinusOne ) diff --git a/src/public/iefx.h b/src/public/iefx.h index aaafb917d..798d9517f 100644 --- a/src/public/iefx.h +++ b/src/public/iefx.h @@ -63,6 +63,6 @@ abstract_class IVEfx #define VENGINE_EFFECTS_INTERFACE_VERSION "VEngineEffects001" -extern IVEfx *effects; +extern IVEfx *g_effects; #endif // IEFX_H