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.

58 lines
2.0 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. //
  8. //-----------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #if !defined( IVIEWEFFECTS_H )
  14. #define IVIEWEFFECTS_H
  15. #ifdef _WIN32
  16. #pragma once
  17. #endif
  18. class Vector;
  19. class QAngle;
  20. class bf_read;
  21. //-----------------------------------------------------------------------------
  22. // Purpose: Apply effects to view origin/angles, etc. Screen fade and shake
  23. //-----------------------------------------------------------------------------
  24. abstract_class IViewEffects
  25. {
  26. public:
  27. // Initialize subsystem
  28. virtual void Init( void ) = 0;
  29. // Initialize after each level change
  30. virtual void LevelInit( void ) = 0;
  31. // Called each frame to determine the current view fade parameters ( color and alpha )
  32. virtual void GetFadeParams( unsigned char *r, unsigned char *g, unsigned char *b, unsigned char *a, bool *blend ) = 0;
  33. // Apply directscreen shake
  34. virtual void Shake( const ScreenShake_t &data ) = 0;
  35. // Apply direct screen fade
  36. virtual void Fade( ScreenFade_t &data ) = 0;
  37. // Clear all permanent fades in our fade list
  38. virtual void ClearPermanentFades( void ) = 0;
  39. // Clear all fades in our fade list
  40. virtual void ClearAllFades( void ) = 0;
  41. // Compute screen shake values for this frame
  42. virtual void CalcShake( void ) = 0;
  43. // Apply those values to the passed in vector(s).
  44. virtual void ApplyShake( Vector& origin, QAngle& angles, float factor ) = 0;
  45. // Compute screen tilt values for this frame
  46. virtual void CalcTilt( void ) = 0;
  47. // Apply those values to the passed in vector(s).
  48. virtual void ApplyTilt( QAngle& angles, float factor ) = 0;
  49. // Save / Restore
  50. virtual void Save( ISave *pSave ) = 0;
  51. virtual void Restore( IRestore *pRestore, bool ) = 0;
  52. virtual void ClearAllShakes( void ) = 0;
  53. };
  54. extern IViewEffects *GetViewEffects();
  55. #endif // IVIEWEFFECTS_H