(PSB): added DXT5 decoder.

This commit is contained in:
morkt 2017-05-21 18:18:02 +04:00
parent 11273de4f6
commit 2f2b067272

View File

@ -693,6 +693,8 @@ namespace GameRes.Formats.Emote
ReadRgba4444 (pixels, stride); ReadRgba4444 (pixels, stride);
else if ("RL" == m_info.TexType) else if ("RL" == m_info.TexType)
ReadRle (pixels, stride); ReadRle (pixels, stride);
else if ("DXT5" == m_info.TexType)
pixels = ReadDxt5();
else else
throw new NotImplementedException (string.Format ("PSB texture format '{0}' not implemented", m_info.TexType)); throw new NotImplementedException (string.Format ("PSB texture format '{0}' not implemented", m_info.TexType));
return ImageData.Create (m_info, PixelFormats.Bgra32, null, pixels, stride); 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();
}
} }
} }