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.

96 lines
2.5 KiB

  1. //========= Copyright � 1996-2008, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef POSTPROCESSCONTROLLER_H
  7. #define POSTPROCESSCONTROLLER_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "GameEventListener.h"
  12. #include "postprocess_shared.h"
  13. // Spawn Flags
  14. #define SF_POSTPROCESS_MASTER 0x0001
  15. //=============================================================================
  16. //
  17. // Class Postprocess Controller:
  18. //
  19. class CPostProcessController : public CBaseEntity
  20. {
  21. public:
  22. DECLARE_SERVERCLASS();
  23. DECLARE_DATADESC();
  24. DECLARE_CLASS( CPostProcessController, CBaseEntity );
  25. CPostProcessController();
  26. virtual ~CPostProcessController();
  27. // Parse data from a map file
  28. virtual void Activate();
  29. virtual int UpdateTransmitState();
  30. // Input handlers
  31. void InputSetFadeTime(inputdata_t &data);
  32. void InputSetLocalContrastStrength(inputdata_t &data);
  33. void InputSetLocalContrastEdgeStrength(inputdata_t &data);
  34. void InputSetVignetteStart(inputdata_t &data);
  35. void InputSetVignetteEnd(inputdata_t &data);
  36. void InputSetVignetteBlurStrength(inputdata_t &data);
  37. void InputSetFadeToBlackStrength(inputdata_t &data);
  38. void InputSetDepthBlurFocalDistance(inputdata_t &data);
  39. void InputSetDepthBlurStrength(inputdata_t &data);
  40. void InputSetScreenBlurStrength(inputdata_t &data);
  41. void InputSetFilmGrainStrength(inputdata_t &data);
  42. void InputTurnOn(inputdata_t &data);
  43. void InputTurnOff(inputdata_t &data);
  44. void Spawn( void );
  45. bool IsMaster( void ) const { return HasSpawnFlags( SF_FOG_MASTER ); }
  46. public:
  47. CNetworkArray( float, m_flPostProcessParameters, POST_PROCESS_PARAMETER_COUNT );
  48. CNetworkVar( bool, m_bMaster );
  49. };
  50. //=============================================================================
  51. //
  52. // Postprocess Controller System.
  53. //
  54. class CPostProcessSystem : public CAutoGameSystem, public CGameEventListener
  55. {
  56. public:
  57. // Creation/Init.
  58. CPostProcessSystem( char const *name ) : CAutoGameSystem( name )
  59. {
  60. m_hMasterController = NULL;
  61. }
  62. ~CPostProcessSystem()
  63. {
  64. m_hMasterController = NULL;
  65. }
  66. virtual void LevelInitPreEntity();
  67. virtual void LevelInitPostEntity();
  68. virtual void FireGameEvent( IGameEvent *pEvent );
  69. CPostProcessController *GetMasterPostProcessController( void ) { return m_hMasterController; }
  70. private:
  71. void InitMasterController( void );
  72. CHandle< CPostProcessController > m_hMasterController;
  73. };
  74. CPostProcessSystem *PostProcessSystem( void );
  75. #endif // POSTPROCESSCONTROLLER_H