(GRX): 15bpp images.

This commit is contained in:
morkt 2018-05-22 17:41:21 +04:00
parent 41ccdbd813
commit 02cc109bf9

View File

@ -91,7 +91,7 @@ namespace GameRes.Formats.UMeSoft
{ {
m_input = input; m_input = input;
m_info = info; m_info = info;
m_pixel_size = m_info.BPP / 8; m_pixel_size = (m_info.BPP + 7) / 8;
switch (m_info.BPP) switch (m_info.BPP)
{ {
case 32: case 32:
@ -104,6 +104,9 @@ namespace GameRes.Formats.UMeSoft
case 16: case 16:
Format = PixelFormats.Bgr565; Format = PixelFormats.Bgr565;
break; break;
case 15:
Format = PixelFormats.Bgr555;
break;
case 8: case 8:
Format = PixelFormats.Gray8; Format = PixelFormats.Gray8;
break; break;
@ -121,7 +124,7 @@ namespace GameRes.Formats.UMeSoft
if (!m_info.IsPacked) if (!m_info.IsPacked)
m_input.Read (m_output, 0, m_output.Length); m_input.Read (m_output, 0, m_output.Length);
else else
UnpackColorData (m_output, m_info.BPP/8, m_pixel_size); UnpackColorData (m_output, (m_info.BPP + 7) / 8, m_pixel_size);
if (m_info.HasAlpha && m_info.AlphaOffset > 0) if (m_info.HasAlpha && m_info.AlphaOffset > 0)
{ {