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/WaterLODControl.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/WaterLODControl.cpp')
| -rw-r--r-- | sp/src/game/server/WaterLODControl.cpp | 236 |
1 files changed, 118 insertions, 118 deletions
diff --git a/sp/src/game/server/WaterLODControl.cpp b/sp/src/game/server/WaterLODControl.cpp index 64488bb4..ebe61665 100644 --- a/sp/src/game/server/WaterLODControl.cpp +++ b/sp/src/game/server/WaterLODControl.cpp @@ -1,118 +1,118 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose: Shadow control entity.
-//
-// $NoKeywords: $
-//=============================================================================//
-
-#include "cbase.h"
-
-// memdbgon must be the last include file in a .cpp file!!!
-#include "tier0/memdbgon.h"
-
-//------------------------------------------------------------------------------
-// FIXME: This really should inherit from something more lightweight
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-// Purpose : Water LOD control entity
-//------------------------------------------------------------------------------
-class CWaterLODControl : public CBaseEntity
-{
-public:
- DECLARE_CLASS( CWaterLODControl, CBaseEntity );
-
- CWaterLODControl();
-
- void Spawn( void );
- bool KeyValue( const char *szKeyName, const char *szValue );
- int UpdateTransmitState();
- void SetCheapWaterStartDistance( inputdata_t &inputdata );
- void SetCheapWaterEndDistance( inputdata_t &inputdata );
-
- virtual int ObjectCaps( void ) { return BaseClass::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
-
- DECLARE_SERVERCLASS();
- DECLARE_DATADESC();
-
-private:
- CNetworkVar( float, m_flCheapWaterStartDistance );
- CNetworkVar( float, m_flCheapWaterEndDistance );
-};
-
-LINK_ENTITY_TO_CLASS(water_lod_control, CWaterLODControl);
-
-BEGIN_DATADESC( CWaterLODControl )
-
- DEFINE_KEYFIELD( m_flCheapWaterStartDistance, FIELD_FLOAT, "cheapwaterstartdistance" ),
- DEFINE_KEYFIELD( m_flCheapWaterEndDistance, FIELD_FLOAT, "cheapwaterenddistance" ),
-
- // Inputs
- DEFINE_INPUT( m_flCheapWaterStartDistance, FIELD_FLOAT, "SetCheapWaterStartDistance" ),
- DEFINE_INPUT( m_flCheapWaterEndDistance, FIELD_FLOAT, "SetCheapWaterEndDistance" ),
-
-END_DATADESC()
-
-
-IMPLEMENT_SERVERCLASS_ST_NOBASE(CWaterLODControl, DT_WaterLODControl)
- SendPropFloat(SENDINFO(m_flCheapWaterStartDistance), 0, SPROP_NOSCALE ),
- SendPropFloat(SENDINFO(m_flCheapWaterEndDistance), 0, SPROP_NOSCALE ),
-END_SEND_TABLE()
-
-
-CWaterLODControl::CWaterLODControl()
-{
- m_flCheapWaterStartDistance = 1000.0f;
- m_flCheapWaterEndDistance = 2000.0f;
-}
-
-
-//------------------------------------------------------------------------------
-// Purpose : Send even though we don't have a model
-//------------------------------------------------------------------------------
-int CWaterLODControl::UpdateTransmitState()
-{
- // ALWAYS transmit to all clients.
- return SetTransmitState( FL_EDICT_ALWAYS );
-}
-
-
-bool CWaterLODControl::KeyValue( const char *szKeyName, const char *szValue )
-{
- if ( FStrEq( szKeyName, "cheapwaterstartdistance" ) )
- {
- m_flCheapWaterStartDistance = atof( szValue );
- return true;
- }
-
- if ( FStrEq( szKeyName, "cheapwaterenddistance" ) )
- {
- m_flCheapWaterEndDistance = atof( szValue );
- return true;
- }
-
- return BaseClass::KeyValue( szKeyName, szValue );
-}
-
-//------------------------------------------------------------------------------
-// Purpose :
-//------------------------------------------------------------------------------
-void CWaterLODControl::Spawn( void )
-{
- Precache();
- SetSolid( SOLID_NONE );
-}
-
-//------------------------------------------------------------------------------
-// Input values
-//------------------------------------------------------------------------------
-void CWaterLODControl::SetCheapWaterStartDistance( inputdata_t &inputdata )
-{
- m_flCheapWaterStartDistance = atof( inputdata.value.String() );
-}
-
-void CWaterLODControl::SetCheapWaterEndDistance( inputdata_t &inputdata )
-{
- m_flCheapWaterEndDistance = atof( inputdata.value.String() );
-}
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Shadow control entity. +// +// $NoKeywords: $ +//=============================================================================// + +#include "cbase.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +//------------------------------------------------------------------------------ +// FIXME: This really should inherit from something more lightweight +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +// Purpose : Water LOD control entity +//------------------------------------------------------------------------------ +class CWaterLODControl : public CBaseEntity +{ +public: + DECLARE_CLASS( CWaterLODControl, CBaseEntity ); + + CWaterLODControl(); + + void Spawn( void ); + bool KeyValue( const char *szKeyName, const char *szValue ); + int UpdateTransmitState(); + void SetCheapWaterStartDistance( inputdata_t &inputdata ); + void SetCheapWaterEndDistance( inputdata_t &inputdata ); + + virtual int ObjectCaps( void ) { return BaseClass::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; } + + DECLARE_SERVERCLASS(); + DECLARE_DATADESC(); + +private: + CNetworkVar( float, m_flCheapWaterStartDistance ); + CNetworkVar( float, m_flCheapWaterEndDistance ); +}; + +LINK_ENTITY_TO_CLASS(water_lod_control, CWaterLODControl); + +BEGIN_DATADESC( CWaterLODControl ) + + DEFINE_KEYFIELD( m_flCheapWaterStartDistance, FIELD_FLOAT, "cheapwaterstartdistance" ), + DEFINE_KEYFIELD( m_flCheapWaterEndDistance, FIELD_FLOAT, "cheapwaterenddistance" ), + + // Inputs + DEFINE_INPUT( m_flCheapWaterStartDistance, FIELD_FLOAT, "SetCheapWaterStartDistance" ), + DEFINE_INPUT( m_flCheapWaterEndDistance, FIELD_FLOAT, "SetCheapWaterEndDistance" ), + +END_DATADESC() + + +IMPLEMENT_SERVERCLASS_ST_NOBASE(CWaterLODControl, DT_WaterLODControl) + SendPropFloat(SENDINFO(m_flCheapWaterStartDistance), 0, SPROP_NOSCALE ), + SendPropFloat(SENDINFO(m_flCheapWaterEndDistance), 0, SPROP_NOSCALE ), +END_SEND_TABLE() + + +CWaterLODControl::CWaterLODControl() +{ + m_flCheapWaterStartDistance = 1000.0f; + m_flCheapWaterEndDistance = 2000.0f; +} + + +//------------------------------------------------------------------------------ +// Purpose : Send even though we don't have a model +//------------------------------------------------------------------------------ +int CWaterLODControl::UpdateTransmitState() +{ + // ALWAYS transmit to all clients. + return SetTransmitState( FL_EDICT_ALWAYS ); +} + + +bool CWaterLODControl::KeyValue( const char *szKeyName, const char *szValue ) +{ + if ( FStrEq( szKeyName, "cheapwaterstartdistance" ) ) + { + m_flCheapWaterStartDistance = atof( szValue ); + return true; + } + + if ( FStrEq( szKeyName, "cheapwaterenddistance" ) ) + { + m_flCheapWaterEndDistance = atof( szValue ); + return true; + } + + return BaseClass::KeyValue( szKeyName, szValue ); +} + +//------------------------------------------------------------------------------ +// Purpose : +//------------------------------------------------------------------------------ +void CWaterLODControl::Spawn( void ) +{ + Precache(); + SetSolid( SOLID_NONE ); +} + +//------------------------------------------------------------------------------ +// Input values +//------------------------------------------------------------------------------ +void CWaterLODControl::SetCheapWaterStartDistance( inputdata_t &inputdata ) +{ + m_flCheapWaterStartDistance = atof( inputdata.value.String() ); +} + +void CWaterLODControl::SetCheapWaterEndDistance( inputdata_t &inputdata ) +{ + m_flCheapWaterEndDistance = atof( inputdata.value.String() ); +} |