feat: no-xtx spc archive support (#1)

* feat: extract no-xtx spc archive

* feat: revert xtx-spc support
This commit is contained in:
Manicsteiner 2023-12-16 10:45:56 +08:00 committed by GitHub
parent d6259d4535
commit 3443a2d16f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,9 +57,9 @@ namespace GameRes.Formats.Cri
backend.Position = 4; backend.Position = 4;
var lzss = new LzssStream (backend); var lzss = new LzssStream (backend);
var input = new SeekableStream (lzss); var input = new SeekableStream (lzss);
var base_name = Path.GetFileNameWithoutExtension(file.Name);
try try
{ {
var base_name = Path.GetFileNameWithoutExtension (file.Name);
using (var spc = new XtxIndexBuilder (input, base_name)) using (var spc = new XtxIndexBuilder (input, base_name))
{ {
spc.ReadIndex (0); spc.ReadIndex (0);
@ -71,8 +71,14 @@ namespace GameRes.Formats.Cri
} }
catch catch
{ {
input.Dispose(); //input.Dispose();
throw; //throw;
var dir = new List<Entry>();
var entry = Create<PackedEntry>(base_name);
entry.Offset = 0;
entry.Size = (uint)input.Length;
dir.Add(entry);
return new SpcArchive(file, this, dir, input);
} }
} }