Counter Strike : Global Offensive Source Code
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.

70 lines
1.7 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //===========================================================================//
  8. #include "cbase.h"
  9. #include "view.h"
  10. #include "iviewrender.h"
  11. #include "clientalphaproperty.h"
  12. // memdbgon must be the last include file in a .cpp file!!!
  13. #include "tier0/memdbgon.h"
  14. class C_Func_LOD : public C_BaseEntity
  15. {
  16. public:
  17. DECLARE_CLASS( C_Func_LOD, C_BaseEntity );
  18. DECLARE_CLIENTCLASS();
  19. C_Func_LOD();
  20. // C_BaseEntity overrides.
  21. public:
  22. virtual void OnDataChanged( DataUpdateType_t type );
  23. public:
  24. // Replicated vars from the server.
  25. // These are documented in the server-side entity.
  26. public:
  27. int m_nDisappearMinDist;
  28. int m_nDisappearMaxDist;
  29. };
  30. // ------------------------------------------------------------------------- //
  31. // Tables.
  32. // ------------------------------------------------------------------------- //
  33. // Datatable..
  34. IMPLEMENT_CLIENTCLASS_DT(C_Func_LOD, DT_Func_LOD, CFunc_LOD)
  35. RecvPropInt(RECVINFO(m_nDisappearMinDist)),
  36. RecvPropInt(RECVINFO(m_nDisappearMaxDist)),
  37. END_RECV_TABLE()
  38. // ------------------------------------------------------------------------- //
  39. // C_Func_LOD implementation.
  40. // ------------------------------------------------------------------------- //
  41. C_Func_LOD::C_Func_LOD()
  42. {
  43. m_nDisappearMinDist = 5000;
  44. m_nDisappearMaxDist = 5800;
  45. }
  46. void C_Func_LOD::OnDataChanged( DataUpdateType_t type )
  47. {
  48. BaseClass::OnDataChanged( type );
  49. bool bCreate = (type == DATA_UPDATE_CREATED) ? true : false;
  50. VPhysicsShadowDataChanged(bCreate, this);
  51. // Copy in fade parameters
  52. AlphaProp()->SetFade( 1.0f, m_nDisappearMinDist, m_nDisappearMaxDist );
  53. }