C#: fixed The new LZ-0x10 and LZ-0x11 decompressors. Only LZ-0x10 hasn't been tested yet.

This commit is contained in:
barubary 2011-04-06 16:42:27 +00:00
parent 5ecc296c1a
commit 8a5583c308
2 changed files with 5 additions and 6 deletions

View File

@ -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
{

View File

@ -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;
}