bchannel.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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 : W3D Tools *
  23. * *
  24. * $Archive:: /Commando/Code/Tools/max2w3d/bchannel.h $*
  25. * *
  26. * $Author:: Greg_h $*
  27. * *
  28. * $Modtime:: 10/30/00 5:25p $*
  29. * *
  30. * $Revision:: 5 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #ifndef BCHANNEL_H
  36. #define BCHANNEL_H
  37. #ifndef ALWAYS_H
  38. #include "always.h"
  39. #endif
  40. #ifndef BITTYPE_H
  41. #include "bittype.h"
  42. #endif
  43. #ifndef CHUNKIO_H
  44. #include "chunkio.h"
  45. #endif
  46. #ifndef VECTOR_H
  47. #include "vector.h"
  48. #endif
  49. #ifndef W3D_FILE_H
  50. #include "w3d_file.h"
  51. #endif
  52. class LogDataDialogClass;
  53. class BitChannelClass
  54. {
  55. public:
  56. BitChannelClass(uint32 id,int maxframes,uint32 chntype,bool def_val);
  57. ~BitChannelClass(void);
  58. void Set_Bit(int framenumber,bool bit);
  59. void Set_Bits(BooleanVectorClass & bits);
  60. bool Get_Bit(int frameidx);
  61. bool Is_Empty(void) { return IsEmpty; }
  62. bool Save(ChunkSaveClass & csave, bool compress);
  63. private:
  64. uint32 ID;
  65. uint32 ChannelType;
  66. int MaxFrames;
  67. bool IsEmpty;
  68. bool DefaultVal;
  69. BooleanVectorClass Data;
  70. int Begin;
  71. int End;
  72. // Test a bit against the "default" bit
  73. bool is_default(bool bit);
  74. // This function finds the start and end of the "non-default" data
  75. void compute_range(void);
  76. // compress functions
  77. void remove_packet(W3dTimeCodedBitChannelStruct * c, uint32 packet_idx);
  78. uint32 find_useless_packet(W3dTimeCodedBitChannelStruct * c);
  79. void compress(W3dTimeCodedBitChannelStruct * c);
  80. };
  81. #endif