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
2.0 KiB

  1. #ifndef ENV_CASCADE_LIGHT_H
  2. #define ENV_CASCADE_LIGHT_H
  3. #ifdef _WIN32
  4. #pragma once
  5. #endif
  6. //------------------------------------------------------------------------------
  7. // Purpose : Sunlight shadow control entity
  8. //------------------------------------------------------------------------------
  9. class CCascadeLight : public CBaseEntity
  10. {
  11. public:
  12. DECLARE_CLASS( CCascadeLight, CBaseEntity );
  13. CCascadeLight();
  14. virtual ~CCascadeLight();
  15. void Spawn( void );
  16. void Release( void );
  17. void OnActivate();
  18. void OnDeactivate();
  19. bool KeyValue( const char *szKeyName, const char *szValue );
  20. virtual bool GetKeyValue( const char *szKeyName, char *szValue, int iMaxLen );
  21. int UpdateTransmitState();
  22. inline const Vector &GetShadowDirection() const { return m_shadowDirection; }
  23. inline const Vector &GetEnvLightShadowDirection() const { return m_envLightShadowDirection; }
  24. // Inputs
  25. void InputSetAngles( inputdata_t &inputdata );
  26. void InputEnable( inputdata_t &inputdata );
  27. void InputDisable( inputdata_t &inputdata );
  28. void InputSetLightColor( inputdata_t &inputdata );
  29. void InputSetLightColorScale( inputdata_t &inputdata );
  30. virtual int ObjectCaps( void ) { return BaseClass::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
  31. DECLARE_SERVERCLASS();
  32. DECLARE_DATADESC();
  33. static void SetEnvLightShadowPitch( float flPitch );
  34. static void SetEnvLightShadowAngles( const QAngle &angles );
  35. static void SetLightColor( int r, int g, int b, int a );
  36. void SetEnabled( bool bEnable );
  37. private:
  38. CNetworkVector( m_shadowDirection );
  39. CNetworkVector( m_envLightShadowDirection );
  40. CNetworkVar( bool, m_bEnabled );
  41. bool m_bStartDisabled;
  42. CNetworkVar( bool, m_bUseLightEnvAngles );
  43. CNetworkColor32( m_LightColor );
  44. CNetworkVar( int, m_LightColorScale );
  45. CNetworkVar( float, m_flMaxShadowDist );
  46. void UpdateEnvLight();
  47. static float m_flEnvLightShadowPitch;
  48. static QAngle m_EnvLightShadowAngles;
  49. static bool m_bEnvLightShadowValid;
  50. static color32 m_EnvLightColor;
  51. static int m_EnvLightColorScale;
  52. };
  53. extern CCascadeLight *g_pCascadeLight;
  54. #endif // #ifndef ENV_CASCADE_LIGHT_H