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.

63 lines
2.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Network data for screen shake and screen fade.
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef SHAKE_H
  8. #define SHAKE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. //
  13. // Commands for the screen shake effect.
  14. //
  15. struct ScreenShake_t
  16. {
  17. int command;
  18. float amplitude;
  19. float frequency;
  20. float duration;
  21. };
  22. enum ShakeCommand_t
  23. {
  24. SHAKE_START = 0, // Starts the screen shake for all players within the radius.
  25. SHAKE_STOP, // Stops the screen shake for all players within the radius.
  26. SHAKE_AMPLITUDE, // Modifies the amplitude of an active screen shake for all players within the radius.
  27. SHAKE_FREQUENCY, // Modifies the frequency of an active screen shake for all players within the radius.
  28. SHAKE_START_RUMBLEONLY, // Starts a shake effect that only rumbles the controller, no screen effect.
  29. SHAKE_START_NORUMBLE, // Starts a shake that does NOT rumble the controller.
  30. };
  31. //
  32. // Screen shake message.
  33. //
  34. extern int gmsgShake;
  35. // Fade in/out
  36. extern int gmsgFade;
  37. #define FFADE_IN 0x0001 // Just here so we don't pass 0 into the function
  38. #define FFADE_OUT 0x0002 // Fade out (not in)
  39. #define FFADE_MODULATE 0x0004 // Modulate (don't blend)
  40. #define FFADE_STAYOUT 0x0008 // ignores the duration, stays faded out until new ScreenFade message received
  41. #define FFADE_PURGE 0x0010 // Purges all other fades, replacing them with this one
  42. #define SCREENFADE_FRACBITS 9 // which leaves 16-this for the integer part
  43. // This structure is sent over the net to describe a screen fade event
  44. struct ScreenFade_t
  45. {
  46. unsigned short duration; // FIXED 16 bit, with SCREENFADE_FRACBITS fractional, seconds duration
  47. unsigned short holdTime; // FIXED 16 bit, with SCREENFADE_FRACBITS fractional, seconds duration until reset (fade & hold)
  48. short fadeFlags; // flags
  49. byte r, g, b, a; // fade to color ( max alpha )
  50. };
  51. #endif // SHAKE_H