aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/shared/env_detail_controller.cpp
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
committerJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
commit39ed87570bdb2f86969d4be821c94b722dc71179 (patch)
treeabc53757f75f40c80278e87650ea92808274aa59 /mp/src/game/shared/env_detail_controller.cpp
downloadsource-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz
source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/game/shared/env_detail_controller.cpp')
-rw-r--r--mp/src/game/shared/env_detail_controller.cpp75
1 files changed, 75 insertions, 0 deletions
diff --git a/mp/src/game/shared/env_detail_controller.cpp b/mp/src/game/shared/env_detail_controller.cpp
new file mode 100644
index 00000000..26bbd6ab
--- /dev/null
+++ b/mp/src/game/shared/env_detail_controller.cpp
@@ -0,0 +1,75 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#include "cbase.h"
+
+#include "env_detail_controller.h"
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include "tier0/memdbgon.h"
+
+LINK_ENTITY_TO_CLASS(env_detail_controller, CEnvDetailController);
+
+IMPLEMENT_NETWORKCLASS_ALIASED( EnvDetailController, DT_DetailController )
+
+BEGIN_NETWORK_TABLE_NOBASE( CEnvDetailController, DT_DetailController )
+ #ifdef CLIENT_DLL
+ RecvPropFloat( RECVINFO( m_flFadeStartDist ) ),
+ RecvPropFloat( RECVINFO( m_flFadeEndDist ) ),
+ #else
+ SendPropFloat( SENDINFO( m_flFadeStartDist ) ),
+ SendPropFloat( SENDINFO( m_flFadeEndDist ) ),
+ #endif
+END_NETWORK_TABLE()
+
+static CEnvDetailController *s_detailController = NULL;
+CEnvDetailController * GetDetailController()
+{
+ return s_detailController;
+}
+
+CEnvDetailController::CEnvDetailController()
+{
+ s_detailController = this;
+}
+
+CEnvDetailController::~CEnvDetailController()
+{
+ if ( s_detailController == this )
+ {
+ s_detailController = NULL;
+ }
+}
+
+//--------------------------------------------------------------------------------------------------------------
+int CEnvDetailController::UpdateTransmitState()
+{
+#ifndef CLIENT_DLL
+ // ALWAYS transmit to all clients.
+ return SetTransmitState( FL_EDICT_ALWAYS );
+#else
+ return 0;
+#endif
+}
+
+#ifndef CLIENT_DLL
+
+ bool CEnvDetailController::KeyValue( const char *szKeyName, const char *szValue )
+ {
+ if (FStrEq(szKeyName, "fademindist"))
+ {
+ m_flFadeStartDist = atof(szValue);
+ }
+ else if (FStrEq(szKeyName, "fademaxdist"))
+ {
+ m_flFadeEndDist = atof(szValue);
+ }
+
+ return true;
+ }
+
+#endif // !CLIENT_DLL