diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /mp/src/game/client/c_te_footprint.cpp | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/game/client/c_te_footprint.cpp')
| -rw-r--r-- | mp/src/game/client/c_te_footprint.cpp | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/mp/src/game/client/c_te_footprint.cpp b/mp/src/game/client/c_te_footprint.cpp new file mode 100644 index 00000000..8a149542 --- /dev/null +++ b/mp/src/game/client/c_te_footprint.cpp @@ -0,0 +1,110 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $Workfile: $
+// $Date: $
+// $NoKeywords: $
+//=============================================================================//
+#include "cbase.h"
+#include "c_basetempentity.h"
+#include "iefx.h"
+#include "fx.h"
+#include "tier0/vprof.h"
+
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include "tier0/memdbgon.h"
+
+//-----------------------------------------------------------------------------
+// Purpose: Footprint Decal TE
+//-----------------------------------------------------------------------------
+
+class C_TEFootprintDecal : public C_BaseTempEntity
+{
+public:
+ DECLARE_CLASS( C_TEFootprintDecal, C_BaseTempEntity );
+ DECLARE_CLIENTCLASS();
+
+ C_TEFootprintDecal( void );
+ virtual ~C_TEFootprintDecal( void );
+
+ virtual void PostDataUpdate( DataUpdateType_t updateType );
+
+ virtual void Precache( void );
+
+public:
+ Vector m_vecOrigin;
+ Vector m_vecDirection;
+ Vector m_vecStart;
+ int m_nEntity;
+ int m_nIndex;
+ char m_chMaterialType;
+};
+
+IMPLEMENT_CLIENTCLASS_EVENT_DT(C_TEFootprintDecal, DT_TEFootprintDecal, CTEFootprintDecal)
+ RecvPropVector( RECVINFO(m_vecOrigin)),
+ RecvPropVector( RECVINFO(m_vecDirection)),
+ RecvPropInt( RECVINFO(m_nEntity)),
+ RecvPropInt( RECVINFO(m_nIndex)),
+ RecvPropInt( RECVINFO(m_chMaterialType)),
+END_RECV_TABLE()
+
+
+//-----------------------------------------------------------------------------
+// Constructor, destructor
+//-----------------------------------------------------------------------------
+
+C_TEFootprintDecal::C_TEFootprintDecal( void )
+{
+ m_vecOrigin.Init();
+ m_vecStart.Init();
+ m_nEntity = 0;
+ m_nIndex = 0;
+ m_chMaterialType = 'C';
+}
+
+C_TEFootprintDecal::~C_TEFootprintDecal( void )
+{
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+//-----------------------------------------------------------------------------
+
+void C_TEFootprintDecal::Precache( void )
+{
+}
+
+//-----------------------------------------------------------------------------
+// Do stuff when data changes
+//-----------------------------------------------------------------------------
+
+void C_TEFootprintDecal::PostDataUpdate( DataUpdateType_t updateType )
+{
+ VPROF( "C_TEFootprintDecal::PostDataUpdate" );
+
+ // FIXME: Make this choose the decal based on material type
+ if ( r_decals.GetInt() )
+ {
+ C_BaseEntity *ent = cl_entitylist->GetEnt( m_nEntity );
+ if ( ent )
+ {
+ effects->DecalShoot( m_nIndex,
+ m_nEntity, ent->GetModel(), ent->GetAbsOrigin(), ent->GetAbsAngles(), m_vecOrigin, &m_vecDirection, 0 );
+ }
+ }
+}
+
+void TE_FootprintDecal( IRecipientFilter& filter, float delay, const Vector *origin, const Vector* right,
+ int entity, int index, unsigned char materialType )
+{
+ if ( r_decals.GetInt() )
+ {
+ C_BaseEntity *ent = cl_entitylist->GetEnt( entity );
+ if ( ent )
+ {
+ effects->DecalShoot( index, entity, ent->GetModel(), ent->GetAbsOrigin(), ent->GetAbsAngles(), *origin, right, 0 );
+ }
+ }
+}
\ No newline at end of file |