From 6b8a402ce2e23700e16beb3e310ee5d9511d3fcc Mon Sep 17 00:00:00 2001 From: morkt Date: Sat, 7 Nov 2015 09:22:38 +0400 Subject: [PATCH] (AbmpOpener): various fixes. --- ArcFormats/Qlie/ArcABMP.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ArcFormats/Qlie/ArcABMP.cs b/ArcFormats/Qlie/ArcABMP.cs index cbc197af..8c373d86 100644 --- a/ArcFormats/Qlie/ArcABMP.cs +++ b/ArcFormats/Qlie/ArcABMP.cs @@ -79,15 +79,19 @@ namespace GameRes.Formats.Qlie for (int i = 0; i < count && offset < file.MaxOffset; ++i) { 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 (Binary.AsciiEqual (type_buf, "abimgdat")) + + if (tag != "abimgdat10" && tag != "absnddat10") + { offset += 2u + file.View.ReadUInt16 (offset); - if (Binary.AsciiEqual (type_buf, "abimgdat13\0")) - offset += 0x0C; - else if (Binary.AsciiEqual (type_buf, "abimgdat14\0")) - offset += 0x4C; + if ("abimgdat13" == tag) + offset += 0x0C; + else if ("abimgdat14" == tag) + offset += 0x4C; + } ++offset; var size = file.View.ReadUInt32 (offset); offset += 4; @@ -99,7 +103,7 @@ namespace GameRes.Formats.Qlie name = s_InvalidChars.Replace (name, "_"); var entry = new Entry { Name = name, - Type = Binary.AsciiEqual (type_buf, "abimg") ? "image" : "audio", + Type = tag.StartsWith ("abimg") ? "image" : tag.StartsWith ("absnd") ? "audio" : "", Offset = offset, Size = size, };