(Arc2Opener): autodetect entry type.

This commit is contained in:
morkt 2015-10-30 08:53:05 +04:00
parent 7800b6fd3d
commit 6d22544732

View File

@ -121,8 +121,8 @@ namespace GameRes.Formats.BGI
for (uint i = 0; i < count; ++i) for (uint i = 0; i < count; ++i)
{ {
string name = file.View.ReadString (index_offset, 0x60); string name = file.View.ReadString (index_offset, 0x60);
var entry = FormatCatalog.Instance.Create<Entry> (name); var offset = base_offset + file.View.ReadUInt32 (index_offset+0x60);
entry.Offset = base_offset + file.View.ReadUInt32 (index_offset+0x60); var entry = AutoEntry.Create (file, offset, name);
entry.Size = file.View.ReadUInt32 (index_offset+0x64); entry.Size = file.View.ReadUInt32 (index_offset+0x64);
if (!entry.CheckPlacement (file.MaxOffset)) if (!entry.CheckPlacement (file.MaxOffset))
return null; return null;