mirror of
https://github.com/Barubary/dsdecmp.git
synced 2024-11-12 22:05:08 +01: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 flags = 0, mask = 0;
|
||||
int flags = 0, mask = 1;
|
||||
while (currentOutSize < decompressedSize)
|
||||
{
|
||||
// (throws when requested new flags byte is not available)
|
||||
@ -123,7 +123,7 @@ namespace DSDecmp.Formats.Nitro
|
||||
buffer[bufferOffset] = next;
|
||||
bufferOffset = (bufferOffset + 1) % bufferLength;
|
||||
}
|
||||
|
||||
currentOutSize += length;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -76,7 +76,7 @@ namespace DSDecmp.Formats.Nitro
|
||||
int bufferOffset = 0;
|
||||
|
||||
int currentOutSize = 0;
|
||||
int flags = 0, mask = 0;
|
||||
int flags = 0, mask = 1;
|
||||
while (currentOutSize < decompressedSize)
|
||||
{
|
||||
// (throws when requested new flags byte is not available)
|
||||
@ -196,7 +196,7 @@ namespace DSDecmp.Formats.Nitro
|
||||
buffer[bufferOffset] = next;
|
||||
bufferOffset = (bufferOffset + 1) % bufferLength;
|
||||
}
|
||||
|
||||
currentOutSize += length;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -206,8 +206,7 @@ namespace DSDecmp.Formats.Nitro
|
||||
if (next < 0)
|
||||
throw new StreamTooShortException();
|
||||
|
||||
currentOutSize++;
|
||||
outstream.WriteByte((byte)next);
|
||||
outstream.WriteByte((byte)next); currentOutSize++;
|
||||
buffer[bufferOffset] = (byte)next;
|
||||
bufferOffset = (bufferOffset + 1) % bufferLength;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user