summaryrefslogtreecommitdiff
path: root/game/client/C_WaterLODControl.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/C_WaterLODControl.cpp
downloadarchived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.tar.xz
archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.zip
Diffstat (limited to 'game/client/C_WaterLODControl.cpp')
-rw-r--r--game/client/C_WaterLODControl.cpp60
1 files changed, 60 insertions, 0 deletions
diff --git a/game/client/C_WaterLODControl.cpp b/game/client/C_WaterLODControl.cpp
new file mode 100644
index 0000000..2e27ffb
--- /dev/null
+++ b/game/client/C_WaterLODControl.cpp
@@ -0,0 +1,60 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: Water LOD control entity.
+//
+// $NoKeywords: $
+//=============================================================================//
+#include "cbase.h"
+#include "iviewrender.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 C_WaterLODControl : public C_BaseEntity
+{
+public:
+ DECLARE_CLASS( C_WaterLODControl, C_BaseEntity );
+
+ DECLARE_CLIENTCLASS();
+
+ void OnDataChanged(DataUpdateType_t updateType);
+ bool ShouldDraw();
+
+private:
+ float m_flCheapWaterStartDistance;
+ float m_flCheapWaterEndDistance;
+};
+
+IMPLEMENT_CLIENTCLASS_DT(C_WaterLODControl, DT_WaterLODControl, CWaterLODControl)
+ RecvPropFloat(RECVINFO(m_flCheapWaterStartDistance)),
+ RecvPropFloat(RECVINFO(m_flCheapWaterEndDistance)),
+END_RECV_TABLE()
+
+
+//------------------------------------------------------------------------------
+// Purpose :
+// Input :
+// Output :
+//------------------------------------------------------------------------------
+void C_WaterLODControl::OnDataChanged(DataUpdateType_t updateType)
+{
+ view->SetCheapWaterStartDistance( m_flCheapWaterStartDistance );
+ view->SetCheapWaterEndDistance( m_flCheapWaterEndDistance );
+}
+
+//------------------------------------------------------------------------------
+// We don't draw...
+//------------------------------------------------------------------------------
+bool C_WaterLODControl::ShouldDraw()
+{
+ return false;
+}
+