54 DefaultVal(default_val),
71 assert(frameidx >= 0);
72 assert(frameidx < MaxFrames);
76 if (!is_default(bit)) {
83 for (
int i=0; i<bits.
Length(); i++) {
91 assert(frameidx >= 0);
92 assert(frameidx < MaxFrames);
94 return Data[frameidx];
100 if (IsEmpty)
return true;
112 channelsize += packetsize * MaxFrames;
113 channelsize -=
sizeof(
uint32);
123 chn->
Flags = ChannelType;
134 chn->
Data[fcount] = fcount;
140 BitChannelClass::compress( chn );
142 float originalchannelsize = channelsize;
147 channelsize -=
sizeof(
uint32);
149 float percent = (((float) channelsize) / originalchannelsize) * 100.0f;
156 if (csave.
Write(chn,channelsize) != channelsize) {
177 int numbits = End - Begin + 1;
179 int numbytes = (numbits + 7) / 8;
182 channelsize += numbytes - 1;
192 chn->
Flags = ChannelType;
198 for (
int fcount=0; fcount < End-Begin+1; fcount++) {
202 if (csave.
Write(chn,channelsize) != channelsize) {
220bool BitChannelClass::is_default(
bool bit)
222 return (bit == DefaultVal);
225void BitChannelClass::compute_range(
void)
228 while ((Begin < MaxFrames) && (is_default(
Get_Bit(Begin)))) {
233 while ((End >= 0) && (is_default(
Get_Bit(End)))) {
244#define PACKETS_ALL_USEFUL (0xFFFFFFFF)
282 dst = (
uint32 *) &c->
Data[ packet_size * packet_idx ];
283 src = (
uint32 *) &c->Data[ packet_size * (packet_idx + 1) ];
285 uint32 copy_length = (c->NumTimeCodes - (packet_idx + 1)) * packet_len;
289 memcpy(dst, src, copy_length);
306 uint32 idx = find_useless_packet( c );
310 remove_packet( c, idx );
#define W3D_TIMECODED_BIT_MASK
@ W3D_CHUNK_COMPRESSED_BIT_CHANNEL
#define PACKETS_ALL_USEFUL
void Set_Bit(int framenumber, bool bit)
bool Save(ChunkSaveClass &csave, bool compress)
void Set_Bits(BooleanVectorClass &bits)
WWINLINE int Get_Bit(int frame) const
uint32 Write(const void *buf, uint32 nbytes)
bool Begin_Chunk(uint32 id)
static void printf(char *,...)