1
0
mirror of synced 2024-11-30 18:24:39 +01:00

Fix L4 and A4 alpha issues

This commit is contained in:
KillzXGaming 2020-02-08 14:40:20 -05:00
parent 8534f6862c
commit e3c1525cfe

View File

@ -304,6 +304,7 @@ namespace Toolbox.Library
}
else if (PicaFormat == PICASurfaceFormat.L4)
{
//Skip alpha channel
byte L1 = ConvertBRG8ToL(
new byte[]
{
@ -314,9 +315,9 @@ namespace Toolbox.Library
byte L2 = ConvertBRG8ToL(
new byte[]
{
Input[IOffs + 3],
Input[IOffs + 4],
Input[IOffs + 5]
Input[IOffs + 5],
Input[IOffs + 6]
});
writer.Write((byte)((L1 >> 4) | (L2 & 0xF0)));
@ -325,8 +326,8 @@ namespace Toolbox.Library
else if (PicaFormat == PICASurfaceFormat.A4)
{
//Todo this has issues
byte A1 = (byte)(Input[IOffs] >> 4);
byte A2 = (byte)(Input[IOffs + 3] & 0xF0);
byte A1 = (byte)(Input[IOffs + 3] >> 4);
byte A2 = (byte)(Input[IOffs + 7] & 0xF0);
writer.Write((byte)(A1 | A2));
Px++;
}