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 /sp/src/game/server/te_effect_dispatch.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 'sp/src/game/server/te_effect_dispatch.cpp')
| -rw-r--r-- | sp/src/game/server/te_effect_dispatch.cpp | 182 |
1 files changed, 91 insertions, 91 deletions
diff --git a/sp/src/game/server/te_effect_dispatch.cpp b/sp/src/game/server/te_effect_dispatch.cpp index 4bb7d6a3..140a76f5 100644 --- a/sp/src/game/server/te_effect_dispatch.cpp +++ b/sp/src/game/server/te_effect_dispatch.cpp @@ -1,91 +1,91 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $Workfile: $
-// $Date: $
-//
-//-----------------------------------------------------------------------------
-// $Log: $
-//
-// $NoKeywords: $
-//=============================================================================//
-#include "cbase.h"
-#include "basetempentity.h"
-#include "te_effect_dispatch.h"
-#include "networkstringtable_gamedll.h"
-
-// memdbgon must be the last include file in a .cpp file!!!
-#include "tier0/memdbgon.h"
-
-//-----------------------------------------------------------------------------
-// Purpose: This TE provides a simple interface to dispatch effects by name using DispatchEffect().
-//-----------------------------------------------------------------------------
-class CTEEffectDispatch : public CBaseTempEntity
-{
-public:
- DECLARE_CLASS( CTEEffectDispatch, CBaseTempEntity );
-
- CTEEffectDispatch( const char *name );
- virtual ~CTEEffectDispatch( void );
-
- DECLARE_SERVERCLASS();
-
-public:
- CEffectData m_EffectData;
-};
-
-//-----------------------------------------------------------------------------
-// Purpose:
-// Input : *name -
-//-----------------------------------------------------------------------------
-CTEEffectDispatch::CTEEffectDispatch( const char *name ) :
- CBaseTempEntity( name )
-{
-}
-
-//-----------------------------------------------------------------------------
-// Purpose:
-//-----------------------------------------------------------------------------
-CTEEffectDispatch::~CTEEffectDispatch( void )
-{
-}
-
-IMPLEMENT_SERVERCLASS_ST( CTEEffectDispatch, DT_TEEffectDispatch )
-
- SendPropDataTable( SENDINFO_DT( m_EffectData ), &REFERENCE_SEND_TABLE( DT_EffectData ) )
-
-END_SEND_TABLE()
-
-
-// Singleton to fire TEEffectDispatch objects
-static CTEEffectDispatch g_TEEffectDispatch( "EffectDispatch" );
-
-//-----------------------------------------------------------------------------
-// Purpose:
-//-----------------------------------------------------------------------------
-void TE_DispatchEffect( IRecipientFilter& filter, float delay, const Vector &pos, const char *pName, const CEffectData &data )
-{
- // Copy the supplied effect data.
- g_TEEffectDispatch.m_EffectData = data;
-
- // Get the entry index in the string table.
- g_TEEffectDispatch.m_EffectData.m_iEffectName = g_pStringTableEffectDispatch->AddString( CBaseEntity::IsServer(), pName );
-
- // Send it to anyone who can see the effect's origin.
- g_TEEffectDispatch.Create( filter, 0 );
-}
-
-//-----------------------------------------------------------------------------
-// Purpose:
-//-----------------------------------------------------------------------------
-void DispatchEffect( const char *pName, const CEffectData &data )
-{
- CPASFilter filter( data.m_vOrigin );
- DispatchEffect( pName, data, filter );
-}
-
-void DispatchEffect( const char *pName, const CEffectData &data, CRecipientFilter &filter )
-{
- te->DispatchEffect( filter, 0.0, data.m_vOrigin, pName, data );
-}
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $Workfile: $ +// $Date: $ +// +//----------------------------------------------------------------------------- +// $Log: $ +// +// $NoKeywords: $ +//=============================================================================// +#include "cbase.h" +#include "basetempentity.h" +#include "te_effect_dispatch.h" +#include "networkstringtable_gamedll.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +//----------------------------------------------------------------------------- +// Purpose: This TE provides a simple interface to dispatch effects by name using DispatchEffect(). +//----------------------------------------------------------------------------- +class CTEEffectDispatch : public CBaseTempEntity +{ +public: + DECLARE_CLASS( CTEEffectDispatch, CBaseTempEntity ); + + CTEEffectDispatch( const char *name ); + virtual ~CTEEffectDispatch( void ); + + DECLARE_SERVERCLASS(); + +public: + CEffectData m_EffectData; +}; + +//----------------------------------------------------------------------------- +// Purpose: +// Input : *name - +//----------------------------------------------------------------------------- +CTEEffectDispatch::CTEEffectDispatch( const char *name ) : + CBaseTempEntity( name ) +{ +} + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +CTEEffectDispatch::~CTEEffectDispatch( void ) +{ +} + +IMPLEMENT_SERVERCLASS_ST( CTEEffectDispatch, DT_TEEffectDispatch ) + + SendPropDataTable( SENDINFO_DT( m_EffectData ), &REFERENCE_SEND_TABLE( DT_EffectData ) ) + +END_SEND_TABLE() + + +// Singleton to fire TEEffectDispatch objects +static CTEEffectDispatch g_TEEffectDispatch( "EffectDispatch" ); + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void TE_DispatchEffect( IRecipientFilter& filter, float delay, const Vector &pos, const char *pName, const CEffectData &data ) +{ + // Copy the supplied effect data. + g_TEEffectDispatch.m_EffectData = data; + + // Get the entry index in the string table. + g_TEEffectDispatch.m_EffectData.m_iEffectName = g_pStringTableEffectDispatch->AddString( CBaseEntity::IsServer(), pName ); + + // Send it to anyone who can see the effect's origin. + g_TEEffectDispatch.Create( filter, 0 ); +} + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void DispatchEffect( const char *pName, const CEffectData &data ) +{ + CPASFilter filter( data.m_vOrigin ); + DispatchEffect( pName, data, filter ); +} + +void DispatchEffect( const char *pName, const CEffectData &data, CRecipientFilter &filter ) +{ + te->DispatchEffect( filter, 0.0, data.m_vOrigin, pName, data ); +} |