hanimmgr.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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/hanimmgr.h 1 1/22/01 3:36p Greg_h $ */
  19. /***********************************************************************************************
  20. *** Confidential - Westwood Studios ***
  21. ***********************************************************************************************
  22. * *
  23. * Project Name : Commando / G 3D Library *
  24. * *
  25. * $Archive:: /Commando/Code/ww3d2/hanimmgr.h $*
  26. * *
  27. * Author:: Greg_h *
  28. * *
  29. * $Modtime:: 1/08/01 10:04a $*
  30. * *
  31. * $Revision:: 1 $*
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  36. #if defined(_MSC_VER)
  37. #pragma once
  38. #endif
  39. #ifndef HANIMMGR_H
  40. #define HANIMMGR_H
  41. #include "always.h"
  42. #include "hash.h"
  43. #include "wwstring.h"
  44. class HAnimClass;
  45. class ChunkLoadClass;
  46. /*
  47. ** An entry for a table of anims not found, so we can quickly determine their loss
  48. */
  49. class MissingAnimClass : public HashableClass {
  50. public:
  51. MissingAnimClass( const char * name ) : Name( name ) {}
  52. virtual ~MissingAnimClass( void ) {}
  53. virtual const char * Get_Key( void ) { return Name; }
  54. private:
  55. StringClass Name;
  56. };
  57. /*
  58. HAnimManagerClass
  59. This class is used to keep track of all of the motion data.
  60. */
  61. class HAnimManagerClass
  62. {
  63. public:
  64. HAnimManagerClass(void);
  65. ~HAnimManagerClass(void);
  66. int Load_Anim(ChunkLoadClass & cload);
  67. HAnimClass * Get_Anim(const char * name);
  68. HAnimClass * Peek_Anim(const char * name);
  69. bool Add_Anim(HAnimClass *new_anim);
  70. void Free_All_Anims(void);
  71. void Register_Missing( const char * name );
  72. bool Is_Missing( const char * name );
  73. void Reset_Missing( void );
  74. private:
  75. int Load_Compressed_Anim(ChunkLoadClass & cload);
  76. int Load_Raw_Anim(ChunkLoadClass & cload);
  77. int Load_Morph_Anim(ChunkLoadClass & cload);
  78. HashTableClass * AnimPtrTable;
  79. HashTableClass * MissingAnimTable;
  80. friend class HAnimManagerIterator;
  81. };
  82. /*
  83. ** An Iterator to get to all loaded HAnims in a HAnimManager
  84. */
  85. class HAnimManagerIterator : public HashTableIteratorClass {
  86. public:
  87. HAnimManagerIterator( HAnimManagerClass & manager ) : HashTableIteratorClass( *manager.AnimPtrTable ) {}
  88. HAnimClass * Get_Current_Anim( void );
  89. };
  90. #endif