From 19b8c0015c7bc646102626b70073fff6ce22e963 Mon Sep 17 00:00:00 2001 From: morkt Date: Fri, 14 Aug 2015 06:10:27 +0400 Subject: [PATCH] (MblOpener): added static shortcut to PrsFormat. --- ArcFormats/ArcMBL.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ArcFormats/ArcMBL.cs b/ArcFormats/ArcMBL.cs index ee9978fb..fc915f78 100644 --- a/ArcFormats/ArcMBL.cs +++ b/ArcFormats/ArcMBL.cs @@ -75,6 +75,8 @@ namespace GameRes.Formats.Marble return arc; } + static readonly Lazy PrsFormat = new Lazy (() => FormatCatalog.Instance.ImageFormats.FirstOrDefault (x => x.Tag == "PRS")); + private ArcFile ReadIndex (ArcView file, int count, uint filename_len, uint index_offset) { uint index_size = (8u + filename_len) * (uint)count; @@ -114,8 +116,11 @@ namespace GameRes.Formats.Marble entry = new AutoEntry (name, () => { uint signature = file.View.ReadUInt32 (offset); if (0x4259 == (0xffff & signature)) - return FormatCatalog.Instance.ImageFormats.FirstOrDefault (x => x.Tag == "PRS"); - return FormatCatalog.Instance.LookupSignature (signature).FirstOrDefault(); + return PrsFormat.Value; + else if (0 != signature) + return FormatCatalog.Instance.LookupSignature (signature).FirstOrDefault(); + else + return null; }); } else