Use slightly different zlib port

This commit is contained in:
Matt Nadareski
2022-12-27 21:47:56 -08:00
parent 769fe42a7a
commit 135c0b6d38
3 changed files with 12 additions and 12 deletions

View File

@@ -21,7 +21,7 @@
<ItemGroup>
<PackageReference Include="SharpCompress" Version="0.32.2" />
<PackageReference Include="zlib.net-mutliplatform" Version="1.0.6" />
<PackageReference Include="SharpZipLib" Version="1.4.1" />
</ItemGroup>
<ItemGroup>

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using BurnOutSharp.Utilities;
using ICSharpCode.SharpZipLib.Zip.Compression;
namespace BurnOutSharp.Wrappers
{
@@ -489,6 +490,12 @@ namespace BurnOutSharp.Wrappers
/// </summary>
protected byte[] DecompressMSZIPData(byte[] data)
{
// Inflater inflater = new Inflater(noHeader: true);
// inflater.SetInput(data);
// byte[] outputData = new byte[data.Length * 4];
// int read = inflater.Inflate(outputData);
// return outputData.AsSpan(0, read).ToArray();
// Create the bitstream to read from
var dataStream = new BitStream(data);

View File

@@ -2,7 +2,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using ComponentAce.Compression.Libs.zlib;
using ICSharpCode.SharpZipLib.Zip.Compression;
namespace BurnOutSharp.Wrappers
{
@@ -772,16 +772,9 @@ namespace BurnOutSharp.Wrappers
{
// Decompress the data
data = new byte[outputFileSize];
ZStream zst = new ZStream
{
next_in = compressedData,
avail_in = compressedData.Length,
next_out = data,
avail_out = data.Length,
};
zst.inflateInit();
zst.inflate(zlibConst.Z_FULL_FLUSH);
zst.inflateEnd();
Inflater inflater = new Inflater();
inflater.SetInput(compressedData);
inflater.Inflate(data);
}
// If we have an invalid output directory