summaryrefslogtreecommitdiff
path: root/game/client/particlesphererenderer.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/particlesphererenderer.cpp
downloadarchived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.tar.xz
archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.zip
Diffstat (limited to 'game/client/particlesphererenderer.cpp')
-rw-r--r--game/client/particlesphererenderer.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/game/client/particlesphererenderer.cpp b/game/client/particlesphererenderer.cpp
new file mode 100644
index 0000000..f995ee1
--- /dev/null
+++ b/game/client/particlesphererenderer.cpp
@@ -0,0 +1,49 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+#include "cbase.h"
+#include "particlesphererenderer.h"
+#include "materialsystem/imaterialvar.h"
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include "tier0/memdbgon.h"
+
+CParticleSphereRenderer::CParticleSphereRenderer()
+{
+ m_vBaseColor.Init();
+ memset( &m_AmbientLight, 0, sizeof( m_AmbientLight ) );
+ memset( &m_DirectionalLight, 0, sizeof( m_DirectionalLight ) );
+
+ m_bUsingPixelShaders = false;
+ m_iLastTickStartRenderCalled = -1;
+ m_pParticleMgr = NULL;
+}
+
+
+void CParticleSphereRenderer::Init( CParticleMgr *pParticleMgr, IMaterial *pMaterial )
+{
+ m_pParticleMgr = pParticleMgr;
+
+ // Figure out how we need to draw.
+ bool bFound = false;
+ IMaterialVar *pVar = pMaterial->FindVar( "$USINGPIXELSHADER", &bFound, false );
+ if( bFound && pVar && pVar->GetIntValue() )
+ m_bUsingPixelShaders = true;
+ else
+ m_bUsingPixelShaders = false;
+}
+
+
+void CParticleSphereRenderer::StartRender( VMatrix &effectMatrix )
+{
+ // We're about to be rendered.. set our directional lighting parameters for this particle system.
+ if ( m_pParticleMgr )
+ {
+ m_pParticleMgr->SetDirectionalLightInfo( m_DirectionalLight );
+ }
+
+ m_iLastTickStartRenderCalled = gpGlobals->tickcount;
+}