mirror of
https://github.com/libAthena/athena.git
synced 2025-05-14 11:21:36 +00:00
* Unbreak compression
This commit is contained in:
parent
e8fad79134
commit
2fa715cbbf
@ -25,18 +25,18 @@ namespace io
|
|||||||
namespace Compression
|
namespace Compression
|
||||||
{
|
{
|
||||||
// Zlib compression
|
// Zlib compression
|
||||||
atInt32 decompressZlib(const atUint8* src, atUint32 srcLen, atUint8*& dst, atUint32 dstLen);
|
atInt32 decompressZlib(const atUint8* src, atUint32 srcLen, atUint8* dst, atUint32 dstLen);
|
||||||
atInt32 compressZlib(const atUint8* src, atUint32 srcLen, atUint8*& dst, atUint32 dstLen);
|
atInt32 compressZlib(const atUint8* src, atUint32 srcLen, atUint8* dst, atUint32 dstLen);
|
||||||
|
|
||||||
// lzo compression
|
// lzo compression
|
||||||
atInt32 decompressLZO(const atUint8* source, atInt32 sourceSize, atUint8*& dst, atInt32& dstSize);
|
atInt32 decompressLZO(const atUint8* source, atInt32 sourceSize, atUint8* dst, atInt32& dstSize);
|
||||||
|
|
||||||
// Yaz0 encoding
|
// Yaz0 encoding
|
||||||
atUint32 yaz0Decode(const atUint8* src, atUint8*& dst, atUint32 uncompressedSize);
|
atUint32 yaz0Decode(const atUint8* src, atUint8*& dst, atUint32 uncompressedSize);
|
||||||
atUint32 yaz0Encode(const atUint8* src, atUint32 srcSize, atUint8* data);
|
atUint32 yaz0Encode(const atUint8* src, atUint32 srcSize, atUint8* data);
|
||||||
|
|
||||||
atUint32 decompressLZ77(const atUint8* src, atUint32 srcLen, atUint8*& dst);
|
atUint32 decompressLZ77(const atUint8* src, atUint32 srcLen, atUint8* dst);
|
||||||
atUint32 compressLZ77(const atUint8* src, atUint32 srcLen, atUint8*& dst, bool extended = false);
|
atUint32 compressLZ77(const atUint8* src, atUint32 srcLen, atUint8* dst, bool extended = false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ namespace io
|
|||||||
namespace Compression
|
namespace Compression
|
||||||
{
|
{
|
||||||
|
|
||||||
atInt32 decompressZlib(const atUint8* src, atUint32 srcLen, atUint8*& dst, atUint32 dstLen)
|
atInt32 decompressZlib(const atUint8* src, atUint32 srcLen, atUint8* dst, atUint32 dstLen)
|
||||||
{
|
{
|
||||||
z_stream strm = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
z_stream strm = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||||
strm.total_in = strm.avail_in = srcLen;
|
strm.total_in = strm.avail_in = srcLen;
|
||||||
@ -66,7 +66,7 @@ atInt32 decompressZlib(const atUint8* src, atUint32 srcLen, atUint8*& dst, atUin
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
atInt32 compressZlib(const atUint8 *src, atUint32 srcLen, atUint8*& dst, atUint32 dstLen)
|
atInt32 compressZlib(const atUint8 *src, atUint32 srcLen, atUint8* dst, atUint32 dstLen)
|
||||||
{
|
{
|
||||||
z_stream strm = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
z_stream strm = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||||
strm.total_in = strm.avail_in = srcLen;
|
strm.total_in = strm.avail_in = srcLen;
|
||||||
@ -105,7 +105,7 @@ atInt32 compressZlib(const atUint8 *src, atUint32 srcLen, atUint8*& dst, atUint3
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
atInt32 decompressLZO(const atUint8* source, atInt32 sourceSize, atUint8*& dst, atInt32& dstSize)
|
atInt32 decompressLZO(const atUint8* source, atInt32 sourceSize, atUint8* dst, atInt32& dstSize)
|
||||||
{
|
{
|
||||||
int size = dstSize;
|
int size = dstSize;
|
||||||
int result = lzo1x_decode(dst, &size, source, &sourceSize);
|
int result = lzo1x_decode(dst, &size, source, &sourceSize);
|
||||||
@ -116,7 +116,7 @@ atInt32 decompressLZO(const atUint8* source, atInt32 sourceSize, atUint8*& dst,
|
|||||||
//src points to the yaz0 source data (to the "real" source data, not at the header!)
|
//src points to the yaz0 source data (to the "real" source data, not at the header!)
|
||||||
//dst points to a buffer uncompressedSize bytes large (you get uncompressedSize from
|
//dst points to a buffer uncompressedSize bytes large (you get uncompressedSize from
|
||||||
//the second 4 bytes in the Yaz0 header).
|
//the second 4 bytes in the Yaz0 header).
|
||||||
atUint32 yaz0Decode(const atUint8* src, atUint8*& dst, atUint32 uncompressedSize)
|
atUint32 yaz0Decode(const atUint8* src, atUint8* dst, atUint32 uncompressedSize)
|
||||||
{
|
{
|
||||||
atUint32 srcPlace = 0, dstPlace = 0; //current read/write positions
|
atUint32 srcPlace = 0, dstPlace = 0; //current read/write positions
|
||||||
|
|
||||||
@ -326,7 +326,7 @@ atUint32 simpleEnc(const atUint8* src, atInt32 size, atInt32 pos, atUint32 *pMat
|
|||||||
return numBytes;
|
return numBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
atUint32 decompressLZ77(const atUint8* src, atUint32 srcLen, atUint8*& dst)
|
atUint32 decompressLZ77(const atUint8* src, atUint32 srcLen, atUint8* dst)
|
||||||
{
|
{
|
||||||
LZBase* lzCodec;
|
LZBase* lzCodec;
|
||||||
if (*(atUint8*)src == 0x11)
|
if (*(atUint8*)src == 0x11)
|
||||||
@ -340,7 +340,7 @@ atUint32 decompressLZ77(const atUint8* src, atUint32 srcLen, atUint8*& dst)
|
|||||||
return retLength;
|
return retLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
atUint32 compressLZ77(const atUint8* src, atUint32 srcLen, atUint8*& dst, bool extended)
|
atUint32 compressLZ77(const atUint8* src, atUint32 srcLen, atUint8* dst, bool extended)
|
||||||
{
|
{
|
||||||
LZBase* lzCodec;
|
LZBase* lzCodec;
|
||||||
if (extended)
|
if (extended)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user