From e8ee56234ad63a19a15560512df73247e5747a2e Mon Sep 17 00:00:00 2001 From: Yukai Li Date: Sun, 21 Feb 2021 01:54:31 -0700 Subject: [PATCH] Expose palette reading function --- LibDgf.Graphics/TxmConversion.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LibDgf.Graphics/TxmConversion.cs b/LibDgf.Graphics/TxmConversion.cs index ad9abf8..a6f958c 100644 --- a/LibDgf.Graphics/TxmConversion.cs +++ b/LibDgf.Graphics/TxmConversion.cs @@ -177,7 +177,7 @@ namespace LibDgf.Graphics if (imageHeader.ClutPixelFormat == TxmPixelFormat.PSMCT32) { stream.Seek(16, SeekOrigin.Begin); - palette = GetRgba32Palette(br, imageHeader.ClutWidth, imageHeader.ClutHeight); + palette = ReadRgba32Palette(br, imageHeader.ClutWidth, imageHeader.ClutHeight); //fs.Seek(16, SeekOrigin.Begin); //using (var palImage = ConvertTxmRgba32(br, imageHeader.ClutWidth, imageHeader.ClutHeight)) //{ @@ -271,7 +271,7 @@ namespace LibDgf.Graphics return img; } - static Rgba32[] GetRgba32Palette(BinaryReader br, int width, int height) + public static Rgba32[] ReadRgba32Palette(BinaryReader br, int width, int height) { int count = width * height; Rgba32[] colors = new Rgba32[count];