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.

149 lines
4.3 KiB

  1. //====== Copyright (c) 1996-2009, Valve Corporation, All rights reserved. =====
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef DMEMATSYSROOT_H
  7. #define DMEMATSYSROOT_H
  8. #if defined( _WIN32 )
  9. #pragma once
  10. #endif
  11. // Valve includes
  12. #include "datamodel/dmattributevar.h"
  13. #include "datamodel/dmelement.h"
  14. #include "mathlib/mathlib.h"
  15. #include "movieobjects/dmedag.h"
  16. #include "movieobjects/dmeshape.h"
  17. #include "movieobjects/dmemdl.h"
  18. //=============================================================================
  19. // CDmeMatSysSettings
  20. //=============================================================================
  21. class CDmeMatSysPanelSettings : public CDmElement
  22. {
  23. DEFINE_ELEMENT( CDmeMatSysPanelSettings, CDmElement );
  24. public:
  25. CDmaVar< Color > m_cBackgroundColor;
  26. CDmaVar< Color > m_cAmbientColor;
  27. CDmaVar< bool > m_bDrawGroundPlane;
  28. CDmaVar< bool > m_bDrawOriginAxis;
  29. };
  30. //=============================================================================
  31. // CDmeMatSysRoot
  32. //=============================================================================
  33. class CDmeMatSysRoot : public CDmeDag
  34. {
  35. DEFINE_ELEMENT( CDmeMatSysRoot, CDmeDag );
  36. public:
  37. CDmaElement< CDmeMatSysPanelSettings > m_Settings;
  38. };
  39. //=============================================================================
  40. //
  41. //=============================================================================
  42. class IDmeMatSysModel
  43. {
  44. virtual void GetSequenceList( CUtlVector< CUtlString > *pOutList ) = 0;
  45. virtual void GetActivityList( CUtlVector< CUtlString > *pOutList ) = 0;
  46. // Returns number of frame or -1 for error
  47. virtual int SelectSequence( const char *pszSequenceName );
  48. virtual void SetTime( DmeTime_t dmeTime );
  49. virtual void SetFrame( float flFrame );
  50. };
  51. //=============================================================================
  52. // CDmeMatSysMDLDag
  53. //=============================================================================
  54. class CDmeMatSysMDLDag : public IDmeMatSysModel, public CDmeDag
  55. {
  56. DEFINE_ELEMENT( CDmeMatSysMDLDag, CDmeDag );
  57. public:
  58. studiohdr_t *GetStudioHdr() const;
  59. // From IDmeMatSysModel
  60. virtual void GetSequenceList( CUtlVector< CUtlString > *pOutList );
  61. virtual void GetActivityList( CUtlVector< CUtlString > *pOutList );
  62. virtual int SelectSequence( const char *pszSequenceName );
  63. virtual void SetTime( DmeTime_t dmeTime );
  64. virtual void SetFrame( float flFrame );
  65. // Convenience Functions calling into CDmeMDL which is the shape
  66. void SetMDL( MDLHandle_t hMDL );
  67. MDLHandle_t GetMDL() const;
  68. protected:
  69. CDmeMDL *GetDmeMDL() const;
  70. };
  71. //=============================================================================
  72. // CDmeMatSysDMXDag
  73. //=============================================================================
  74. class CDmeMatSysDMXDag : public IDmeMatSysModel, public CDmeDag
  75. {
  76. DEFINE_ELEMENT( CDmeMatSysDMXDag, CDmeDag );
  77. public:
  78. // From CDmeDag
  79. virtual void Draw( CDmeDrawSettings *pDrawSettings = NULL );
  80. // From IDmeMatSysModel
  81. virtual void GetSequenceList( CUtlVector< CUtlString > *pOutList );
  82. virtual void GetActivityList( CUtlVector< CUtlString > *pOutList );
  83. void SetDmxRoot( CDmElement *pDmxRoot );
  84. protected:
  85. CDmaElement< CDmElement > m_eDmxRoot;
  86. DmElementHandle_t m_hDmxModel;
  87. };
  88. //=============================================================================
  89. // CDmeMatSysMPPDag
  90. //=============================================================================
  91. class CDmeMatSysMPPDag : public IDmeMatSysModel, public CDmeDag
  92. {
  93. DEFINE_ELEMENT( CDmeMatSysMPPDag, CDmeDag );
  94. public:
  95. // From CDmeDag
  96. virtual void Draw( CDmeDrawSettings *pDrawSettings = NULL );
  97. // From IDmeMatSysModel
  98. virtual void GetSequenceList( CUtlVector< CUtlString > *pOutList );
  99. virtual void GetActivityList( CUtlVector< CUtlString > *pOutList );
  100. virtual int SelectSequence( const char *pszSequenceName );
  101. virtual void SetTime( DmeTime_t dmeTime );
  102. virtual void SetFrame( float flFrame );
  103. void SetMppRoot( CDmElement *pMppRoot );
  104. protected:
  105. CDmaElement< CDmElement > m_eMppRoot;
  106. DmElementHandle_t m_hDmeBodyGroupList;
  107. DmElementHandle_t m_hDmeSequenceList;
  108. CUtlVector< DmElementHandle_t > m_hChildren;
  109. // These are used for animation playback
  110. DmElementHandle_t m_hDmeSequence;
  111. CUtlVector< IDmeOperator * > m_dmeOperatorList;
  112. void RemoveNullAndImplicitChildren();
  113. };
  114. #endif // DMEMATSYSROOT_H