aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/client/particledraw.h
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
committerJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
commit39ed87570bdb2f86969d4be821c94b722dc71179 (patch)
treeabc53757f75f40c80278e87650ea92808274aa59 /mp/src/game/client/particledraw.h
downloadsource-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz
source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/game/client/particledraw.h')
-rw-r--r--mp/src/game/client/particledraw.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/mp/src/game/client/particledraw.h b/mp/src/game/client/particledraw.h
new file mode 100644
index 00000000..268f6298
--- /dev/null
+++ b/mp/src/game/client/particledraw.h
@@ -0,0 +1,81 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//
+//=============================================================================//
+// FIXME: Should we just pass the Particle draw members directly as
+// arguments to IParticleEffect::SimulateAndRender?
+
+// This file defines and implements the ParticleDraw class, which is used
+// by ParticleEffects to render particles. It simply stores render + simulation
+// state
+//
+
+#ifndef PARTICLEDRAW_H
+#define PARTICLEDRAW_H
+
+
+class IMaterial;
+class CMeshBuilder;
+class CParticleSubTexture;
+
+
+class ParticleDraw
+{
+friend class CParticleEffectBinding;
+
+public:
+
+ ParticleDraw();
+
+ void Init( CMeshBuilder *pMeshBuilder, IMaterial *pMaterial, float fTimeDelta );
+
+ // Time delta..
+ float GetTimeDelta() const;
+
+ // Get the material being used (mostly useful for getting the tcoord padding).
+ //IMaterial* GetPMaterial();
+
+ // This can return NULL if the particle system is only being simulated.
+ CMeshBuilder* GetMeshBuilder();
+
+ CParticleSubTexture *m_pSubTexture;
+
+private:
+ CMeshBuilder *m_pMeshBuilder;
+ IMaterial *m_pMaterial;
+ float m_fTimeDelta;
+};
+
+
+
+// ------------------------------------------------------------------------- //
+// Inlines
+// ------------------------------------------------------------------------- //
+
+inline ParticleDraw::ParticleDraw()
+{
+ m_pMaterial = 0;
+}
+
+inline void ParticleDraw::Init( CMeshBuilder *pMeshBuilder, IMaterial *pMaterial, float fTimeDelta )
+{
+ m_pMeshBuilder = pMeshBuilder;
+ m_pMaterial = pMaterial;
+ m_fTimeDelta = fTimeDelta;
+}
+
+inline float ParticleDraw::GetTimeDelta() const
+{
+ return m_fTimeDelta;
+}
+
+inline CMeshBuilder* ParticleDraw::GetMeshBuilder()
+{
+ return m_pMeshBuilder;
+}
+
+#endif
+