Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
bchannel.h
Go to the documentation of this file.
1/*
2** Command & Conquer Generals Zero Hour(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/***********************************************************************************************
20 *** 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 ***
21 ***********************************************************************************************
22 * *
23 * Project Name : W3D Tools *
24 * *
25 * $Archive:: /Commando/Code/Tools/max2w3d/bchannel.h $*
26 * *
27 * $Author:: Greg_h $*
28 * *
29 * $Modtime:: 10/30/00 5:25p $*
30 * *
31 * $Revision:: 5 $*
32 * *
33 *---------------------------------------------------------------------------------------------*
34 * Functions: *
35 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
36
37
38#ifndef BCHANNEL_H
39#define BCHANNEL_H
40
41#ifndef ALWAYS_H
42#include "always.h"
43#endif
44
45#ifndef BITTYPE_H
46#include "bittype.h"
47#endif
48
49#ifndef CHUNKIO_H
50#include "chunkio.h"
51#endif
52
53#ifndef VECTOR_H
54#include "vector.h"
55#endif
56
57#ifndef W3D_FILE_H
58#include "w3d_file.h"
59#endif
60
62
64{
65public:
66
67 BitChannelClass(uint32 id,int maxframes,uint32 chntype,bool def_val);
69
70 void Set_Bit(int framenumber,bool bit);
71 void Set_Bits(BooleanVectorClass & bits);
72 bool Get_Bit(int frameidx);
73 bool Is_Empty(void) { return IsEmpty; }
74 bool Save(ChunkSaveClass & csave, bool compress);
75
76private:
77
78 uint32 ID;
79 uint32 ChannelType;
80 int MaxFrames;
81 bool IsEmpty;
82
83 bool DefaultVal;
85 int Begin;
86 int End;
87
88 // Test a bit against the "default" bit
89 bool is_default(bool bit);
90
91 // This function finds the start and end of the "non-default" data
92 void compute_range(void);
93
94 // compress functions
95 void remove_packet(W3dTimeCodedBitChannelStruct * c, uint32 packet_idx);
96 uint32 find_useless_packet(W3dTimeCodedBitChannelStruct * c);
97 void compress(W3dTimeCodedBitChannelStruct * c);
98
99
100};
101
102
103#endif
unsigned long uint32
Definition bittype.h:46
void Set_Bit(int framenumber, bool bit)
Definition bchannel.cpp:69
bool Save(ChunkSaveClass &csave, bool compress)
Definition bchannel.cpp:98
BitChannelClass(void)
Definition motchan.cpp:211
bool Is_Empty(void)
Definition bchannel.h:73
~BitChannelClass(void)
void Set_Bits(BooleanVectorClass &bits)
Definition bchannel.cpp:81
WWINLINE int Get_Bit(int frame) const
Definition motchan.h:191