Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Water LOD control entity.
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "cbase.h"
  8. #include "iviewrender.h"
  9. // memdbgon must be the last include file in a .cpp file!!!
  10. #include "tier0/memdbgon.h"
  11. //------------------------------------------------------------------------------
  12. // FIXME: This really should inherit from something more lightweight
  13. //------------------------------------------------------------------------------
  14. //------------------------------------------------------------------------------
  15. // Purpose : Water LOD control entity
  16. //------------------------------------------------------------------------------
  17. class C_WaterLODControl : public C_BaseEntity
  18. {
  19. public:
  20. DECLARE_CLASS( C_WaterLODControl, C_BaseEntity );
  21. DECLARE_CLIENTCLASS();
  22. void OnDataChanged(DataUpdateType_t updateType);
  23. bool ShouldDraw();
  24. private:
  25. float m_flCheapWaterStartDistance;
  26. float m_flCheapWaterEndDistance;
  27. };
  28. IMPLEMENT_CLIENTCLASS_DT(C_WaterLODControl, DT_WaterLODControl, CWaterLODControl)
  29. RecvPropFloat(RECVINFO(m_flCheapWaterStartDistance)),
  30. RecvPropFloat(RECVINFO(m_flCheapWaterEndDistance)),
  31. END_RECV_TABLE()
  32. //------------------------------------------------------------------------------
  33. // Purpose :
  34. // Input :
  35. // Output :
  36. //------------------------------------------------------------------------------
  37. void C_WaterLODControl::OnDataChanged(DataUpdateType_t updateType)
  38. {
  39. view->SetCheapWaterStartDistance( m_flCheapWaterStartDistance );
  40. view->SetCheapWaterEndDistance( m_flCheapWaterEndDistance );
  41. }
  42. //------------------------------------------------------------------------------
  43. // We don't draw...
  44. //------------------------------------------------------------------------------
  45. bool C_WaterLODControl::ShouldDraw()
  46. {
  47. return false;
  48. }