2
0

htreemgr.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. /* $Header: /Commando/Code/ww3d2/htreemgr.h 2 9/19/01 6:17p Jani_p $ */
  19. /***********************************************************************************************
  20. *** Confidential - Westwood Studios ***
  21. ***********************************************************************************************
  22. * *
  23. * Project Name : Commando / G 3D Library *
  24. * *
  25. * $Archive:: /Commando/Code/ww3d2/htreemgr.h $*
  26. * *
  27. * Author:: Greg_h *
  28. * *
  29. * $Modtime:: 9/13/01 7:22p $*
  30. * *
  31. * $Revision:: 2 $*
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  36. #if defined(_MSC_VER)
  37. #pragma once
  38. #endif
  39. #ifndef HTREEMGR_H
  40. #define HTREEMGR_H
  41. #include "always.h"
  42. #include "bittype.h"
  43. #include "hashtemplate.h"
  44. class FileClass;
  45. class ChunkLoadClass;
  46. class HTreeClass;
  47. class StringClass;
  48. /*
  49. HTreeManagerClass
  50. This class is used to keep track of all of the hierarchy trees.
  51. A hierarchy tree is the base pose for a hierarchy model.
  52. */
  53. class HTreeManagerClass
  54. {
  55. public:
  56. HTreeManagerClass(void);
  57. ~HTreeManagerClass(void);
  58. int Load_Tree(ChunkLoadClass & cload);
  59. int Num_Trees(void) { return NumTrees; }
  60. HTreeClass * Get_Tree(const char * name);
  61. HTreeClass * Get_Tree(int id);
  62. uint32 Get_Tree_Handle(char * name);
  63. void Free_All_Trees(void);
  64. int Get_Tree_ID(const char * name);
  65. char * Get_Tree_Name(const int id);
  66. private:
  67. enum {
  68. MAX_TREES = 4096
  69. };
  70. void Free(void);
  71. int NumTrees;
  72. HTreeClass * TreePtr[MAX_TREES]; // TODO: no no! make this dynamic...
  73. HashTemplateClass<StringClass,HTreeClass*> TreeHash;
  74. };
  75. #endif