mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
(origin): support old images format.
This commit is contained in:
@@ -221,13 +221,20 @@ namespace GameRes.Formats.Origin
|
|||||||
int w = m_input.ReadInt32();
|
int w = m_input.ReadInt32();
|
||||||
int h = m_input.ReadInt32();
|
int h = m_input.ReadInt32();
|
||||||
int method = m_input.ReadByte();
|
int method = m_input.ReadByte();
|
||||||
if (w == m_width && h == m_height && (1 == method || 2 == method))
|
if (w == m_width && h == m_height)
|
||||||
{
|
{
|
||||||
alpha = new byte[plane_length];
|
alpha = new byte[plane_length];
|
||||||
if (1 == method)
|
if (1 == method)
|
||||||
UnpackRle (alpha);
|
UnpackRle (alpha);
|
||||||
else
|
else if (2 == method)
|
||||||
UnpackAlphaV2 (alpha);
|
UnpackAlphaV2 (alpha);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_input.Seek (-1, SeekOrigin.Current);
|
||||||
|
UnpackRle (alpha);
|
||||||
|
for (int i = 0; i < alpha.Length; ++i)
|
||||||
|
alpha[i] = (byte)(alpha[i] * 0xFF / 0x64);
|
||||||
|
}
|
||||||
pixel_size = 4;
|
pixel_size = 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user