GameRes refactoring.

(FormatCatalog.CreateEntry): method renamed to 'Create' and made generic
towards Entry type.
This commit is contained in:
morkt
2015-08-30 22:34:06 +04:00
parent 4bfdc502e4
commit 46dbf2b142
53 changed files with 75 additions and 99 deletions

View File

@@ -98,14 +98,10 @@ namespace GameRes.Formats.RenPy
Trace.WriteLine ("invalid index tuple", "RpaOpener.TryOpen");
return null;
}
var entry = new RpaEntry
{
Name = name,
Type = FormatCatalog.Instance.GetTypeFromName (name),
Offset = (uint)((int)tuple[0] ^ key),
UnpackedSize = (uint)((int)tuple[1] ^ key),
};
entry.Size = entry.UnpackedSize;
var entry = FormatCatalog.Instance.Create<RpaEntry> (name);
entry.Offset = (uint)((int)tuple[0] ^ key);
entry.UnpackedSize = (uint)((int)tuple[1] ^ key);
entry.Size = entry.UnpackedSize;
if (tuple.Count > 2)
{
entry.Header = tuple[2] as byte[];