mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-23 05:35:34 +08:00
Update HuffmanDecoder.cs
Fix not so obvious errors.
This commit is contained in:
parent
57749e5cac
commit
ed0f0489d3
@ -143,7 +143,7 @@ namespace GameRes.Formats.DxLib
|
||||
ushort BitArrayFirstBatch;
|
||||
if (nodes[j].bitNumber > 9) continue;
|
||||
|
||||
BitArrayFirstBatch = (ushort)(nodes[j].bitArray[0] | (nodes[j].bitNumber << 8));
|
||||
BitArrayFirstBatch = (ushort)(nodes[j].bitArray[0] | (nodes[j].bitArray[1] << 8));
|
||||
|
||||
if ((i & bitMask[nodes[j].bitNumber - 1]) == (BitArrayFirstBatch & bitMask[nodes[j].bitNumber-1]))
|
||||
{
|
||||
@ -191,19 +191,20 @@ namespace GameRes.Formats.DxLib
|
||||
{
|
||||
PressBitData >>= nodes[NodeIndex].bitNumber;
|
||||
}
|
||||
while (NodeIndex>255)
|
||||
}
|
||||
|
||||
while (NodeIndex > 255)
|
||||
{
|
||||
if (PressBitCounter == 8)
|
||||
{
|
||||
if (PressBitCounter==8)
|
||||
{
|
||||
PressSizeCounter++;
|
||||
PressBitData = compressedData[PressSizeCounter];
|
||||
PressBitCounter = 0;
|
||||
}
|
||||
Index = PressBitData & 1;
|
||||
PressBitData >>= 1;
|
||||
PressBitCounter++;
|
||||
NodeIndex = nodes[NodeIndex].ChildNode[Index];
|
||||
PressSizeCounter++;
|
||||
PressBitData = compressedData[PressSizeCounter];
|
||||
PressBitCounter = 0;
|
||||
}
|
||||
Index = PressBitData & 1;
|
||||
PressBitData >>= 1;
|
||||
PressBitCounter++;
|
||||
NodeIndex = nodes[NodeIndex].ChildNode[Index];
|
||||
}
|
||||
m_output[DestSizeCounter] = (byte)NodeIndex;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user