mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-22 13:33:35 +00:00
switch to using compat
This commit is contained in:
parent
4133008d9c
commit
ba2c692565
@ -47,6 +47,7 @@ elseif (WIN32)
|
||||
|
||||
set(WITH_GTEST OFF CACHE BOOL "" FORCE)
|
||||
set(ZLIB_ENABLE_TESTS OFF CACHE BOOL "" FORCE)
|
||||
set(ZLIB_COMPAT ON CACHE BOOL "Enable ZLIB compatibility mode" FORCE)
|
||||
|
||||
# TODO Keep an eye on the zlib repository for an update to disable testing. Don't forget to update CMakePresets
|
||||
FetchContent_Declare(
|
||||
|
@ -1,24 +1,6 @@
|
||||
#include "ZCompression.h"
|
||||
|
||||
#ifdef DARKFLAME_PLATFORM_WIN32
|
||||
#include "zlib-ng.h"
|
||||
|
||||
// Yes, I know there is a "zlib compat mode", it doesn't work, it's really fucking dumb
|
||||
|
||||
#define z_stream zng_stream
|
||||
|
||||
#define z_deflateInit zng_deflateInit
|
||||
#define z_deflate zng_deflate
|
||||
#define z_deflateEnd zng_deflateEnd
|
||||
|
||||
#define z_inflateInit zng_inflateInit
|
||||
#define z_inflate zng_inflate
|
||||
#define z_inflateEnd zng_inflateEnd
|
||||
|
||||
|
||||
#else
|
||||
#include "zlib.h"
|
||||
#endif
|
||||
|
||||
namespace ZCompression {
|
||||
int32_t GetMaxCompressedLength(int32_t nLenSrc) {
|
||||
@ -35,14 +17,14 @@ namespace ZCompression {
|
||||
zInfo.next_out = abDst;
|
||||
|
||||
int nErr, nRet = -1;
|
||||
nErr = z_deflateInit(&zInfo, Z_DEFAULT_COMPRESSION); // zlib function
|
||||
nErr = deflateInit(&zInfo, Z_DEFAULT_COMPRESSION); // zlib function
|
||||
if (nErr == Z_OK) {
|
||||
nErr = z_deflate(&zInfo, Z_FINISH); // zlib function
|
||||
nErr = deflate(&zInfo, Z_FINISH); // zlib function
|
||||
if (nErr == Z_STREAM_END) {
|
||||
nRet = zInfo.total_out;
|
||||
}
|
||||
}
|
||||
z_deflateEnd(&zInfo); // zlib function
|
||||
deflateEnd(&zInfo); // zlib function
|
||||
return(nRet);
|
||||
}
|
||||
|
||||
@ -55,14 +37,14 @@ namespace ZCompression {
|
||||
zInfo.next_out = abDst;
|
||||
|
||||
int nRet = -1;
|
||||
nErr = z_inflateInit(&zInfo); // zlib function
|
||||
nErr = inflateInit(&zInfo); // zlib function
|
||||
if (nErr == Z_OK) {
|
||||
nErr = z_inflate(&zInfo, Z_FINISH); // zlib function
|
||||
nErr = inflate(&zInfo, Z_FINISH); // zlib function
|
||||
if (nErr == Z_STREAM_END) {
|
||||
nRet = zInfo.total_out;
|
||||
}
|
||||
}
|
||||
z_inflateEnd(&zInfo); // zlib function
|
||||
inflateEnd(&zInfo); // zlib function
|
||||
return(nRet);
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ class AMFArrayValue;
|
||||
/**
|
||||
* @brief Sent when a player moves a Behavior A at position B to their inventory.
|
||||
*/
|
||||
#pragma message("This Control Behavior Message does not have a test yet. Non-developers can ignore this warning.")
|
||||
#pragma message("MoveToInventory.h This Control Behavior Message does not have a test yet. Non-developers can ignore this warning.")
|
||||
class MoveToInventoryMessage : public BehaviorMessageBase {
|
||||
public:
|
||||
MoveToInventoryMessage(const AMFArrayValue& arguments);
|
||||
|
Loading…
Reference in New Issue
Block a user