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.

94 lines
3.1 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //===========================================================================//
  8. #ifndef C_BASEANIMATINGOVERLAY_H
  9. #define C_BASEANIMATINGOVERLAY_H
  10. #pragma once
  11. #include "c_baseanimating.h"
  12. #include "toolframework/itoolframework.h"
  13. // For shared code.
  14. #define CBaseAnimatingOverlay C_BaseAnimatingOverlay
  15. class C_BaseAnimatingOverlay : public C_BaseAnimating
  16. {
  17. DECLARE_CLASS( C_BaseAnimatingOverlay, C_BaseAnimating );
  18. DECLARE_CLIENTCLASS();
  19. DECLARE_PREDICTABLE();
  20. DECLARE_INTERPOLATION();
  21. // Inherited from C_BaseAnimating
  22. public:
  23. virtual C_BaseAnimatingOverlay *GetBaseAnimatingOverlay() { return this; }
  24. virtual void AccumulateLayers( IBoneSetup &boneSetup, BoneVector pos[], BoneQuaternion q[], float currentTime );
  25. virtual void DoAnimationEvents( CStudioHdr *pStudioHdr );
  26. virtual void GetRenderBounds( Vector& theMins, Vector& theMaxs );
  27. virtual CStudioHdr *OnNewModel();
  28. virtual bool Interpolate( float flCurrentTime );
  29. #if defined( _PS3 )
  30. virtual void AccumulateLayers_AddPoseCalls( IBoneSetup_PS3 &boneSetup, BoneVector pos[], BoneQuaternion q[], float currentTime );
  31. #endif
  32. public:
  33. enum
  34. {
  35. MAX_OVERLAYS = 15,
  36. };
  37. C_BaseAnimatingOverlay();
  38. CAnimationLayer* GetAnimOverlay( int i, bool bUseOrder = true );
  39. void SetNumAnimOverlays( int num ); // This makes sure there is space for this # of layers.
  40. int GetNumAnimOverlays() const;
  41. void SetOverlayPrevEventCycle( int nSlot, float flValue );
  42. void CheckInterpChanges( void );
  43. void CheckForLayerPhysicsInvalidate( void );
  44. virtual bool UpdateDispatchLayer( CAnimationLayer *pLayer, CStudioHdr *pWeaponStudioHdr, int iSequence );
  45. void AccumulateDispatchedLayers( C_BaseAnimatingOverlay *pWeapon, CStudioHdr *pWeaponStudioHdr, IBoneSetup &boneSetup, BoneVector pos[], BoneQuaternion q[], float currentTime );
  46. void RegenerateDispatchedLayers( IBoneSetup &boneSetup, BoneVector pos[], BoneQuaternion q[], float currentTime );
  47. void AccumulateInterleavedDispatchedLayers( C_BaseAnimatingOverlay *pWeapon, IBoneSetup &boneSetup, BoneVector pos[], BoneQuaternion q[], float currentTime, bool bSetupInvisibleWeapon = false );
  48. virtual void NotifyOnLayerChangeSequence( const CAnimationLayer* pLayer, const int nNewSequence ) {};
  49. virtual void NotifyOnLayerChangeWeight( const CAnimationLayer* pLayer, const float flNewWeight ) {};
  50. virtual void NotifyOnLayerChangeCycle( const CAnimationLayer* pLayer, const float flNewCycle ) {};
  51. private:
  52. void CheckForLayerChanges( CStudioHdr *hdr, float currentTime );
  53. CUtlVector < CAnimationLayer > m_AnimOverlay;
  54. CUtlVector < CInterpolatedVar< CAnimationLayer > > m_iv_AnimOverlay;
  55. float m_flOverlayPrevEventCycle[ MAX_OVERLAYS ];
  56. C_BaseAnimatingOverlay( const C_BaseAnimatingOverlay & ); // not defined, not accessible
  57. friend void ResizeAnimationLayerCallback( void *pStruct, int offsetToUtlVector, int len );
  58. };
  59. inline void C_BaseAnimatingOverlay::SetOverlayPrevEventCycle( int nSlot, float flValue )
  60. {
  61. m_flOverlayPrevEventCycle[nSlot] = flValue;
  62. }
  63. EXTERN_RECV_TABLE(DT_BaseAnimatingOverlay);
  64. #endif // C_BASEANIMATINGOVERLAY_H