diff options
| author | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:31:46 -0800 |
|---|---|---|
| committer | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:46:31 -0800 |
| commit | f56bb35301836e56582a575a75864392a0177875 (patch) | |
| tree | de61ddd39de3e7df52759711950b4c288592f0dc /mp/src/game/client/particle_proxies.cpp | |
| parent | Mark some more files as text. (diff) | |
| download | source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip | |
Fix line endings. WHAMMY.
Diffstat (limited to 'mp/src/game/client/particle_proxies.cpp')
| -rw-r--r-- | mp/src/game/client/particle_proxies.cpp | 154 |
1 files changed, 77 insertions, 77 deletions
diff --git a/mp/src/game/client/particle_proxies.cpp b/mp/src/game/client/particle_proxies.cpp index 9f30b5cf..0e98330e 100644 --- a/mp/src/game/client/particle_proxies.cpp +++ b/mp/src/game/client/particle_proxies.cpp @@ -1,77 +1,77 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose: This module implements all the proxies used by the particle systems.
-//
-// $NoKeywords: $
-//=============================================================================//
-#include "cbase.h"
-#include "particlemgr.h"
-#include "materialsystem/imaterialproxy.h"
-#include "materialsystem/imaterialvar.h"
-
-// memdbgon must be the last include file in a .cpp file!!!
-#include "tier0/memdbgon.h"
-
-
-// ------------------------------------------------------------------------ //
-// ParticleSphereProxy
-// ------------------------------------------------------------------------ //
-
-class ParticleSphereProxy : public IMaterialProxy
-{
-// IMaterialProxy overrides.
-public:
- ParticleSphereProxy()
- {
- }
-
- virtual ~ParticleSphereProxy()
- {
- }
-
- virtual bool Init( IMaterial *pMaterial, KeyValues *pKeyValues )
- {
- m_pLightPosition = pMaterial->FindVar( "$light_position", NULL, false );
- m_pLightColor = pMaterial->FindVar( "$light_color", NULL, false );
- return true;
- }
-
- virtual void OnBind( void *pvParticleMgr )
- {
- if( !pvParticleMgr )
- return;
-
- CParticleMgr *pMgr = (CParticleMgr*)pvParticleMgr;
- CParticleLightInfo info;
- pMgr->GetDirectionalLightInfo( info );
-
- // Transform the light into camera space.
- Vector vTransformedPos = pMgr->GetModelView() * info.m_vPos;
- if ( m_pLightPosition )
- m_pLightPosition->SetVecValue( vTransformedPos.Base(), 3 );
-
- if ( m_pLightColor )
- {
- Vector vTotalColor = info.m_vColor * info.m_flIntensity;
- m_pLightColor->SetVecValue( vTotalColor.Base(), 3 );
- }
- }
-
- virtual void Release( void ) { delete this; }
-
- virtual IMaterial *GetMaterial()
- {
- IMaterialVar *pVar = m_pLightPosition ? m_pLightPosition : m_pLightColor;
- if ( !pVar )
- return NULL;
- return pVar->GetOwningMaterial();
- }
-
-private:
-
- IMaterialVar *m_pLightPosition;
- IMaterialVar *m_pLightColor;
-};
-
-EXPOSE_INTERFACE( ParticleSphereProxy, IMaterialProxy, "ParticleSphereProxy" IMATERIAL_PROXY_INTERFACE_VERSION );
-
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: This module implements all the proxies used by the particle systems. +// +// $NoKeywords: $ +//=============================================================================// +#include "cbase.h" +#include "particlemgr.h" +#include "materialsystem/imaterialproxy.h" +#include "materialsystem/imaterialvar.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + + +// ------------------------------------------------------------------------ // +// ParticleSphereProxy +// ------------------------------------------------------------------------ // + +class ParticleSphereProxy : public IMaterialProxy +{ +// IMaterialProxy overrides. +public: + ParticleSphereProxy() + { + } + + virtual ~ParticleSphereProxy() + { + } + + virtual bool Init( IMaterial *pMaterial, KeyValues *pKeyValues ) + { + m_pLightPosition = pMaterial->FindVar( "$light_position", NULL, false ); + m_pLightColor = pMaterial->FindVar( "$light_color", NULL, false ); + return true; + } + + virtual void OnBind( void *pvParticleMgr ) + { + if( !pvParticleMgr ) + return; + + CParticleMgr *pMgr = (CParticleMgr*)pvParticleMgr; + CParticleLightInfo info; + pMgr->GetDirectionalLightInfo( info ); + + // Transform the light into camera space. + Vector vTransformedPos = pMgr->GetModelView() * info.m_vPos; + if ( m_pLightPosition ) + m_pLightPosition->SetVecValue( vTransformedPos.Base(), 3 ); + + if ( m_pLightColor ) + { + Vector vTotalColor = info.m_vColor * info.m_flIntensity; + m_pLightColor->SetVecValue( vTotalColor.Base(), 3 ); + } + } + + virtual void Release( void ) { delete this; } + + virtual IMaterial *GetMaterial() + { + IMaterialVar *pVar = m_pLightPosition ? m_pLightPosition : m_pLightColor; + if ( !pVar ) + return NULL; + return pVar->GetOwningMaterial(); + } + +private: + + IMaterialVar *m_pLightPosition; + IMaterialVar *m_pLightColor; +}; + +EXPOSE_INTERFACE( ParticleSphereProxy, IMaterialProxy, "ParticleSphereProxy" IMATERIAL_PROXY_INTERFACE_VERSION ); + |