From c5ac986cded30898fd497a21ee9078c6f0dfebf5 Mon Sep 17 00:00:00 2001 From: morkt Date: Fri, 10 Feb 2017 03:24:25 +0400 Subject: [PATCH] implemented 'Voice PackData' archives. --- ArcFormats/Cromwell/ArcPAK.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ArcFormats/Cromwell/ArcPAK.cs b/ArcFormats/Cromwell/ArcPAK.cs index 8cf546b0..4b8417c3 100644 --- a/ArcFormats/Cromwell/ArcPAK.cs +++ b/ArcFormats/Cromwell/ArcPAK.cs @@ -39,13 +39,20 @@ namespace GameRes.Formats.Cromwell public override bool IsHierarchic { get { return false; } } public override bool CanWrite { get { return false; } } + public GraphicPakOpener () + { + Signatures = new uint[] { 0x70617247, 0x63696F56 }; + } + public override ArcFile TryOpen (ArcView file) { - if (!file.View.AsciiEqual (4, "hic PackData")) + bool is_graphic = file.View.AsciiEqual (0, "Graphic PackData"); + if (!is_graphic && !file.View.AsciiEqual (0, "Voice PackData. ")) return null; int count = file.View.ReadInt32 (0x10); if (!IsSaneCount (count)) return null; + string type = is_graphic ? "image" : "audio"; uint index_offset = 0x14; var dir = new List (count); @@ -55,7 +62,7 @@ namespace GameRes.Formats.Cromwell if (string.IsNullOrWhiteSpace (name)) return null; index_offset += 0xC; - var entry = FormatCatalog.Instance.Create (name); + var entry = new PackedEntry { Name = name, Type = type }; entry.Offset = file.View.ReadUInt32 (index_offset); if (entry.Offset >= file.MaxOffset) return null;