Can re-encode my complete SSE .bsa test folder

This commit is contained in:
Timothy Baldridge 2019-07-29 15:44:18 -06:00
parent 39e1a20741
commit 0957f3cbf9
2 changed files with 10 additions and 5 deletions

View File

@ -10,11 +10,19 @@ namespace Compression.BSA.Test
class Program class Program
{ {
const string TestDir = "c:\\Mod Organizer 2\\mods"; const string TestDir = "c:\\Mod Organizer 2\\mods";
const string TempDir = "c:\\tmp\\out";
static void Main(string[] args) 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($"From {bsa}");
Console.WriteLine("Cleaning Output Dir");
if (Directory.Exists(TempDir))
{
Directory.Delete(TempDir, true);
}
Directory.CreateDirectory(TempDir);
using (var a = new BSAReader(bsa)) using (var a = new BSAReader(bsa))
{ {
@ -45,6 +53,7 @@ namespace Compression.BSA.Test
w.Build("c:\\tmp\\built.bsa"); w.Build("c:\\tmp\\built.bsa");
// Sanity Checks
Equal(a.Files.Count(), w.Files.Count()); Equal(a.Files.Count(), w.Files.Count());
Equal(a.Files.Select(f => f.Path).ToHashSet(), w.Files.Select(f => f.Path).ToHashSet()); Equal(a.Files.Select(f => f.Path).ToHashSet(), w.Files.Select(f => f.Path).ToHashSet());

View File

@ -336,10 +336,6 @@ namespace Compression.BSA
var original_size = rdr.ReadUInt32(); var original_size = rdr.ReadUInt32();
if (_bsa.HeaderType == VersionType.SSE) if (_bsa.HeaderType == VersionType.SSE)
{ {
var settings = new LZ4DecoderSettings()
{
ExtraMemory = 1024 * 1024 * 8
};
var r = LZ4Stream.Decode(rdr.BaseStream); var r = LZ4Stream.Decode(rdr.BaseStream);
r.CopyTo(output); r.CopyTo(output);
} }