Fix applying alignment after saving sarcs (will fix crash issues)
This commit is contained in:
parent
585845ae2d
commit
c5adddcfe5
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user