aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/client/particles_ez.cpp
diff options
context:
space:
mode:
authorJørgen P. Tjernø <[email protected]>2013-12-02 19:31:46 -0800
committerJørgen P. Tjernø <[email protected]>2013-12-02 19:46:31 -0800
commitf56bb35301836e56582a575a75864392a0177875 (patch)
treede61ddd39de3e7df52759711950b4c288592f0dc /mp/src/game/client/particles_ez.cpp
parentMark some more files as text. (diff)
downloadsource-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz
source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip
Fix line endings. WHAMMY.
Diffstat (limited to 'mp/src/game/client/particles_ez.cpp')
-rw-r--r--mp/src/game/client/particles_ez.cpp324
1 files changed, 162 insertions, 162 deletions
diff --git a/mp/src/game/client/particles_ez.cpp b/mp/src/game/client/particles_ez.cpp
index 592964bb..d45d4c78 100644
--- a/mp/src/game/client/particles_ez.cpp
+++ b/mp/src/game/client/particles_ez.cpp
@@ -1,162 +1,162 @@
-//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-//=============================================================================//
-
-#include "cbase.h"
-#include "particles_ez.h"
-#include "igamesystem.h"
-
-// memdbgon must be the last include file in a .cpp file!!!
-#include "tier0/memdbgon.h"
-
-
-// Singletons for each type of particle system.
-// 0 = world, 1 = skybox
-static CSmartPtr<CSimpleEmitter> g_pSimpleSingleton[2];
-static CSmartPtr<CEmberEffect> g_pEmberSingleton[2];
-static CSmartPtr<CFireSmokeEffect> g_pFireSmokeSingleton[2];
-static CSmartPtr<CFireParticle> g_pFireSingleton[2];
-
-
-class CEZParticleInit : public CAutoGameSystem
-{
-public:
- CEZParticleInit() : CAutoGameSystem( "CEZParticleInit" )
- {
- }
-
- template< class T >
- CSmartPtr<T> InitSingleton( CSmartPtr<T> pEmitter )
- {
- if ( !pEmitter )
- {
- Error( "InitSingleton: pEmitter is NULL" );
- }
-
- pEmitter->GetBinding().SetDrawThruLeafSystem( false ); // Draw in DrawSingletons instead.
- pEmitter->SetSortOrigin( Vector( 0, 0, 0 ) );
-
- // Since we draw manually in DrawSingletons, we don't care about
- // the bbox, so don't waste cycles inserting it into the leaf system
- // when it's not going to draw through that anyway.
- // (TODO: SetDrawThruLeafSystem(false) should trigger this automatically
- // in CParticleMgr).
- pEmitter->GetBinding().SetBBox( Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) );
- return pEmitter;
- }
-
- virtual void LevelInitPreEntity()
- {
- g_pSimpleSingleton[0] = InitSingleton( CSimpleEmitter::Create( "Simple Particle Singleton" ) );
- g_pSimpleSingleton[1] = InitSingleton( CSimpleEmitter::Create( "Simple Particle Singleton [sky]" ) );
-
- g_pEmberSingleton[0] = InitSingleton( CEmberEffect::Create( "Ember Particle Singleton" ) );
- g_pEmberSingleton[1] = InitSingleton( CEmberEffect::Create( "Ember Particle Singleton [sky]" ) );
-
- g_pFireSmokeSingleton[0] = InitSingleton( CFireSmokeEffect::Create( "Fire Smoke Particle Singleton" ) );
- g_pFireSmokeSingleton[1] = InitSingleton( CFireSmokeEffect::Create( "Fire Smoke Particle Singleton [sky]" ) );
-
- g_pFireSingleton[0] = InitSingleton( CFireParticle::Create( "Fire Particle Singleton" ) );
- g_pFireSingleton[1] = InitSingleton( CFireParticle::Create( "Fire Particle Singleton [sky]" ) );
- }
-
-
- virtual void LevelShutdownPreEntity()
- {
- g_pSimpleSingleton[0] = g_pSimpleSingleton[1] = NULL;
- g_pEmberSingleton[0] = g_pEmberSingleton[1] = NULL;
- g_pFireSmokeSingleton[0] = g_pFireSmokeSingleton[1] = NULL;
- g_pFireSingleton[0] = g_pFireSingleton[1] = NULL;
- }
-};
-
-static CEZParticleInit g_EZParticleInit;
-
-
-template<class T>
-inline void CopyParticle( const T *pSrc, T *pDest )
-{
- if ( pDest )
- {
- // Copy the particle, but don't screw up the linked list it's in.
- Particle *pPrev = pDest->m_pPrev;
- Particle *pNext = pDest->m_pNext;
- PMaterialHandle pSubTexture = pDest->m_pSubTexture;
-
- *pDest = *pSrc;
-
- pDest->m_pPrev = pPrev;
- pDest->m_pNext = pNext;
- pDest->m_pSubTexture = pSubTexture;
- }
-}
-
-
-
-void AddSimpleParticle( const SimpleParticle *pParticle, PMaterialHandle hMaterial, bool bInSkybox )
-{
- if ( g_pSimpleSingleton[bInSkybox].IsValid() )
- {
- SimpleParticle *pNew = g_pSimpleSingleton[bInSkybox]->AddSimpleParticle( hMaterial, pParticle->m_Pos );
- CopyParticle( pParticle, pNew );
- }
-}
-
-
-void AddEmberParticle( const SimpleParticle *pParticle, PMaterialHandle hMaterial, bool bInSkybox )
-{
- if ( g_pEmberSingleton[bInSkybox].IsValid() )
- {
- SimpleParticle *pNew = g_pEmberSingleton[bInSkybox]->AddSimpleParticle( hMaterial, pParticle->m_Pos );
- CopyParticle( pParticle, pNew );
- }
-}
-
-
-void AddFireSmokeParticle( const SimpleParticle *pParticle, PMaterialHandle hMaterial, bool bInSkybox )
-{
- if ( g_pFireSmokeSingleton[bInSkybox].IsValid() )
- {
- SimpleParticle *pNew = g_pFireSmokeSingleton[bInSkybox]->AddSimpleParticle( hMaterial, pParticle->m_Pos );
- CopyParticle( pParticle, pNew );
- }
-}
-
-
-void AddFireParticle( const SimpleParticle *pParticle, PMaterialHandle hMaterial, bool bInSkybox )
-{
- if ( g_pFireSingleton[bInSkybox].IsValid() )
- {
- SimpleParticle *pNew = g_pFireSingleton[bInSkybox]->AddSimpleParticle( hMaterial, pParticle->m_Pos );
- CopyParticle( pParticle, pNew );
- }
-}
-
-
-void DrawParticleSingletons( bool bInSkybox )
-{
- if ( g_pSimpleSingleton[bInSkybox].IsValid() )
- {
- g_pSimpleSingleton[bInSkybox]->GetBinding().DrawModel( 1 );
- }
-
- if ( g_pEmberSingleton[bInSkybox].IsValid() )
- {
- g_pEmberSingleton[bInSkybox]->GetBinding().DrawModel( 1 );
- }
-
- if ( g_pFireSmokeSingleton[bInSkybox].IsValid() )
- {
- g_pFireSmokeSingleton[bInSkybox]->GetBinding().DrawModel( 1 );
- }
-
- if ( g_pFireSingleton[bInSkybox].IsValid() )
- {
- g_pFireSingleton[bInSkybox]->GetBinding().DrawModel( 1 );
- }
-}
-
-
-
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================//
+
+#include "cbase.h"
+#include "particles_ez.h"
+#include "igamesystem.h"
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include "tier0/memdbgon.h"
+
+
+// Singletons for each type of particle system.
+// 0 = world, 1 = skybox
+static CSmartPtr<CSimpleEmitter> g_pSimpleSingleton[2];
+static CSmartPtr<CEmberEffect> g_pEmberSingleton[2];
+static CSmartPtr<CFireSmokeEffect> g_pFireSmokeSingleton[2];
+static CSmartPtr<CFireParticle> g_pFireSingleton[2];
+
+
+class CEZParticleInit : public CAutoGameSystem
+{
+public:
+ CEZParticleInit() : CAutoGameSystem( "CEZParticleInit" )
+ {
+ }
+
+ template< class T >
+ CSmartPtr<T> InitSingleton( CSmartPtr<T> pEmitter )
+ {
+ if ( !pEmitter )
+ {
+ Error( "InitSingleton: pEmitter is NULL" );
+ }
+
+ pEmitter->GetBinding().SetDrawThruLeafSystem( false ); // Draw in DrawSingletons instead.
+ pEmitter->SetSortOrigin( Vector( 0, 0, 0 ) );
+
+ // Since we draw manually in DrawSingletons, we don't care about
+ // the bbox, so don't waste cycles inserting it into the leaf system
+ // when it's not going to draw through that anyway.
+ // (TODO: SetDrawThruLeafSystem(false) should trigger this automatically
+ // in CParticleMgr).
+ pEmitter->GetBinding().SetBBox( Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) );
+ return pEmitter;
+ }
+
+ virtual void LevelInitPreEntity()
+ {
+ g_pSimpleSingleton[0] = InitSingleton( CSimpleEmitter::Create( "Simple Particle Singleton" ) );
+ g_pSimpleSingleton[1] = InitSingleton( CSimpleEmitter::Create( "Simple Particle Singleton [sky]" ) );
+
+ g_pEmberSingleton[0] = InitSingleton( CEmberEffect::Create( "Ember Particle Singleton" ) );
+ g_pEmberSingleton[1] = InitSingleton( CEmberEffect::Create( "Ember Particle Singleton [sky]" ) );
+
+ g_pFireSmokeSingleton[0] = InitSingleton( CFireSmokeEffect::Create( "Fire Smoke Particle Singleton" ) );
+ g_pFireSmokeSingleton[1] = InitSingleton( CFireSmokeEffect::Create( "Fire Smoke Particle Singleton [sky]" ) );
+
+ g_pFireSingleton[0] = InitSingleton( CFireParticle::Create( "Fire Particle Singleton" ) );
+ g_pFireSingleton[1] = InitSingleton( CFireParticle::Create( "Fire Particle Singleton [sky]" ) );
+ }
+
+
+ virtual void LevelShutdownPreEntity()
+ {
+ g_pSimpleSingleton[0] = g_pSimpleSingleton[1] = NULL;
+ g_pEmberSingleton[0] = g_pEmberSingleton[1] = NULL;
+ g_pFireSmokeSingleton[0] = g_pFireSmokeSingleton[1] = NULL;
+ g_pFireSingleton[0] = g_pFireSingleton[1] = NULL;
+ }
+};
+
+static CEZParticleInit g_EZParticleInit;
+
+
+template<class T>
+inline void CopyParticle( const T *pSrc, T *pDest )
+{
+ if ( pDest )
+ {
+ // Copy the particle, but don't screw up the linked list it's in.
+ Particle *pPrev = pDest->m_pPrev;
+ Particle *pNext = pDest->m_pNext;
+ PMaterialHandle pSubTexture = pDest->m_pSubTexture;
+
+ *pDest = *pSrc;
+
+ pDest->m_pPrev = pPrev;
+ pDest->m_pNext = pNext;
+ pDest->m_pSubTexture = pSubTexture;
+ }
+}
+
+
+
+void AddSimpleParticle( const SimpleParticle *pParticle, PMaterialHandle hMaterial, bool bInSkybox )
+{
+ if ( g_pSimpleSingleton[bInSkybox].IsValid() )
+ {
+ SimpleParticle *pNew = g_pSimpleSingleton[bInSkybox]->AddSimpleParticle( hMaterial, pParticle->m_Pos );
+ CopyParticle( pParticle, pNew );
+ }
+}
+
+
+void AddEmberParticle( const SimpleParticle *pParticle, PMaterialHandle hMaterial, bool bInSkybox )
+{
+ if ( g_pEmberSingleton[bInSkybox].IsValid() )
+ {
+ SimpleParticle *pNew = g_pEmberSingleton[bInSkybox]->AddSimpleParticle( hMaterial, pParticle->m_Pos );
+ CopyParticle( pParticle, pNew );
+ }
+}
+
+
+void AddFireSmokeParticle( const SimpleParticle *pParticle, PMaterialHandle hMaterial, bool bInSkybox )
+{
+ if ( g_pFireSmokeSingleton[bInSkybox].IsValid() )
+ {
+ SimpleParticle *pNew = g_pFireSmokeSingleton[bInSkybox]->AddSimpleParticle( hMaterial, pParticle->m_Pos );
+ CopyParticle( pParticle, pNew );
+ }
+}
+
+
+void AddFireParticle( const SimpleParticle *pParticle, PMaterialHandle hMaterial, bool bInSkybox )
+{
+ if ( g_pFireSingleton[bInSkybox].IsValid() )
+ {
+ SimpleParticle *pNew = g_pFireSingleton[bInSkybox]->AddSimpleParticle( hMaterial, pParticle->m_Pos );
+ CopyParticle( pParticle, pNew );
+ }
+}
+
+
+void DrawParticleSingletons( bool bInSkybox )
+{
+ if ( g_pSimpleSingleton[bInSkybox].IsValid() )
+ {
+ g_pSimpleSingleton[bInSkybox]->GetBinding().DrawModel( 1 );
+ }
+
+ if ( g_pEmberSingleton[bInSkybox].IsValid() )
+ {
+ g_pEmberSingleton[bInSkybox]->GetBinding().DrawModel( 1 );
+ }
+
+ if ( g_pFireSmokeSingleton[bInSkybox].IsValid() )
+ {
+ g_pFireSmokeSingleton[bInSkybox]->GetBinding().DrawModel( 1 );
+ }
+
+ if ( g_pFireSingleton[bInSkybox].IsValid() )
+ {
+ g_pFireSingleton[bInSkybox]->GetBinding().DrawModel( 1 );
+ }
+}
+
+
+