forked from pieeebot/cafeberry
Fixed Xbox 360 crash
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "stdafx.h"
|
||||
#include "compression.h"
|
||||
#if defined __ORBIS__ || defined __PS3__ || defined _DURANGO || defined _WIN64
|
||||
#if defined __ORBIS__ || defined __PS3__ || defined _DURANGO || defined _WIN64 || defined _XBOX
|
||||
#include "..\Minecraft.Client\Common\zlib\zlib.h"
|
||||
#endif
|
||||
|
||||
@@ -299,7 +299,7 @@ HRESULT Compression::DecompressRLE(void *pDestination, unsigned int *pDestSize,
|
||||
|
||||
HRESULT Compression::Compress(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize)
|
||||
{
|
||||
// Using zlib for x64 compression - 360 is using native 360 compression and PS3 a stubbed non-compressing version of this
|
||||
// Using zlib for x64 compression - 360 is using native 64 compression and PS3 a stubbed non-compressing version of this
|
||||
#if defined __ORBIS__ || defined _DURANGO || defined _WIN64 || defined __PSVITA__
|
||||
SIZE_T destSize = (SIZE_T)(*pDestSize);
|
||||
int res = ::compress((Bytef *)pDestination, (uLongf *)&destSize, (Bytef *)pSource, SrcSize);
|
||||
@@ -327,7 +327,7 @@ HRESULT Compression::Decompress(void *pDestination, unsigned int *pDestSize, voi
|
||||
return DecompressWithType(pDestination, pDestSize, pSource, SrcSize);
|
||||
}
|
||||
|
||||
// Using zlib for x64 compression - 360 is using native 360 compression and PS3 a stubbed non-compressing version of this
|
||||
// Using zlib for x64 and 360 compression - 360 is using native 360 compression and PS3 a stubbed non-compressing version of this
|
||||
#if defined __ORBIS__ || defined _DURANGO || defined _WIN64 || defined __PSVITA__
|
||||
SIZE_T destSize = (SIZE_T)(*pDestSize);
|
||||
int res = ::uncompress((Bytef *)pDestination, (uLongf *)&destSize, (Bytef *)pSource, SrcSize);
|
||||
@@ -406,7 +406,7 @@ HRESULT Compression::DecompressWithType(void *pDestination, unsigned int *pDestS
|
||||
}
|
||||
break;
|
||||
case eCompressionType_ZLIBRLE:
|
||||
#if (defined __ORBIS__ || defined __PS3__ || defined _DURANGO || defined _WIN64)
|
||||
#if (defined __ORBIS__ || defined __PS3__ || defined _DURANGO || defined _WIN64 || defined _XBOX)
|
||||
if (pDestination != NULL)
|
||||
return ::uncompress((PBYTE)pDestination, (unsigned long *) pDestSize, (PBYTE) pSource, SrcSize); // Decompress
|
||||
else break; // Cannot decompress when destination is NULL
|
||||
|
||||
Reference in New Issue
Block a user