hmdldef.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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 : WW3D *
  23. * *
  24. * $Archive:: /Commando/Code/ww3d2/hmdldef.h $*
  25. * *
  26. * Author:: Greg_h *
  27. * *
  28. * $Modtime:: 1/08/01 10:04a $*
  29. * *
  30. * $Revision:: 1 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef HMDLDEF_H
  39. #define HMDLDEF_H
  40. #include "always.h"
  41. #include "w3d_file.h"
  42. class FileClass;
  43. class ChunkLoadClass;
  44. class ChunkSaveClass;
  45. class SnapPointsClass;
  46. /*
  47. ** Each render object to be attached into the hierarchy model
  48. ** will be defined by an instance of the following structure.
  49. ** The HmdlNodeDefStruct associates a named render object with
  50. ** an indexed pivot/bone in the hierarchy tree.
  51. */
  52. struct HmdlNodeDefStruct
  53. {
  54. char RenderObjName[2*W3D_NAME_LEN];
  55. int PivotID;
  56. };
  57. /*
  58. ** HModelDefClass
  59. **
  60. ** "Hierarchy Model Definition Class"
  61. ** This class serves as a blueprint for creating HierarchyModelClasses.
  62. ** The asset manager stores these objects internally and uses them to
  63. ** create instances of HierarchyModels for the user.
  64. */
  65. class HModelDefClass
  66. {
  67. public:
  68. enum {
  69. OK,
  70. LOAD_ERROR
  71. };
  72. HModelDefClass(void);
  73. ~HModelDefClass(void);
  74. int Load_W3D(ChunkLoadClass & cload);
  75. const char * Get_Name(void) const { return Name; }
  76. private:
  77. char Name[2*W3D_NAME_LEN]; // <basepose>.<modelname>
  78. char ModelName[W3D_NAME_LEN]; // name of the model
  79. char BasePoseName[W3D_NAME_LEN]; // name of the base pose (hierarchy tree)
  80. int SubObjectCount;
  81. HmdlNodeDefStruct * SubObjects;
  82. SnapPointsClass * SnapPoints;
  83. void Free(void);
  84. bool read_header(ChunkLoadClass & cload);
  85. bool read_connection(ChunkLoadClass & cload,HmdlNodeDefStruct * con,bool pre30);
  86. bool read_mesh_connection(ChunkLoadClass & cload,int idx,bool pre30);
  87. bool read_collision_connection(ChunkLoadClass & cload,int idx,bool pre30);
  88. bool read_skin_connection(ChunkLoadClass & cload,int idx,bool pre30);
  89. // HModelClass requires intimate knowlege of us
  90. friend class HModelClass;
  91. friend class HLodClass;
  92. };
  93. #endif