Fix an issue reading TPL palette headers

This commit is contained in:
KillzXGaming 2019-10-16 18:55:18 -04:00
parent adccce2db8
commit 2df06f463d

View file

@ -153,7 +153,7 @@ namespace FirstPlugin
palette.Read(reader);
PaletteHeaders.Add(palette);
var GXPaletteFormat = (Decode_Gamecube.PaletteFormats)image.Format;
var GXPaletteFormat = (Decode_Gamecube.PaletteFormats)palette.PaletteFormat;
texWrapper.SetPaletteData(palette.Data, Decode_Gamecube.ToGenericPaletteFormat(GXPaletteFormat));
}
@ -230,6 +230,7 @@ namespace FirstPlugin
{
EntryCount = reader.ReadUInt16();
Unpacked = reader.ReadByte();
reader.ReadByte();
PaletteFormat = reader.ReadUInt32();
PaletteDataOffset = reader.ReadUInt32();
@ -243,6 +244,7 @@ namespace FirstPlugin
{
writer.Write(EntryCount);
writer.Write(Unpacked);
writer.Write((byte)0);
writer.Write(PaletteFormat);
writer.Write(PaletteDataOffset);
}