1
0
mirror of synced 2025-02-22 05:19:50 +01:00

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); palette.Read(reader);
PaletteHeaders.Add(palette); 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)); texWrapper.SetPaletteData(palette.Data, Decode_Gamecube.ToGenericPaletteFormat(GXPaletteFormat));
} }
@ -230,6 +230,7 @@ namespace FirstPlugin
{ {
EntryCount = reader.ReadUInt16(); EntryCount = reader.ReadUInt16();
Unpacked = reader.ReadByte(); Unpacked = reader.ReadByte();
reader.ReadByte();
PaletteFormat = reader.ReadUInt32(); PaletteFormat = reader.ReadUInt32();
PaletteDataOffset = reader.ReadUInt32(); PaletteDataOffset = reader.ReadUInt32();
@ -243,6 +244,7 @@ namespace FirstPlugin
{ {
writer.Write(EntryCount); writer.Write(EntryCount);
writer.Write(Unpacked); writer.Write(Unpacked);
writer.Write((byte)0);
writer.Write(PaletteFormat); writer.Write(PaletteFormat);
writer.Write(PaletteDataOffset); writer.Write(PaletteDataOffset);
} }