mirror of
https://github.com/Barubary/dsdecmp.git
synced 2024-10-01 02:38:41 +02:00
C#: fixed The new LZ-0x10 and LZ-0x11 decompressors. Only LZ-0x10 hasn't been tested yet.
This commit is contained in:
parent
5ecc296c1a
commit
8a5583c308
@ -58,7 +58,7 @@ namespace DSDecmp.Formats.Nitro
|
|||||||
|
|
||||||
|
|
||||||
int currentOutSize = 0;
|
int currentOutSize = 0;
|
||||||
int flags = 0, mask = 0;
|
int flags = 0, mask = 1;
|
||||||
while (currentOutSize < decompressedSize)
|
while (currentOutSize < decompressedSize)
|
||||||
{
|
{
|
||||||
// (throws when requested new flags byte is not available)
|
// (throws when requested new flags byte is not available)
|
||||||
@ -123,7 +123,7 @@ namespace DSDecmp.Formats.Nitro
|
|||||||
buffer[bufferOffset] = next;
|
buffer[bufferOffset] = next;
|
||||||
bufferOffset = (bufferOffset + 1) % bufferLength;
|
bufferOffset = (bufferOffset + 1) % bufferLength;
|
||||||
}
|
}
|
||||||
|
currentOutSize += length;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -76,7 +76,7 @@ namespace DSDecmp.Formats.Nitro
|
|||||||
int bufferOffset = 0;
|
int bufferOffset = 0;
|
||||||
|
|
||||||
int currentOutSize = 0;
|
int currentOutSize = 0;
|
||||||
int flags = 0, mask = 0;
|
int flags = 0, mask = 1;
|
||||||
while (currentOutSize < decompressedSize)
|
while (currentOutSize < decompressedSize)
|
||||||
{
|
{
|
||||||
// (throws when requested new flags byte is not available)
|
// (throws when requested new flags byte is not available)
|
||||||
@ -196,7 +196,7 @@ namespace DSDecmp.Formats.Nitro
|
|||||||
buffer[bufferOffset] = next;
|
buffer[bufferOffset] = next;
|
||||||
bufferOffset = (bufferOffset + 1) % bufferLength;
|
bufferOffset = (bufferOffset + 1) % bufferLength;
|
||||||
}
|
}
|
||||||
|
currentOutSize += length;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -206,8 +206,7 @@ namespace DSDecmp.Formats.Nitro
|
|||||||
if (next < 0)
|
if (next < 0)
|
||||||
throw new StreamTooShortException();
|
throw new StreamTooShortException();
|
||||||
|
|
||||||
currentOutSize++;
|
outstream.WriteByte((byte)next); currentOutSize++;
|
||||||
outstream.WriteByte((byte)next);
|
|
||||||
buffer[bufferOffset] = (byte)next;
|
buffer[bufferOffset] = (byte)next;
|
||||||
bufferOffset = (bufferOffset + 1) % bufferLength;
|
bufferOffset = (bufferOffset + 1) % bufferLength;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user