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.

53 lines
1.8 KiB

  1. //========= Copyright 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( 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. // Save / Restore
  46. virtual void Save( ISave *pSave ) = 0;
  47. virtual void Restore( IRestore *pRestore, bool ) = 0;
  48. };
  49. extern IViewEffects *vieweffects;
  50. #endif // IVIEWEFFECTS_H