From 2f2b06727275201ed0aab5063de3663913651856 Mon Sep 17 00:00:00 2001 From: morkt Date: Sun, 21 May 2017 18:18:02 +0400 Subject: [PATCH] (PSB): added DXT5 decoder. --- ArcFormats/Emote/ArcPSB.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ArcFormats/Emote/ArcPSB.cs b/ArcFormats/Emote/ArcPSB.cs index 30756050..38785117 100644 --- a/ArcFormats/Emote/ArcPSB.cs +++ b/ArcFormats/Emote/ArcPSB.cs @@ -693,6 +693,8 @@ namespace GameRes.Formats.Emote ReadRgba4444 (pixels, stride); else if ("RL" == m_info.TexType) ReadRle (pixels, stride); + else if ("DXT5" == m_info.TexType) + pixels = ReadDxt5(); else throw new NotImplementedException (string.Format ("PSB texture format '{0}' not implemented", m_info.TexType)); return ImageData.Create (m_info, PixelFormats.Bgra32, null, pixels, stride); @@ -799,5 +801,12 @@ namespace GameRes.Formats.Emote } } } + + byte[] ReadDxt5 () + { + var packed = m_input.ReadBytes ((int)m_input.Length); + var dxt = new DirectDraw.DxtDecoder (packed, m_info); + return dxt.UnpackDXT5(); + } } }