From b8a5456505c52b9e03bbf35185da2999ea812cf1 Mon Sep 17 00:00:00 2001 From: Venomalia Date: Wed, 24 Aug 2022 16:13:47 +0200 Subject: [PATCH] correct pallent support for WTMD Arc Rise Texture --- lib/AuroraLip/Texture/Formats/WTMD.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/AuroraLip/Texture/Formats/WTMD.cs b/lib/AuroraLip/Texture/Formats/WTMD.cs index f5f1b09e..774daded 100644 --- a/lib/AuroraLip/Texture/Formats/WTMD.cs +++ b/lib/AuroraLip/Texture/Formats/WTMD.cs @@ -36,7 +36,7 @@ protected override void Read(Stream stream) int ImageWidth = stream.ReadUInt16(Endian.Big); int ImageHeight = stream.ReadUInt16(Endian.Big); GXImageFormat Format = (GXImageFormat)stream.ReadByte(); - byte unknown = (byte)stream.ReadByte(); //2 0 3 + WTMDPaletteFormat Palette = (WTMDPaletteFormat)stream.ReadByte(); byte unknown1 = (byte)stream.ReadByte(); //2 0 3 byte unknown2 = (byte)stream.ReadByte(); //1 2 uint unknown3 = stream.ReadUInt16(Endian.Big); @@ -55,6 +55,7 @@ protected override void Read(Stream stream) GXPaletteFormat PaletteFormat = GXPaletteFormat.IA8; if (JUtility.IsPaletteFormat(Format)) { + PaletteFormat = (GXPaletteFormat)Enum.Parse(typeof(GXPaletteFormat), Palette.ToString()); stream.Position = PalettePosition; int PaletteSize = (int)ImagePosition - (int)PalettePosition; PaletteCount = PaletteSize / 2; @@ -87,5 +88,13 @@ protected override void Write(Stream stream) { throw new NotImplementedException(); } + + public enum WTMDPaletteFormat : byte + { + none = 0, + RGB565 = 1, + RGB5A3 = 2, + IA8 = 3 + } } }