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/func_occluder.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/func_occluder.cpp')
| -rw-r--r-- | mp/src/game/server/func_occluder.cpp | 246 |
1 files changed, 123 insertions, 123 deletions
diff --git a/mp/src/game/server/func_occluder.cpp b/mp/src/game/server/func_occluder.cpp index 6db178eb..37308df6 100644 --- a/mp/src/game/server/func_occluder.cpp +++ b/mp/src/game/server/func_occluder.cpp @@ -1,123 +1,123 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose: area portal entity: toggles visibility areas on/off
-//
-// NOTE: These are not really brush entities. They are brush entities from a
-// designer/worldcraft perspective, but by the time they reach the game, the
-// brush model is gone and this is, in effect, a point entity.
-//
-// $NoKeywords: $
-//=============================================================================//
-
-#include "cbase.h"
-
-// memdbgon must be the last include file in a .cpp file!!!
-#include "tier0/memdbgon.h"
-
-class CFuncOccluder : public CBaseEntity
-{
-public:
- DECLARE_CLASS( CFuncOccluder, CBaseEntity );
-
- CFuncOccluder();
-
- virtual void Spawn( void );
- virtual int UpdateTransmitState( void );
-
- // Input handlers
- void InputActivate( inputdata_t &inputdata );
- void InputDeactivate( inputdata_t &inputdata );
- void InputToggle( inputdata_t &inputdata );
-
- DECLARE_DATADESC();
- DECLARE_SERVERCLASS();
-
-private:
- CNetworkVar( bool, m_bActive );
- CNetworkVar( int, m_nOccluderIndex );
-};
-
-LINK_ENTITY_TO_CLASS( func_occluder, CFuncOccluder );
-
-IMPLEMENT_SERVERCLASS_ST_NOBASE(CFuncOccluder, DT_FuncOccluder)
- SendPropBool( SENDINFO(m_bActive) ),
- SendPropInt(SENDINFO(m_nOccluderIndex), 10, SPROP_UNSIGNED ),
-END_SEND_TABLE()
-
-
-BEGIN_DATADESC( CFuncOccluder )
-
- DEFINE_KEYFIELD( m_bActive, FIELD_BOOLEAN, "StartActive" ),
-
- // NOTE: This keyfield is computed + inserted by VBSP
- DEFINE_KEYFIELD( m_nOccluderIndex, FIELD_INTEGER, "occludernumber" ),
-
- // Inputs
- DEFINE_INPUTFUNC( FIELD_VOID, "Deactivate", InputDeactivate ),
- DEFINE_INPUTFUNC( FIELD_VOID, "Activate", InputActivate ),
- DEFINE_INPUTFUNC( FIELD_VOID, "Toggle", InputToggle ),
-
-END_DATADESC()
-
-
-//------------------------------------------------------------------------------
-// Occluder :
-//------------------------------------------------------------------------------
-CFuncOccluder::CFuncOccluder()
-{
- m_bActive = true;
-}
-
-
-//-----------------------------------------------------------------------------
-// Purpose:
-//-----------------------------------------------------------------------------
-void CFuncOccluder::Spawn( void )
-{
- Precache( );
-
- m_takedamage = DAMAGE_NO;
- SetSolid( SOLID_NONE );
- SetMoveType( MOVETYPE_NONE );
-
- // set size and link into world.
- SetModel( STRING( GetModelName() ) );
-}
-
-
-//------------------------------------------------------------------------------
-// Purpose :
-//------------------------------------------------------------------------------
-void CFuncOccluder::InputDeactivate( inputdata_t &inputdata )
-{
- m_bActive = false;
-}
-
-
-//------------------------------------------------------------------------------
-// Purpose :
-//------------------------------------------------------------------------------
-void CFuncOccluder::InputActivate( inputdata_t &inputdata )
-{
- m_bActive = true;
-}
-
-
-//------------------------------------------------------------------------------
-// Purpose :
-//------------------------------------------------------------------------------
-void CFuncOccluder::InputToggle( inputdata_t &inputdata )
-{
- m_bActive = !m_bActive;
-}
-
-
-//------------------------------------------------------------------------------
-// We always want to transmit these bad boys
-//------------------------------------------------------------------------------
-int CFuncOccluder::UpdateTransmitState()
-{
- // ALWAYS transmit to all clients.
- return SetTransmitState( FL_EDICT_ALWAYS );
-}
-
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: area portal entity: toggles visibility areas on/off +// +// NOTE: These are not really brush entities. They are brush entities from a +// designer/worldcraft perspective, but by the time they reach the game, the +// brush model is gone and this is, in effect, a point entity. +// +// $NoKeywords: $ +//=============================================================================// + +#include "cbase.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +class CFuncOccluder : public CBaseEntity +{ +public: + DECLARE_CLASS( CFuncOccluder, CBaseEntity ); + + CFuncOccluder(); + + virtual void Spawn( void ); + virtual int UpdateTransmitState( void ); + + // Input handlers + void InputActivate( inputdata_t &inputdata ); + void InputDeactivate( inputdata_t &inputdata ); + void InputToggle( inputdata_t &inputdata ); + + DECLARE_DATADESC(); + DECLARE_SERVERCLASS(); + +private: + CNetworkVar( bool, m_bActive ); + CNetworkVar( int, m_nOccluderIndex ); +}; + +LINK_ENTITY_TO_CLASS( func_occluder, CFuncOccluder ); + +IMPLEMENT_SERVERCLASS_ST_NOBASE(CFuncOccluder, DT_FuncOccluder) + SendPropBool( SENDINFO(m_bActive) ), + SendPropInt(SENDINFO(m_nOccluderIndex), 10, SPROP_UNSIGNED ), +END_SEND_TABLE() + + +BEGIN_DATADESC( CFuncOccluder ) + + DEFINE_KEYFIELD( m_bActive, FIELD_BOOLEAN, "StartActive" ), + + // NOTE: This keyfield is computed + inserted by VBSP + DEFINE_KEYFIELD( m_nOccluderIndex, FIELD_INTEGER, "occludernumber" ), + + // Inputs + DEFINE_INPUTFUNC( FIELD_VOID, "Deactivate", InputDeactivate ), + DEFINE_INPUTFUNC( FIELD_VOID, "Activate", InputActivate ), + DEFINE_INPUTFUNC( FIELD_VOID, "Toggle", InputToggle ), + +END_DATADESC() + + +//------------------------------------------------------------------------------ +// Occluder : +//------------------------------------------------------------------------------ +CFuncOccluder::CFuncOccluder() +{ + m_bActive = true; +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CFuncOccluder::Spawn( void ) +{ + Precache( ); + + m_takedamage = DAMAGE_NO; + SetSolid( SOLID_NONE ); + SetMoveType( MOVETYPE_NONE ); + + // set size and link into world. + SetModel( STRING( GetModelName() ) ); +} + + +//------------------------------------------------------------------------------ +// Purpose : +//------------------------------------------------------------------------------ +void CFuncOccluder::InputDeactivate( inputdata_t &inputdata ) +{ + m_bActive = false; +} + + +//------------------------------------------------------------------------------ +// Purpose : +//------------------------------------------------------------------------------ +void CFuncOccluder::InputActivate( inputdata_t &inputdata ) +{ + m_bActive = true; +} + + +//------------------------------------------------------------------------------ +// Purpose : +//------------------------------------------------------------------------------ +void CFuncOccluder::InputToggle( inputdata_t &inputdata ) +{ + m_bActive = !m_bActive; +} + + +//------------------------------------------------------------------------------ +// We always want to transmit these bad boys +//------------------------------------------------------------------------------ +int CFuncOccluder::UpdateTransmitState() +{ + // ALWAYS transmit to all clients. + return SetTransmitState( FL_EDICT_ALWAYS ); +} + |