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.

105 lines
2.8 KiB

  1. //====== Copyright � 1996-2005, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef SCENEENTITY_SHARED_H
  7. #define SCENEENTITY_SHARED_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #if defined( CLIENT_DLL )
  12. #define CBaseFlex C_BaseFlex
  13. #define CSceneEntity C_SceneEntity
  14. #endif
  15. #include "iscenetokenprocessor.h"
  16. class CBaseFlex;
  17. class CChoreoEvent;
  18. class CChoreoScene;
  19. class CChoreoActor;
  20. class CSceneEntity;
  21. //-----------------------------------------------------------------------------
  22. // Purpose: One of a number of currently playing scene events for this actor
  23. //-----------------------------------------------------------------------------
  24. // FIXME: move this, it's only used in in baseflex and baseactor
  25. class CSceneEventInfo
  26. {
  27. public:
  28. CSceneEventInfo();
  29. ~CSceneEventInfo(); // out-of-line default destructor to deal with template on forward-declared class
  30. // The event handle of the current scene event
  31. CChoreoEvent *m_pEvent;
  32. // Current Scene
  33. CChoreoScene *m_pScene;
  34. // Current actor
  35. CChoreoActor *m_pActor;
  36. CHandle< CSceneEntity > m_hSceneEntity;
  37. // Set after the first time the event has been configured ( allows
  38. // bumping markov index only at start of event playback, not every frame )
  39. bool m_bStarted;
  40. public:
  41. // EVENT local data...
  42. // FIXME: Evil, make accessors or figure out better place
  43. // FIXME: This won't work, scenes don't save and restore...
  44. int m_iLayer;
  45. int m_iPriority;
  46. int m_nSequence;
  47. bool m_bIsGesture;
  48. float m_flWeight; // used for suppressions of posture while moving
  49. // movement, faceto targets?
  50. EHANDLE m_hTarget;
  51. bool m_bIsMoving;
  52. bool m_bHasArrived;
  53. float m_flInitialYaw;
  54. float m_flTargetYaw;
  55. float m_flFacingYaw;
  56. // generic AI events
  57. int m_nType;
  58. float m_flNext;
  59. // is this event only client side?
  60. bool m_bClientSide;
  61. // cached flex file
  62. const flexsettinghdr_t *m_pExpHdr;
  63. void InitWeight( CBaseFlex *pActor );
  64. float UpdateWeight( CBaseFlex *pActor );
  65. };
  66. //-----------------------------------------------------------------------------
  67. // Purpose: Helper for parsing scene data file
  68. //-----------------------------------------------------------------------------
  69. class CSceneTokenProcessor : public ISceneTokenProcessor
  70. {
  71. public:
  72. const char *CurrentToken( void );
  73. bool GetToken( bool crossline );
  74. bool TokenAvailable( void );
  75. void Error( PRINTF_FORMAT_STRING const char *fmt, ... );
  76. void SetBuffer( char *buffer );
  77. private:
  78. const char *m_pBuffer;
  79. char m_szToken[ 1024 ];
  80. };
  81. extern CSceneTokenProcessor g_TokenProcessor;
  82. void Scene_Printf( PRINTF_FORMAT_STRING const char *pFormat, ... );
  83. extern ConVar scene_clientflex;
  84. #endif // SCENEENTITY_SHARED_H