Fix X360 Crossplay (#26)

^Reviewed-on: #26

Co-authored-by: qloak <realminecart@gmail.com>
This commit was merged in pull request #26.
This commit is contained in:
2026-08-07 17:14:12 +00:00
committed by pieeebot
parent 92891de261
commit ebbd54288b
41 changed files with 1346 additions and 1287 deletions
+4 -4
View File
@@ -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