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.

66 lines
2.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Shadow control entity.
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "cbase.h"
  8. // memdbgon must be the last include file in a .cpp file!!!
  9. #include "tier0/memdbgon.h"
  10. //------------------------------------------------------------------------------
  11. // FIXME: This really should inherit from something more lightweight
  12. //------------------------------------------------------------------------------
  13. //------------------------------------------------------------------------------
  14. // Purpose : Shadow control entity
  15. //------------------------------------------------------------------------------
  16. class C_ShadowControl : public C_BaseEntity
  17. {
  18. public:
  19. DECLARE_CLASS( C_ShadowControl, C_BaseEntity );
  20. DECLARE_CLIENTCLASS();
  21. void OnDataChanged(DataUpdateType_t updateType);
  22. bool ShouldDraw();
  23. private:
  24. Vector m_shadowDirection;
  25. color32 m_shadowColor;
  26. float m_flShadowMaxDist;
  27. bool m_bDisableShadows;
  28. };
  29. IMPLEMENT_CLIENTCLASS_DT(C_ShadowControl, DT_ShadowControl, CShadowControl)
  30. RecvPropVector(RECVINFO(m_shadowDirection)),
  31. RecvPropInt(RECVINFO(m_shadowColor)),
  32. RecvPropFloat(RECVINFO(m_flShadowMaxDist)),
  33. RecvPropBool(RECVINFO(m_bDisableShadows)),
  34. END_RECV_TABLE()
  35. //------------------------------------------------------------------------------
  36. // Purpose :
  37. // Input :
  38. // Output :
  39. //------------------------------------------------------------------------------
  40. void C_ShadowControl::OnDataChanged(DataUpdateType_t updateType)
  41. {
  42. // Set the color, direction, distance...
  43. g_pClientShadowMgr->SetShadowDirection( m_shadowDirection );
  44. g_pClientShadowMgr->SetShadowColor( m_shadowColor.r, m_shadowColor.g, m_shadowColor.b );
  45. g_pClientShadowMgr->SetShadowDistance( m_flShadowMaxDist );
  46. g_pClientShadowMgr->SetShadowsDisabled( m_bDisableShadows );
  47. }
  48. //------------------------------------------------------------------------------
  49. // We don't draw...
  50. //------------------------------------------------------------------------------
  51. bool C_ShadowControl::ShouldDraw()
  52. {
  53. return false;
  54. }