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.

110 lines
2.8 KiB

  1. //========= Copyright (c) 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef FOGCONTROLLER_H
  7. #define FOGCONTROLLER_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "playernet_vars.h"
  12. #include "igamesystem.h"
  13. #include "GameEventListener.h"
  14. bool GetWorldFogParams( CBaseCombatCharacter *character, fogparams_t &fog );
  15. // Spawn Flags
  16. #define SF_FOG_MASTER 0x0001
  17. //=============================================================================
  18. //
  19. // Class Fog Controller:
  20. // Compares a set of integer inputs to the one main input
  21. // Outputs true if they are all equivalant, false otherwise
  22. //
  23. class CFogController : public CBaseEntity
  24. {
  25. public:
  26. DECLARE_SERVERCLASS();
  27. DECLARE_DATADESC();
  28. DECLARE_CLASS( CFogController, CBaseEntity );
  29. CFogController();
  30. ~CFogController();
  31. // Parse data from a map file
  32. virtual void Activate();
  33. virtual int UpdateTransmitState();
  34. // Input handlers
  35. void InputSetStartDist(inputdata_t &data);
  36. void InputSetEndDist(inputdata_t &data);
  37. void InputTurnOn(inputdata_t &data);
  38. void InputTurnOff(inputdata_t &data);
  39. void InputSetColor(inputdata_t &data);
  40. void InputSetColorSecondary(inputdata_t &data);
  41. void InputSetFarZ( inputdata_t &data );
  42. void InputSetAngles( inputdata_t &inputdata );
  43. void InputSetMaxDensity( inputdata_t &inputdata );
  44. void InputSetZoomFogScale( inputdata_t &inputdata );
  45. void InputSetColorLerpTo(inputdata_t &data);
  46. void InputSetColorSecondaryLerpTo(inputdata_t &data);
  47. void InputSetStartDistLerpTo(inputdata_t &data);
  48. void InputSetEndDistLerpTo(inputdata_t &data);
  49. void InputSetMaxDensityLerpTo(inputdata_t &data);
  50. void InputStartFogTransition(inputdata_t &data);
  51. int DrawDebugTextOverlays(void);
  52. void SetLerpValues( void );
  53. void Spawn( void );
  54. bool IsMaster( void ) { return HasSpawnFlags( SF_FOG_MASTER ); }
  55. public:
  56. CNetworkVarEmbedded( fogparams_t, m_fog );
  57. bool m_bUseAngles;
  58. int m_iChangedVariables;
  59. };
  60. //=============================================================================
  61. //
  62. // Fog Controller System.
  63. //
  64. class CFogSystem : public CAutoGameSystem, public CGameEventListener
  65. {
  66. public:
  67. // Creation/Init.
  68. CFogSystem( char const *name ) : CAutoGameSystem( name )
  69. {
  70. m_hMasterController = NULL;
  71. }
  72. ~CFogSystem()
  73. {
  74. m_hMasterController = NULL;
  75. }
  76. virtual void LevelInitPreEntity();
  77. virtual void LevelInitPostEntity();
  78. virtual void FireGameEvent( IGameEvent *pEvent );
  79. CFogController *GetMasterFogController( void ) { return m_hMasterController; }
  80. void SetMasterController( CFogController *pFogController );
  81. private:
  82. void InitMasterController( void );
  83. CHandle< CFogController > m_hMasterController;
  84. };
  85. CFogSystem *FogSystem( void );
  86. #endif // FOGCONTROLLER_H