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 /mp/src/game/server/te_dynamiclight.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 'mp/src/game/server/te_dynamiclight.cpp')
| -rw-r--r-- | mp/src/game/server/te_dynamiclight.cpp | 286 |
1 files changed, 143 insertions, 143 deletions
diff --git a/mp/src/game/server/te_dynamiclight.cpp b/mp/src/game/server/te_dynamiclight.cpp index 20c0c480..616d40ef 100644 --- a/mp/src/game/server/te_dynamiclight.cpp +++ b/mp/src/game/server/te_dynamiclight.cpp @@ -1,144 +1,144 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $Workfile: $
-// $Date: $
-//
-//-----------------------------------------------------------------------------
-// $Log: $
-//
-// $NoKeywords: $
-//=============================================================================//
-#include "cbase.h"
-#include "basetempentity.h"
-
-// memdbgon must be the last include file in a .cpp file!!!
-#include "tier0/memdbgon.h"
-
-//-----------------------------------------------------------------------------
-// Purpose: Displays a dynamic light
-//-----------------------------------------------------------------------------
-class CTEDynamicLight : public CBaseTempEntity
-{
-public:
- DECLARE_CLASS( CTEDynamicLight, CBaseTempEntity );
-
- CTEDynamicLight( const char *name );
- virtual ~CTEDynamicLight( void );
-
- virtual void Test( const Vector& current_origin, const QAngle& current_angles );
-
- DECLARE_SERVERCLASS();
-
-public:
- CNetworkVector( m_vecOrigin );
- CNetworkVar( float, m_fRadius );
- CNetworkVar( int, r );
- CNetworkVar( int, g );
- CNetworkVar( int, b );
- CNetworkVar( int, exponent );
- CNetworkVar( float, m_fTime );
- CNetworkVar( float, m_fDecay );
-};
-
-//-----------------------------------------------------------------------------
-// Purpose:
-// Input : *name -
-//-----------------------------------------------------------------------------
-CTEDynamicLight::CTEDynamicLight( const char *name ) :
- CBaseTempEntity( name )
-{
- m_vecOrigin.Init();
- r = 0;
- g = 0;
- b = 0;
- exponent = 0;
- m_fRadius = 0.0;
- m_fTime = 0.0;
- m_fDecay = 0.0;
-}
-
-//-----------------------------------------------------------------------------
-// Purpose:
-//-----------------------------------------------------------------------------
-CTEDynamicLight::~CTEDynamicLight( void )
-{
-}
-
-//-----------------------------------------------------------------------------
-// Purpose:
-// Input : *current_origin -
-// *current_angles -
-//-----------------------------------------------------------------------------
-void CTEDynamicLight::Test( const Vector& current_origin, const QAngle& current_angles )
-{
- // Fill in data
- r = 255;
- g = 255;
- b = 63;
- m_vecOrigin = current_origin;
-
- m_fRadius = 200;
- m_fTime = 2.0;
- m_fDecay = 0.0;
-
- Vector forward;
-
- m_vecOrigin.GetForModify()[2] += 24;
-
- AngleVectors( current_angles, &forward );
- forward[2] = 0.0;
- VectorNormalize( forward );
-
- VectorMA( m_vecOrigin, 50.0, forward, m_vecOrigin.GetForModify() );
-
- CBroadcastRecipientFilter filter;
- Create( filter, 0.0 );
-}
-
-IMPLEMENT_SERVERCLASS_ST(CTEDynamicLight, DT_TEDynamicLight)
- SendPropVector( SENDINFO(m_vecOrigin), -1, SPROP_COORD),
- SendPropInt( SENDINFO(r), 8, SPROP_UNSIGNED ),
- SendPropInt( SENDINFO(g), 8, SPROP_UNSIGNED ),
- SendPropInt( SENDINFO(b), 8, SPROP_UNSIGNED ),
- SendPropInt( SENDINFO(exponent), 8, 0 ),
- SendPropFloat( SENDINFO(m_fRadius), 8, SPROP_ROUNDUP, 0, 2560.0 ),
- SendPropFloat( SENDINFO(m_fTime), 8, SPROP_ROUNDDOWN, 0, 25.6 ),
- SendPropFloat( SENDINFO(m_fDecay), 8, SPROP_ROUNDDOWN, 0, 2560.0 ),
-END_SEND_TABLE()
-
-
-// Singleton
-static CTEDynamicLight g_TEDynamicLight( "Dynamic Light" );
-
-//-----------------------------------------------------------------------------
-// Purpose:
-// Input : msg_dest -
-// delay -
-// *origin -
-// *recipient -
-// *org -
-// r -
-// g -
-// b -
-// radius -
-// time -
-// decay -
-//-----------------------------------------------------------------------------
-void TE_DynamicLight( IRecipientFilter& filter, float delay,
- const Vector* org, int r, int g, int b, int exponent, float radius, float time, float decay )
-{
- // Set up parameters
- g_TEDynamicLight.m_vecOrigin = *org;
- g_TEDynamicLight.r = r;
- g_TEDynamicLight.g = g;
- g_TEDynamicLight.b = b;
- g_TEDynamicLight.exponent = exponent;
- g_TEDynamicLight.m_fRadius = radius;
- g_TEDynamicLight.m_fTime = time;
- g_TEDynamicLight.m_fDecay = decay;
-
- // Create it
- g_TEDynamicLight.Create( filter, delay );
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $Workfile: $ +// $Date: $ +// +//----------------------------------------------------------------------------- +// $Log: $ +// +// $NoKeywords: $ +//=============================================================================// +#include "cbase.h" +#include "basetempentity.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +//----------------------------------------------------------------------------- +// Purpose: Displays a dynamic light +//----------------------------------------------------------------------------- +class CTEDynamicLight : public CBaseTempEntity +{ +public: + DECLARE_CLASS( CTEDynamicLight, CBaseTempEntity ); + + CTEDynamicLight( const char *name ); + virtual ~CTEDynamicLight( void ); + + virtual void Test( const Vector& current_origin, const QAngle& current_angles ); + + DECLARE_SERVERCLASS(); + +public: + CNetworkVector( m_vecOrigin ); + CNetworkVar( float, m_fRadius ); + CNetworkVar( int, r ); + CNetworkVar( int, g ); + CNetworkVar( int, b ); + CNetworkVar( int, exponent ); + CNetworkVar( float, m_fTime ); + CNetworkVar( float, m_fDecay ); +}; + +//----------------------------------------------------------------------------- +// Purpose: +// Input : *name - +//----------------------------------------------------------------------------- +CTEDynamicLight::CTEDynamicLight( const char *name ) : + CBaseTempEntity( name ) +{ + m_vecOrigin.Init(); + r = 0; + g = 0; + b = 0; + exponent = 0; + m_fRadius = 0.0; + m_fTime = 0.0; + m_fDecay = 0.0; +} + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +CTEDynamicLight::~CTEDynamicLight( void ) +{ +} + +//----------------------------------------------------------------------------- +// Purpose: +// Input : *current_origin - +// *current_angles - +//----------------------------------------------------------------------------- +void CTEDynamicLight::Test( const Vector& current_origin, const QAngle& current_angles ) +{ + // Fill in data + r = 255; + g = 255; + b = 63; + m_vecOrigin = current_origin; + + m_fRadius = 200; + m_fTime = 2.0; + m_fDecay = 0.0; + + Vector forward; + + m_vecOrigin.GetForModify()[2] += 24; + + AngleVectors( current_angles, &forward ); + forward[2] = 0.0; + VectorNormalize( forward ); + + VectorMA( m_vecOrigin, 50.0, forward, m_vecOrigin.GetForModify() ); + + CBroadcastRecipientFilter filter; + Create( filter, 0.0 ); +} + +IMPLEMENT_SERVERCLASS_ST(CTEDynamicLight, DT_TEDynamicLight) + SendPropVector( SENDINFO(m_vecOrigin), -1, SPROP_COORD), + SendPropInt( SENDINFO(r), 8, SPROP_UNSIGNED ), + SendPropInt( SENDINFO(g), 8, SPROP_UNSIGNED ), + SendPropInt( SENDINFO(b), 8, SPROP_UNSIGNED ), + SendPropInt( SENDINFO(exponent), 8, 0 ), + SendPropFloat( SENDINFO(m_fRadius), 8, SPROP_ROUNDUP, 0, 2560.0 ), + SendPropFloat( SENDINFO(m_fTime), 8, SPROP_ROUNDDOWN, 0, 25.6 ), + SendPropFloat( SENDINFO(m_fDecay), 8, SPROP_ROUNDDOWN, 0, 2560.0 ), +END_SEND_TABLE() + + +// Singleton +static CTEDynamicLight g_TEDynamicLight( "Dynamic Light" ); + +//----------------------------------------------------------------------------- +// Purpose: +// Input : msg_dest - +// delay - +// *origin - +// *recipient - +// *org - +// r - +// g - +// b - +// radius - +// time - +// decay - +//----------------------------------------------------------------------------- +void TE_DynamicLight( IRecipientFilter& filter, float delay, + const Vector* org, int r, int g, int b, int exponent, float radius, float time, float decay ) +{ + // Set up parameters + g_TEDynamicLight.m_vecOrigin = *org; + g_TEDynamicLight.r = r; + g_TEDynamicLight.g = g; + g_TEDynamicLight.b = b; + g_TEDynamicLight.exponent = exponent; + g_TEDynamicLight.m_fRadius = radius; + g_TEDynamicLight.m_fTime = time; + g_TEDynamicLight.m_fDecay = decay; + + // Create it + g_TEDynamicLight.Create( filter, delay ); }
\ No newline at end of file |