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.

71 lines
1.5 KiB

  1. //====== Copyright � 1996-2004, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef FORCEFEEDBACK_H
  7. #define FORCEFEEDBACK_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. enum
  12. {
  13. FFMSG_START = 0,
  14. FFMSG_STOP,
  15. FFMSG_STOPALL,
  16. FFMSG_PAUSE,
  17. FFMSG_RESUME
  18. };
  19. typedef enum
  20. {
  21. FORCE_FEEDBACK_SHOT_SINGLE,
  22. FORCE_FEEDBACK_SHOT_DOUBLE,
  23. FORCE_FEEDBACK_TAKEDAMAGE,
  24. FORCE_FEEDBACK_SCREENSHAKE,
  25. FORCE_FEEDBACK_SKIDDING,
  26. FORCE_FEEDBACK_BREAKING,
  27. NUM_FORCE_FEEDBACK_PRESETS
  28. } FORCEFEEDBACK_t;
  29. class CBasePlayer;
  30. struct FFBaseParams_t
  31. {
  32. FFBaseParams_t() :
  33. m_flDirection( 0.0f ),
  34. m_flDuration( 0.0f ),
  35. m_flGain( 1.0f ),
  36. m_nPriority( 0 ),
  37. m_bSolo( false )
  38. {
  39. }
  40. float m_flDirection; // yaw
  41. float m_flDuration; // seconds (-1 == INFINITE, 0.0 == use duration from .ffe file)
  42. float m_flGain; // 0 -> 1 global scale
  43. int m_nPriority; // Higher is more important
  44. bool m_bSolo; // Temporarily suppress all other FF effects while playing
  45. };
  46. abstract_class IForceFeedback
  47. {
  48. public:
  49. // API
  50. virtual void StopAllEffects( CBasePlayer *player ) = 0;
  51. virtual void StopEffect( CBasePlayer *player, FORCEFEEDBACK_t effect ) = 0;
  52. virtual void StartEffect( CBasePlayer *player, FORCEFEEDBACK_t effect, const FFBaseParams_t& params ) = 0;
  53. virtual void PauseAll( CBasePlayer *player ) = 0;
  54. virtual void ResumeAll( CBasePlayer *player ) = 0;
  55. };
  56. extern IForceFeedback *forcefeedback;
  57. #endif // FORCEFEEDBACK_H