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.

64 lines
1.8 KiB

  1. #if !defined ( ENV_DOF_CONTROLLER_H )
  2. #define ENV_DOF_CONTROLLER_H
  3. #ifdef _WIN32
  4. #pragma once
  5. #endif
  6. struct DOFControlSettings_t
  7. {
  8. // Near plane
  9. float flNearBlurDepth;
  10. float flNearBlurRadius;
  11. float flNearFocusDistance;
  12. // Far plane
  13. float flFarBlurDepth;
  14. float flFarBlurRadius;
  15. float flFarFocusDistance;
  16. };
  17. //-----------------------------------------------------------------------------
  18. // Purpose: Entity that controls depth of field postprocessing
  19. //-----------------------------------------------------------------------------
  20. class CEnvDOFController : public CPointEntity
  21. {
  22. DECLARE_CLASS( CEnvDOFController, CPointEntity );
  23. public:
  24. DECLARE_DATADESC();
  25. DECLARE_SERVERCLASS();
  26. virtual void Spawn( void );
  27. virtual void Activate( void );
  28. virtual int UpdateTransmitState( void );
  29. void SetControllerState( DOFControlSettings_t setting );
  30. void UpdateParamBlend( void );
  31. // Inputs
  32. void InputSetNearBlurDepth( inputdata_t &inputdata );
  33. void InputSetNearFocusDepth( inputdata_t &inputdata );
  34. void InputSetFarFocusDepth( inputdata_t &inputdata );
  35. void InputSetFarBlurDepth( inputdata_t &inputdata );
  36. void InputSetNearBlurRadius( inputdata_t &inputdata );
  37. void InputSetFarBlurRadius( inputdata_t &inputdata );
  38. void InputBlendDOFScale( inputdata_t &inputdata );
  39. void InputSetFocusTarget( inputdata_t &inputdata );
  40. void InputSetFocusTargetRange( inputdata_t &inputdata );
  41. private:
  42. float m_flFocusTargetRange;
  43. string_t m_strFocusTargetName; // Name of the entity to focus on
  44. EHANDLE m_hFocusTarget;
  45. CNetworkVar( bool, m_bDOFEnabled );
  46. CNetworkVar( float, m_flNearBlurDepth );
  47. CNetworkVar( float, m_flNearFocusDepth );
  48. CNetworkVar( float, m_flFarFocusDepth );
  49. CNetworkVar( float, m_flFarBlurDepth );
  50. CNetworkVar( float, m_flNearBlurRadius );
  51. CNetworkVar( float, m_flFarBlurRadius );
  52. };
  53. #endif// ENV_DOF_CONTROLLER_H