diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/shared/cstrike/cs_playeranimstate.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/shared/cstrike/cs_playeranimstate.h')
| -rw-r--r-- | game/shared/cstrike/cs_playeranimstate.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/game/shared/cstrike/cs_playeranimstate.h b/game/shared/cstrike/cs_playeranimstate.h new file mode 100644 index 0000000..aad335c --- /dev/null +++ b/game/shared/cstrike/cs_playeranimstate.h @@ -0,0 +1,82 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=============================================================================// + +#ifndef TF_PLAYERANIMSTATE_H +#define TF_PLAYERANIMSTATE_H +#ifdef _WIN32 +#pragma once +#endif + + +#include "convar.h" +#include "iplayeranimstate.h" +#include "base_playeranimstate.h" + +#ifdef CLIENT_DLL + class C_BaseAnimatingOverlay; + class C_WeaponCSBase; + // Avoid redef warnings + #undef CBaseAnimatingOverlay + #define CBaseAnimatingOverlay C_BaseAnimatingOverlay + #define CWeaponCSBase C_WeaponCSBase + #define CCSPlayer C_CSPlayer +#else + class CBaseAnimatingOverlay; + class CWeaponCSBase; + class CCSPlayer; +#endif + + +// When moving this fast, he plays run anim. +#define ARBITRARY_RUN_SPEED 175.0f + + +enum PlayerAnimEvent_t +{ + PLAYERANIMEVENT_FIRE_GUN_PRIMARY=0, + PLAYERANIMEVENT_FIRE_GUN_SECONDARY, + PLAYERANIMEVENT_THROW_GRENADE, + PLAYERANIMEVENT_JUMP, + PLAYERANIMEVENT_RELOAD, + PLAYERANIMEVENT_RELOAD_START, ///< w_model partial reload for shotguns + PLAYERANIMEVENT_RELOAD_LOOP, ///< w_model partial reload for shotguns + PLAYERANIMEVENT_RELOAD_END, ///< w_model partial reload for shotguns + PLAYERANIMEVENT_CLEAR_FIRING, ///< clear animations on the firing layer + + PLAYERANIMEVENT_COUNT +}; + + +class ICSPlayerAnimState : virtual public IPlayerAnimState +{ +public: + // This is called by both the client and the server in the same way to trigger events for + // players firing, jumping, throwing grenades, etc. + virtual void DoAnimationEvent( PlayerAnimEvent_t event, int nData = 0 ) = 0; + + // Returns true if we're playing the grenade prime or throw animation. + virtual bool IsThrowingGrenade() = 0; +}; + + +// This abstracts the differences between CS players and hostages. +class ICSPlayerAnimStateHelpers +{ +public: + virtual CWeaponCSBase* CSAnim_GetActiveWeapon() = 0; + virtual bool CSAnim_CanMove() = 0; +}; + + +ICSPlayerAnimState* CreatePlayerAnimState( CBaseAnimatingOverlay *pEntity, ICSPlayerAnimStateHelpers *pHelpers, LegAnimType_t legAnimType, bool bUseAimSequences ); +ICSPlayerAnimState* CreateHostageAnimState( CBaseAnimatingOverlay *pEntity, ICSPlayerAnimStateHelpers *pHelpers, LegAnimType_t legAnimType, bool bUseAimSequences ); + +// If this is set, then the game code needs to make sure to send player animation events +// to the local player if he's the one being watched. +extern ConVar cl_showanimstate; + + +#endif // TF_PLAYERANIMSTATE_H |