mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-23 19:34:15 +08:00
(AbmpOpener): various fixes.
This commit is contained in:
parent
d23a67ea08
commit
6b8a402ce2
@ -79,15 +79,19 @@ namespace GameRes.Formats.Qlie
|
|||||||
for (int i = 0; i < count && offset < file.MaxOffset; ++i)
|
for (int i = 0; i < count && offset < file.MaxOffset; ++i)
|
||||||
{
|
{
|
||||||
file.View.Read (offset, type_buf, 0, 0x10);
|
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);
|
uint name_length = file.View.ReadUInt16 (offset+0x10);
|
||||||
var name = file.View.ReadString (offset+0x12, name_length);
|
var name = file.View.ReadString (offset+0x12, name_length);
|
||||||
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);
|
offset += 2u + file.View.ReadUInt16 (offset);
|
||||||
if (Binary.AsciiEqual (type_buf, "abimgdat13\0"))
|
if ("abimgdat13" == tag)
|
||||||
offset += 0x0C;
|
offset += 0x0C;
|
||||||
else if (Binary.AsciiEqual (type_buf, "abimgdat14\0"))
|
else if ("abimgdat14" == tag)
|
||||||
offset += 0x4C;
|
offset += 0x4C;
|
||||||
|
}
|
||||||
++offset;
|
++offset;
|
||||||
var size = file.View.ReadUInt32 (offset);
|
var size = file.View.ReadUInt32 (offset);
|
||||||
offset += 4;
|
offset += 4;
|
||||||
@ -99,7 +103,7 @@ namespace GameRes.Formats.Qlie
|
|||||||
name = s_InvalidChars.Replace (name, "_");
|
name = s_InvalidChars.Replace (name, "_");
|
||||||
var entry = new Entry {
|
var entry = new Entry {
|
||||||
Name = name,
|
Name = name,
|
||||||
Type = Binary.AsciiEqual (type_buf, "abimg") ? "image" : "audio",
|
Type = tag.StartsWith ("abimg") ? "image" : tag.StartsWith ("absnd") ? "audio" : "",
|
||||||
Offset = offset,
|
Offset = offset,
|
||||||
Size = size,
|
Size = size,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user