mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-25 20:34:13 +08:00
(AKB): fixed header flags interpretation.
This commit is contained in:
parent
87086bb3fe
commit
f71eaab6a3
@ -37,6 +37,7 @@ namespace GameRes.Formats.Silky
|
|||||||
public byte[] Background;
|
public byte[] Background;
|
||||||
public int InnerWidth;
|
public int InnerWidth;
|
||||||
public int InnerHeight;
|
public int InnerHeight;
|
||||||
|
public uint Flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Export(typeof(ImageFormat))]
|
[Export(typeof(ImageFormat))]
|
||||||
@ -52,8 +53,8 @@ namespace GameRes.Formats.Silky
|
|||||||
var info = new AkbMetaData();
|
var info = new AkbMetaData();
|
||||||
info.Width = file.ReadUInt16();
|
info.Width = file.ReadUInt16();
|
||||||
info.Height = file.ReadUInt16();
|
info.Height = file.ReadUInt16();
|
||||||
int flags = file.ReadInt32() & 0xFFFF;
|
info.Flags = file.ReadUInt32();
|
||||||
info.BPP = 0 == flags ? 32 : 24;
|
info.BPP = 0 == (info.Flags & 0x40000000) ? 32 : 24;
|
||||||
info.Background = file.ReadBytes (4);
|
info.Background = file.ReadBytes (4);
|
||||||
info.OffsetX = file.ReadInt32();
|
info.OffsetX = file.ReadInt32();
|
||||||
info.OffsetY = file.ReadInt32();
|
info.OffsetY = file.ReadInt32();
|
||||||
@ -92,7 +93,12 @@ namespace GameRes.Formats.Silky
|
|||||||
m_info = info;
|
m_info = info;
|
||||||
m_pixel_size = m_info.BPP / 8;
|
m_pixel_size = m_info.BPP / 8;
|
||||||
Stride = (int)m_info.Width * m_pixel_size;
|
Stride = (int)m_info.Width * m_pixel_size;
|
||||||
Format = 24 == m_info.BPP ? PixelFormats.Bgr24 : PixelFormats.Bgra32;
|
if (24 == m_info.BPP)
|
||||||
|
Format = PixelFormats.Bgr24;
|
||||||
|
else if (0 == (m_info.Flags & 0x80000000))
|
||||||
|
Format = PixelFormats.Bgr32;
|
||||||
|
else
|
||||||
|
Format = PixelFormats.Bgra32;
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] Unpack ()
|
public byte[] Unpack ()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user