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_lod.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_lod.cpp')
| -rw-r--r-- | mp/src/game/server/func_lod.cpp | 230 |
1 files changed, 115 insertions, 115 deletions
diff --git a/mp/src/game/server/func_lod.cpp b/mp/src/game/server/func_lod.cpp index a6dbf18b..f88c4c0d 100644 --- a/mp/src/game/server/func_lod.cpp +++ b/mp/src/game/server/func_lod.cpp @@ -1,115 +1,115 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//
-//=============================================================================//
-
-#include "cbase.h"
-
-// memdbgon must be the last include file in a .cpp file!!!
-#include "tier0/memdbgon.h"
-
-class CFunc_LOD : public CBaseEntity
-{
- DECLARE_DATADESC();
- DECLARE_CLASS( CFunc_LOD, CBaseEntity );
-public:
- DECLARE_SERVERCLASS();
-
- CFunc_LOD();
- virtual ~CFunc_LOD();
-
-
- // When the viewer is between:
- // (0 and m_fNonintrusiveDist): the bmodel is forced to be visible
- // (m_fNonintrusiveDist and m_fDisappearDist): the bmodel is trying to appear or disappear nonintrusively
- // (waits until it's out of the view frustrum or until there's a lot of motion)
- // (m_fDisappearDist+): the bmodel is forced to be invisible
- CNetworkVar( float, m_fDisappearDist );
-
-// CBaseEntity overrides.
-public:
-
- virtual void Spawn();
- bool CreateVPhysics();
- virtual void Activate();
- virtual bool KeyValue( const char *szKeyName, const char *szValue );
-};
-
-
-IMPLEMENT_SERVERCLASS_ST(CFunc_LOD, DT_Func_LOD)
- SendPropFloat(SENDINFO(m_fDisappearDist), 0, SPROP_NOSCALE),
-END_SEND_TABLE()
-
-
-LINK_ENTITY_TO_CLASS(func_lod, CFunc_LOD);
-
-
-//---------------------------------------------------------
-// Save/Restore
-//---------------------------------------------------------
-BEGIN_DATADESC( CFunc_LOD )
-
- DEFINE_FIELD( m_fDisappearDist, FIELD_FLOAT ),
-
-END_DATADESC()
-
-
-// ------------------------------------------------------------------------------------- //
-// CFunc_LOD implementation.
-// ------------------------------------------------------------------------------------- //
-CFunc_LOD::CFunc_LOD()
-{
-}
-
-
-CFunc_LOD::~CFunc_LOD()
-{
-}
-
-
-void CFunc_LOD::Spawn()
-{
- // Bind to our bmodel.
- SetModel( STRING( GetModelName() ) );
- SetSolid( SOLID_BSP );
- BaseClass::Spawn();
-
- CreateVPhysics();
-}
-
-bool CFunc_LOD::CreateVPhysics()
-{
- VPhysicsInitStatic();
- return true;
-}
-
-void CFunc_LOD::Activate()
-{
- BaseClass::Activate();
-}
-
-
-bool CFunc_LOD::KeyValue( const char *szKeyName, const char *szValue )
-{
- if (FStrEq(szKeyName, "DisappearDist"))
- {
- m_fDisappearDist = (float)atof(szValue);
- }
- else if (FStrEq(szKeyName, "Solid"))
- {
- if (atoi(szValue) != 0)
- {
- AddSolidFlags( FSOLID_NOT_SOLID );
- }
- }
- else
- {
- return BaseClass::KeyValue(szKeyName, szValue);
- }
-
- return true;
-}
-
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +// +//=============================================================================// + +#include "cbase.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +class CFunc_LOD : public CBaseEntity +{ + DECLARE_DATADESC(); + DECLARE_CLASS( CFunc_LOD, CBaseEntity ); +public: + DECLARE_SERVERCLASS(); + + CFunc_LOD(); + virtual ~CFunc_LOD(); + + + // When the viewer is between: + // (0 and m_fNonintrusiveDist): the bmodel is forced to be visible + // (m_fNonintrusiveDist and m_fDisappearDist): the bmodel is trying to appear or disappear nonintrusively + // (waits until it's out of the view frustrum or until there's a lot of motion) + // (m_fDisappearDist+): the bmodel is forced to be invisible + CNetworkVar( float, m_fDisappearDist ); + +// CBaseEntity overrides. +public: + + virtual void Spawn(); + bool CreateVPhysics(); + virtual void Activate(); + virtual bool KeyValue( const char *szKeyName, const char *szValue ); +}; + + +IMPLEMENT_SERVERCLASS_ST(CFunc_LOD, DT_Func_LOD) + SendPropFloat(SENDINFO(m_fDisappearDist), 0, SPROP_NOSCALE), +END_SEND_TABLE() + + +LINK_ENTITY_TO_CLASS(func_lod, CFunc_LOD); + + +//--------------------------------------------------------- +// Save/Restore +//--------------------------------------------------------- +BEGIN_DATADESC( CFunc_LOD ) + + DEFINE_FIELD( m_fDisappearDist, FIELD_FLOAT ), + +END_DATADESC() + + +// ------------------------------------------------------------------------------------- // +// CFunc_LOD implementation. +// ------------------------------------------------------------------------------------- // +CFunc_LOD::CFunc_LOD() +{ +} + + +CFunc_LOD::~CFunc_LOD() +{ +} + + +void CFunc_LOD::Spawn() +{ + // Bind to our bmodel. + SetModel( STRING( GetModelName() ) ); + SetSolid( SOLID_BSP ); + BaseClass::Spawn(); + + CreateVPhysics(); +} + +bool CFunc_LOD::CreateVPhysics() +{ + VPhysicsInitStatic(); + return true; +} + +void CFunc_LOD::Activate() +{ + BaseClass::Activate(); +} + + +bool CFunc_LOD::KeyValue( const char *szKeyName, const char *szValue ) +{ + if (FStrEq(szKeyName, "DisappearDist")) + { + m_fDisappearDist = (float)atof(szValue); + } + else if (FStrEq(szKeyName, "Solid")) + { + if (atoi(szValue) != 0) + { + AddSolidFlags( FSOLID_NOT_SOLID ); + } + } + else + { + return BaseClass::KeyValue(szKeyName, szValue); + } + + return true; +} + |