Merge pull request #67 from Manicsteiner/feat_pacf

add support of F Fanatic PC version archive
This commit is contained in:
Crsky 2024-12-22 09:47:52 +08:00 committed by GitHub
commit 8f96a1bccd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -35,20 +35,20 @@ namespace GameRes.Formats.DigitalWorks
{ {
public override string Tag { get { return "PAC/HED"; } } public override string Tag { get { return "PAC/HED"; } }
public override string Description { get { return "Digital Works resource archive"; } } public override string Description { get { return "Digital Works resource archive"; } }
public override uint Signature { get { return 0x43415050; } } // 'PPAC-PAC' public override uint Signature { get { return 0; } } // 'PPAC-PAC'
public override bool IsHierarchic { get { return false; } } public override bool IsHierarchic { get { return false; } }
public override bool CanWrite { get { return false; } } public override bool CanWrite { get { return false; } }
public override ArcFile TryOpen (ArcView file) public override ArcFile TryOpen (ArcView file)
{ {
if (!file.View.AsciiEqual (4, "-PAC")) if (!file.View.AsciiEqual (0, "PPAC-PAC") && !file.View.AsciiEqual(0, "FANA_V1.0.0.0"))
return null; return null;
var hed_name = Path.ChangeExtension (file.Name, "hed"); var hed_name = Path.ChangeExtension (file.Name, "hed");
if (!VFS.FileExists (hed_name)) if (!VFS.FileExists (hed_name))
return null; return null;
using (var hed = VFS.OpenView (hed_name)) using (var hed = VFS.OpenView (hed_name))
{ {
if (!hed.View.AsciiEqual (0, "PPAC-HED")) if (!hed.View.AsciiEqual (0, "PPAC-HED") && !hed.View.AsciiEqual(0, "FANA_V1.0.0.0"))
return null; return null;
uint index_offset = 0x10; uint index_offset = 0x10;
const uint data_offset = 0x10; const uint data_offset = 0x10;