1
0
mirror of synced 2024-11-30 18:24:39 +01:00

Fix applying alignment after saving sarcs (will fix crash issues)

This commit is contained in:
KillzXGaming 2019-09-16 18:58:09 -04:00
parent 585845ae2d
commit c5adddcfe5
2 changed files with 8 additions and 1 deletions

View File

@ -10,6 +10,8 @@ namespace Toolbox.Library
{
public class Yaz0 : ICompressionFormat
{
public int Alignment = 0;
public string[] Description { get; set; } = new string[] { "Yaz0" };
public string[] Extension { get; set; } = new string[] { "*.yaz0", "*.szs",};
@ -32,7 +34,7 @@ namespace Toolbox.Library
public Stream Compress(Stream stream)
{
return new MemoryStream(EveryFileExplorer.YAZ0.Compress(stream.ToArray()));
return new MemoryStream(EveryFileExplorer.YAZ0.Compress(stream.ToArray(), Alignment, (uint)Runtime.Yaz0CompressionLevel));
}
}
}

View File

@ -269,7 +269,12 @@ namespace Toolbox.Library.IO
Console.WriteLine($"FileIsCompressed {FileIsCompressed} CompressFile {CompressFile} CompressionType {compressionFormat}");
if (CompressFile)
{
if (compressionFormat is Yaz0)
((Yaz0)compressionFormat).Alignment = Alignment;
return compressionFormat.Compress(data);
}
return data;
}