mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-27 07:34:00 +08:00
(IAF): alternative RLE compression.
This commit is contained in:
parent
304a448937
commit
c5e90110be
@ -161,7 +161,7 @@ namespace GameRes.Formats.Triangle
|
||||
{
|
||||
using (var reader = new RleReader (stream, packed_size, unpacked_size))
|
||||
{
|
||||
reader.Unpack();
|
||||
reader.UnpackV2();
|
||||
return reader.Data;
|
||||
}
|
||||
}
|
||||
@ -274,6 +274,21 @@ namespace GameRes.Formats.Triangle
|
||||
m_size = input_length;
|
||||
}
|
||||
|
||||
public void UnpackV2 ()
|
||||
{
|
||||
int src = 0;
|
||||
int dst = 0;
|
||||
while (dst < m_output.Length && src < m_size)
|
||||
{
|
||||
byte b = m_input.ReadByte();
|
||||
int count = m_input.ReadByte();
|
||||
src += 2;
|
||||
count = Math.Min (count, m_output.Length - dst);
|
||||
for (int i = 0; i < count; i++)
|
||||
m_output[dst++] = b;
|
||||
}
|
||||
}
|
||||
|
||||
public void Unpack ()
|
||||
{
|
||||
int src = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user