From eba51cf69e51a68082723ac087147986d721ae46 Mon Sep 17 00:00:00 2001 From: morkt Date: Sun, 28 Feb 2016 02:54:07 +0400 Subject: [PATCH] (GrdReader): use Bgr32 format for images with empty alpha-channel. --- ArcFormats/Tmr-Hiro/ImageGRD.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ArcFormats/Tmr-Hiro/ImageGRD.cs b/ArcFormats/Tmr-Hiro/ImageGRD.cs index f21e98f2..75ffaff1 100644 --- a/ArcFormats/Tmr-Hiro/ImageGRD.cs +++ b/ArcFormats/Tmr-Hiro/ImageGRD.cs @@ -114,10 +114,12 @@ namespace GameRes.Formats.TmrHiro { m_input = input; m_info = info; - if (32 == m_info.BPP) + if (24 == m_info.BPP) + Format = PixelFormats.Bgr24; + else if (m_info.AlphaSize > 0) Format = PixelFormats.Bgra32; else - Format = PixelFormats.Bgr24; + Format = PixelFormats.Bgr32; int channel_size = (int)(m_info.Width * m_info.Height); m_pack_type = m_info.Format >> 8; m_pixel_size = m_info.BPP / 8; @@ -128,7 +130,7 @@ namespace GameRes.Formats.TmrHiro public void Unpack () { int next_pos = 0x20; - if (32 == m_info.BPP) + if (32 == m_info.BPP && m_info.AlphaSize > 0) { UnpackChannel (3, next_pos, m_info.AlphaSize); next_pos += m_info.AlphaSize;