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.

76 lines
1.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef SDK_PLAYERANIMSTATE_H
  7. #define SDK_PLAYERANIMSTATE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "convar.h"
  12. #include "iplayeranimstate.h"
  13. #include "base_playeranimstate.h"
  14. #ifdef CLIENT_DLL
  15. class C_BaseAnimatingOverlay;
  16. class C_WeaponSDKBase;
  17. #define CBaseAnimatingOverlay C_BaseAnimatingOverlay
  18. #define CWeaponSDKBase C_WeaponSDKBase
  19. #define CSDKPlayer C_SDKPlayer
  20. #else
  21. class CBaseAnimatingOverlay;
  22. class CWeaponSDKBase;
  23. class CSDKPlayer;
  24. #endif
  25. // When moving this fast, he plays run anim.
  26. #define ARBITRARY_RUN_SPEED 175.0f
  27. enum PlayerAnimEvent_t
  28. {
  29. PLAYERANIMEVENT_FIRE_GUN_PRIMARY=0,
  30. PLAYERANIMEVENT_FIRE_GUN_SECONDARY,
  31. PLAYERANIMEVENT_THROW_GRENADE,
  32. PLAYERANIMEVENT_JUMP,
  33. PLAYERANIMEVENT_RELOAD,
  34. PLAYERANIMEVENT_COUNT
  35. };
  36. class ISDKPlayerAnimState : virtual public IPlayerAnimState
  37. {
  38. public:
  39. // This is called by both the client and the server in the same way to trigger events for
  40. // players firing, jumping, throwing grenades, etc.
  41. virtual void DoAnimationEvent( PlayerAnimEvent_t event, int nData = 0 ) = 0;
  42. // Returns true if we're playing the grenade prime or throw animation.
  43. virtual bool IsThrowingGrenade() = 0;
  44. };
  45. // This abstracts the differences between SDK players and hostages.
  46. class ISDKPlayerAnimStateHelpers
  47. {
  48. public:
  49. virtual CWeaponSDKBase* SDKAnim_GetActiveWeapon() = 0;
  50. virtual bool SDKAnim_CanMove() = 0;
  51. };
  52. ISDKPlayerAnimState* CreatePlayerAnimState( CBaseAnimatingOverlay *pEntity, ISDKPlayerAnimStateHelpers *pHelpers, LegAnimType_t legAnimType, bool bUseAimSequences );
  53. // If this is set, then the game code needs to make sure to send player animation events
  54. // to the local player if he's the one being watched.
  55. extern ConVar cl_showanimstate;
  56. #endif // SDK_PLAYERANIMSTATE_H