diff --git a/AOEMods.Essence/SGA/Core/FileStorageType.cs b/AOEMods.Essence/SGA/Core/FileStorageType.cs index 3fa595d..d3bb64c 100644 --- a/AOEMods.Essence/SGA/Core/FileStorageType.cs +++ b/AOEMods.Essence/SGA/Core/FileStorageType.cs @@ -18,5 +18,15 @@ public enum FileStorageType : byte /// /// Stored compressed. /// - BufferCompress + BufferCompress, + + /// + /// Stored compressed. + /// + StreamCompressBrotli, + + /// + /// Stored compressed. + /// + BufferCompressBrotli } diff --git a/AOEMods.Essence/SGA/Graph/ArchiveFileNode.cs b/AOEMods.Essence/SGA/Graph/ArchiveFileNode.cs index f7030de..0a2f0ae 100644 --- a/AOEMods.Essence/SGA/Graph/ArchiveFileNode.cs +++ b/AOEMods.Essence/SGA/Graph/ArchiveFileNode.cs @@ -1,4 +1,5 @@ using AOEMods.Essence.SGA.Core; +using System.IO; using System.IO.Compression; using System.Text; @@ -67,6 +68,15 @@ public IEnumerable GetData() MemoryStream decoded = new((int)dataUncompressedLength); deflateStream.CopyTo(decoded); + return decoded.ToArray(); + } + case FileStorageType.StreamCompressBrotli: + case FileStorageType.BufferCompressBrotli: + { + using var brotliStream = new BrotliStream(dataStream, CompressionMode.Decompress, leaveOpen: true); + MemoryStream decoded = new((int)dataUncompressedLength); + brotliStream.CopyTo(decoded); + return decoded.ToArray(); } default: