From 32cc294fb0ae9ed1c03a8ae81b605e211a33b3d1 Mon Sep 17 00:00:00 2001 From: morkt Date: Sun, 12 Mar 2017 06:21:43 +0400 Subject: [PATCH] (ABMP): implemented 'abimgdat15' sections. --- ArcFormats/Qlie/ArcABMP.cs | 54 ++++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 11 deletions(-) diff --git a/ArcFormats/Qlie/ArcABMP.cs b/ArcFormats/Qlie/ArcABMP.cs index 33cb3a55..efe9b437 100644 --- a/ArcFormats/Qlie/ArcABMP.cs +++ b/ArcFormats/Qlie/ArcABMP.cs @@ -80,19 +80,51 @@ namespace GameRes.Formats.Qlie { file.View.Read (offset, type_buf, 0, 0x10); var tag = Binary.GetCString (type_buf, 0, 0x10, Encoding.ASCII); - uint name_length = file.View.ReadUInt16 (offset+0x10); - var name = file.View.ReadString (offset+0x12, name_length); - offset += 0x12 + name_length; - - if (tag != "abimgdat10" && tag != "absnddat10") + string name = null; + if ("abimgdat15" == tag) { - offset += 2u + file.View.ReadUInt16 (offset); - if ("abimgdat13" == tag) - offset += 0x0C; - else if ("abimgdat14" == tag) - offset += 0x4C; + uint name_length = file.View.ReadUInt16 (offset+0x14); + offset += 0x16; + if (name_length > 0) + { + var name_bytes = file.View.ReadBytes (offset, name_length*2); + name = Encoding.Unicode.GetString (name_bytes); + offset += name_length*2; + } + name_length = file.View.ReadUInt16 (offset); + if (name_length > 0 && string.IsNullOrEmpty (name)) + name = file.View.ReadString (offset+2, name_length); + offset += 2 + name_length; + byte type = file.View.ReadByte (offset); + /* + case 0: ".bmp" + case 1: ".jpg" + case 2: + case 3: ".png" + case 4: ".m" + case 5: ".argb" + case 6: ".b" + case 7: ".ogv" + case 8: ".mdl" + */ + offset += 0x12; + } + else + { + uint name_length = file.View.ReadUInt16 (offset+0x10); + name = file.View.ReadString (offset+0x12, name_length); + offset += 0x12 + name_length; + + if (tag != "abimgdat10" && tag != "absnddat10") + { + offset += 2u + file.View.ReadUInt16 (offset); + if ("abimgdat13" == tag) + offset += 0x0C; + else if ("abimgdat14" == tag) + offset += 0x4C; + } + ++offset; } - ++offset; var size = file.View.ReadUInt32 (offset); offset += 4; if (0 != size)