From 0957f3cbf90ee45a904eb6e565667401afff3eaa Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Mon, 29 Jul 2019 15:44:18 -0600 Subject: [PATCH] Can re-encode my complete SSE .bsa test folder --- Compression.BSA.Test/Program.cs | 11 ++++++++++- Compression.BSA/BSAReader.cs | 4 ---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Compression.BSA.Test/Program.cs b/Compression.BSA.Test/Program.cs index 72d4b882..14b0b299 100644 --- a/Compression.BSA.Test/Program.cs +++ b/Compression.BSA.Test/Program.cs @@ -10,11 +10,19 @@ namespace Compression.BSA.Test class Program { const string TestDir = "c:\\Mod Organizer 2\\mods"; + const string TempDir = "c:\\tmp\\out"; static void Main(string[] args) { - foreach (var bsa in Directory.EnumerateFiles(TestDir, "*.bsa", SearchOption.AllDirectories).Skip(2)) + foreach (var bsa in Directory.EnumerateFiles(TestDir, "*.bsa", SearchOption.AllDirectories).Skip(16)) { Console.WriteLine($"From {bsa}"); + Console.WriteLine("Cleaning Output Dir"); + if (Directory.Exists(TempDir)) + { + Directory.Delete(TempDir, true); + } + Directory.CreateDirectory(TempDir); + using (var a = new BSAReader(bsa)) { @@ -45,6 +53,7 @@ namespace Compression.BSA.Test w.Build("c:\\tmp\\built.bsa"); + // Sanity Checks Equal(a.Files.Count(), w.Files.Count()); Equal(a.Files.Select(f => f.Path).ToHashSet(), w.Files.Select(f => f.Path).ToHashSet()); diff --git a/Compression.BSA/BSAReader.cs b/Compression.BSA/BSAReader.cs index 88cbd141..765402ae 100644 --- a/Compression.BSA/BSAReader.cs +++ b/Compression.BSA/BSAReader.cs @@ -336,10 +336,6 @@ namespace Compression.BSA var original_size = rdr.ReadUInt32(); if (_bsa.HeaderType == VersionType.SSE) { - var settings = new LZ4DecoderSettings() - { - ExtraMemory = 1024 * 1024 * 8 - }; var r = LZ4Stream.Decode(rdr.BaseStream); r.CopyTo(output); }