Team Fortress 2 Source Code as on 22/4/2020
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.

119 lines
2.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef EPISODIC_SCREENSPACEEFFECTS_H
  7. #define EPISODIC_SCREENSPACEEFFECTS_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "ScreenSpaceEffects.h"
  12. class CStunEffect : public IScreenSpaceEffect
  13. {
  14. public:
  15. CStunEffect( void ) :
  16. m_flDuration( 0.0f ),
  17. m_flFinishTime( 0.0f ),
  18. m_bUpdateView( true ) {}
  19. virtual void Init( void );
  20. virtual void Shutdown( void );
  21. virtual void SetParameters( KeyValues *params );
  22. virtual void Enable( bool bEnable ) {};
  23. virtual bool IsEnabled( ) { return true; }
  24. virtual void Render( int x, int y, int w, int h );
  25. private:
  26. CTextureReference m_StunTexture;
  27. CMaterialReference m_EffectMaterial;
  28. float m_flDuration;
  29. float m_flFinishTime;
  30. bool m_bUpdateView;
  31. };
  32. ADD_SCREENSPACE_EFFECT( CStunEffect, episodic_stun );
  33. //
  34. // EP1 Intro Blur
  35. //
  36. class CEP1IntroEffect : public IScreenSpaceEffect
  37. {
  38. public:
  39. CEP1IntroEffect( void ) :
  40. m_flDuration( 0.0f ),
  41. m_flFinishTime( 0.0f ),
  42. m_bUpdateView( true ),
  43. m_bEnabled( false ),
  44. m_bFadeOut( false ) {}
  45. virtual void Init( void );
  46. virtual void Shutdown( void );
  47. virtual void SetParameters( KeyValues *params );
  48. virtual void Enable( bool bEnable ) { m_bEnabled = bEnable; }
  49. virtual bool IsEnabled( ) { return m_bEnabled; }
  50. virtual void Render( int x, int y, int w, int h );
  51. private:
  52. inline unsigned char GetFadeAlpha( void );
  53. CTextureReference m_StunTexture;
  54. CMaterialReference m_EffectMaterial;
  55. float m_flDuration;
  56. float m_flFinishTime;
  57. bool m_bUpdateView;
  58. bool m_bEnabled;
  59. bool m_bFadeOut;
  60. };
  61. ADD_SCREENSPACE_EFFECT( CEP1IntroEffect, episodic_intro );
  62. //
  63. // EP2 Player Stunned Effect
  64. //
  65. //
  66. // EP1 Intro Blur
  67. //
  68. class CEP2StunEffect : public IScreenSpaceEffect
  69. {
  70. public:
  71. CEP2StunEffect( void ) :
  72. m_flDuration( 0.0f ),
  73. m_flFinishTime( 0.0f ),
  74. m_bUpdateView( true ),
  75. m_bEnabled( false ),
  76. m_bFadeOut( false ) {}
  77. virtual void Init( void );
  78. virtual void Shutdown( void );
  79. virtual void SetParameters( KeyValues *params );
  80. virtual void Enable( bool bEnable ) { m_bEnabled = bEnable; }
  81. virtual bool IsEnabled( ) { return m_bEnabled; }
  82. virtual void Render( int x, int y, int w, int h );
  83. private:
  84. inline unsigned char GetFadeAlpha( void );
  85. CTextureReference m_StunTexture;
  86. CMaterialReference m_EffectMaterial;
  87. float m_flDuration;
  88. float m_flFinishTime;
  89. bool m_bUpdateView;
  90. bool m_bEnabled;
  91. bool m_bFadeOut;
  92. };
  93. ADD_SCREENSPACE_EFFECT( CEP2StunEffect, ep2_groggy );
  94. #endif // EPISODIC_SCREENSPACEEFFECTS_H