forked from mirror/DotRecast
for unity3d
This commit is contained in:
parent
51ae1549ec
commit
4a3e52350d
|
@ -16,7 +16,7 @@
|
|||
|
||||
using System;
|
||||
|
||||
namespace DotRecast.Core
|
||||
namespace DotRecast.Core.Compression
|
||||
{
|
||||
/**
|
||||
* Core of FastLZ compression algorithm.
|
||||
|
@ -27,7 +27,7 @@ namespace DotRecast.Core
|
|||
* This is refactored code of <a href="https://code.google.com/p/jfastlz/">jfastlz</a>
|
||||
* library written by William Kinney.
|
||||
*/
|
||||
public static class FastLz
|
||||
public static class FastLZ
|
||||
{
|
||||
private const int MAX_DISTANCE = 8191;
|
||||
private const int MAX_FARDISTANCE = 65535 + MAX_DISTANCE - 1;
|
|
@ -5,4 +5,5 @@
|
|||
</PropertyGroup>
|
||||
|
||||
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -19,6 +19,7 @@ freely, subject to the following restrictions:
|
|||
*/
|
||||
|
||||
using DotRecast.Core;
|
||||
using DotRecast.Core.Compression;
|
||||
|
||||
namespace DotRecast.Detour.TileCache.Io.Compress
|
||||
{
|
||||
|
@ -28,7 +29,6 @@ namespace DotRecast.Detour.TileCache.Io.Compress
|
|||
|
||||
private DtTileCacheFastLzCompressor()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public byte[] Decompress(byte[] buf)
|
||||
|
@ -39,14 +39,14 @@ namespace DotRecast.Detour.TileCache.Io.Compress
|
|||
public byte[] Decompress(byte[] buf, int offset, int len, int outputlen)
|
||||
{
|
||||
byte[] output = new byte[outputlen];
|
||||
FastLz.Decompress(buf, offset, len, output, 0, outputlen);
|
||||
FastLZ.Decompress(buf, offset, len, output, 0, outputlen);
|
||||
return output;
|
||||
}
|
||||
|
||||
public byte[] Compress(byte[] buf)
|
||||
{
|
||||
byte[] output = new byte[FastLz.CalculateOutputBufferLength(buf.Length)];
|
||||
int len = FastLz.Compress(buf, 0, buf.Length, output, 0, output.Length);
|
||||
byte[] output = new byte[FastLZ.CalculateOutputBufferLength(buf.Length)];
|
||||
int len = FastLZ.Compress(buf, 0, buf.Length, output, 0, output.Length);
|
||||
return RcArrayUtils.CopyOf(output, len);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue