mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-27 07:34:00 +08:00
(CHR): use overlay alpha channel.
This commit is contained in:
parent
6b2aed909e
commit
f01f4909b4
@ -133,8 +133,9 @@ namespace GameRes.Formats.GameSystem
|
|||||||
int stride = (int)Info.Width * 4;
|
int stride = (int)Info.Width * 4;
|
||||||
var pixels = new byte[stride * (int)Info.Height];
|
var pixels = new byte[stride * (int)Info.Height];
|
||||||
m_input.Read (pixels, 0, pixels.Length);
|
m_input.Read (pixels, 0, pixels.Length);
|
||||||
return ImageData.CreateFlipped (Info, PixelFormats.Bgr32, null, pixels, stride);
|
for (int i = 3; i < pixels.Length; i += 4)
|
||||||
|
pixels[i] = (byte)(pixels[i] * 0xFF / 0x80);
|
||||||
|
return ImageData.CreateFlipped (Info, PixelFormats.Bgra32, null, pixels, stride);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -181,9 +181,7 @@ namespace GameRes.Formats.GameSystem
|
|||||||
{
|
{
|
||||||
m_input.Read (m_output, dst, 3);
|
m_input.Read (m_output, dst, 3);
|
||||||
int a = m_input.ReadByte();
|
int a = m_input.ReadByte();
|
||||||
if (a != 0x80)
|
m_output[dst+3] = (byte)(a * 0xFF / 0x80);
|
||||||
throw new InvalidFormatException ("Error reading overlay frame");
|
|
||||||
m_output[dst+3] = 0xFF;
|
|
||||||
dst += 4;
|
dst += 4;
|
||||||
}
|
}
|
||||||
output += m_stride;
|
output += m_stride;
|
||||||
|
Loading…
Reference in New Issue
Block a user