AssetInfo.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***********************************************************************************************
  19. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : W3DView *
  23. * *
  24. * $Archive:: /Commando/Code/Tools/W3DView/AssetInfo.h $*
  25. * *
  26. * Author:: Patrick Smith *
  27. * *
  28. * $Modtime:: 3/09/99 2:50p $*
  29. * *
  30. * $Revision:: 2 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef __ASSET_INFO_H
  39. #define __ASSET_INFO_H
  40. #include "RendObj.H"
  41. #include "Utils.H"
  42. #include "AssetTypes.H"
  43. /////////////////////////////////////////////////////////////////////////////
  44. //
  45. // AssetInfoClass
  46. //
  47. // Class used by the data tree to identify each individual
  48. // entry in the tree.
  49. //
  50. class AssetInfoClass
  51. {
  52. public:
  53. //////////////////////////////////////////////////////////////
  54. //
  55. // Public constructors/destructors
  56. //
  57. AssetInfoClass (void)
  58. : m_AssetType (TypeUnknown),
  59. m_dwUserData (0L),
  60. m_pRenderObj (NULL) { Initialize (); }
  61. AssetInfoClass (LPCTSTR passet_name, ASSET_TYPE type, RenderObjClass *prender_obj = NULL, DWORD user_data = 0L)
  62. : m_Name (passet_name),
  63. m_AssetType (type),
  64. m_dwUserData (user_data),
  65. m_pRenderObj (NULL) { MEMBER_ADD (m_pRenderObj, prender_obj); Initialize (); }
  66. virtual ~AssetInfoClass (void) { MEMBER_RELEASE (m_pRenderObj); }
  67. //////////////////////////////////////////////////////////////
  68. //
  69. // Public methods
  70. //
  71. //
  72. // Inline accessors
  73. //
  74. const CString & Get_Name (void) const { return m_Name; }
  75. const CString & Get_Hierarchy_Name (void) const { return m_HierarchyName; }
  76. const CString & Get_Original_Name (void) const { return m_OriginalName; }
  77. ASSET_TYPE Get_Type (void) const { return m_AssetType; }
  78. DWORD Get_User_Number (void) const { return m_dwUserData; }
  79. const CString & Get_User_String (void) const { return m_UserString; }
  80. RenderObjClass * Get_Render_Obj (void) const { SAFE_ADD_REF (m_pRenderObj); return m_pRenderObj; }
  81. RenderObjClass * Peek_Render_Obj (void) const { return m_pRenderObj; }
  82. void Set_Name (LPCTSTR pname) { m_Name = pname; }
  83. void Set_Hierarchy_Name (LPCTSTR pname) { m_HierarchyName = pname; }
  84. void Set_Type (ASSET_TYPE type) { m_AssetType = type; }
  85. void Set_User_Number (DWORD user_data) { m_dwUserData = user_data; }
  86. void Set_User_String (LPCTSTR string) { m_UserString = string; }
  87. void Set_Render_Obj (RenderObjClass *pobj) { MEMBER_ADD (m_pRenderObj, pobj); }
  88. //
  89. // Information methods
  90. //
  91. bool Can_Asset_Have_Animations (void) const { return bool(m_HierarchyName.GetLength () > 0); }
  92. protected:
  93. //////////////////////////////////////////////////////////////
  94. //
  95. // Protected methods
  96. //
  97. void Initialize (void);
  98. private:
  99. //////////////////////////////////////////////////////////////
  100. //
  101. // Private member data
  102. //
  103. CString m_Name;
  104. CString m_HierarchyName;
  105. CString m_UserString;
  106. CString m_OriginalName;
  107. ASSET_TYPE m_AssetType;
  108. DWORD m_dwUserData;
  109. RenderObjClass * m_pRenderObj;
  110. };
  111. #endif //__ASSET_INFO_H