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.

69 lines
2.3 KiB

  1. //========= Copyright � 1996-2005, 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. bool m_bEnableLocalLightShadows;
  29. };
  30. IMPLEMENT_CLIENTCLASS_DT(C_ShadowControl, DT_ShadowControl, CShadowControl)
  31. RecvPropVector(RECVINFO(m_shadowDirection)),
  32. RecvPropInt(RECVINFO(m_shadowColor), 0, RecvProxy_Int32ToColor32),
  33. RecvPropFloat(RECVINFO(m_flShadowMaxDist)),
  34. RecvPropBool(RECVINFO(m_bDisableShadows)),
  35. RecvPropBool(RECVINFO(m_bEnableLocalLightShadows)),
  36. END_RECV_TABLE()
  37. //------------------------------------------------------------------------------
  38. // Purpose :
  39. // Input :
  40. // Output :
  41. //------------------------------------------------------------------------------
  42. void C_ShadowControl::OnDataChanged(DataUpdateType_t updateType)
  43. {
  44. // Set the color, direction, distance...
  45. g_pClientShadowMgr->SetShadowDirection( m_shadowDirection );
  46. g_pClientShadowMgr->SetShadowColor( m_shadowColor.r, m_shadowColor.g, m_shadowColor.b );
  47. g_pClientShadowMgr->SetShadowDistance( m_flShadowMaxDist );
  48. g_pClientShadowMgr->SetShadowsDisabled( m_bDisableShadows );
  49. g_pClientShadowMgr->SetShadowFromWorldLightsEnabled( m_bEnableLocalLightShadows );
  50. }
  51. //------------------------------------------------------------------------------
  52. // We don't draw...
  53. //------------------------------------------------------------------------------
  54. bool C_ShadowControl::ShouldDraw()
  55. {
  56. return false;
  57. }