Skip to content

Commit

Permalink
correct pallent support for WTMD Arc Rise Texture
Browse files Browse the repository at this point in the history
  • Loading branch information
Venomalia committed Aug 24, 2022
1 parent 6e0eafa commit b8a5456
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/AuroraLip/Texture/Formats/WTMD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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
}
}
}

0 comments on commit b8a5456

Please sign in to comment.