Merge pull request #76 from twolife/debian

bunch of small fixes
This commit is contained in:
ptitSeb 2025-02-24 11:12:43 +01:00 committed by GitHub
commit 7ec5788469
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 12 additions and 6 deletions

View File

@ -59,6 +59,8 @@ if(USE_SYSTEM_ZLIB)
else() else()
message(FATAL_ERROR "Error! USE_SYSTEM_ZLIB is set but neccessary developer files are missing") message(FATAL_ERROR "Error! USE_SYSTEM_ZLIB is set but neccessary developer files are missing")
endif() endif()
else()
include_directories(${CMAKE_SOURCE_DIR}/Engine/zlib)
endif() endif()
# RAKE! Where to install the binaries. # RAKE! Where to install the binaries.

View File

@ -56,7 +56,7 @@ typedef uint32_t UINT;
#endif #endif
// TODO: add more architecture detection routines // TODO: add more architecture detection routines
#if __POWERPC__ || (defined __ppc64__) || (defined __alpha__) || (defined __sparc__) /* rcg03232004 */ #if (defined __hppa__) || (defined __m68k__) || (defined __s390x__) || (defined __sparc__) || __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ /* rcg03232004 */
#define PLATFORM_BIGENDIAN 1 #define PLATFORM_BIGENDIAN 1
#define PLATFORM_LITTLEENDIAN 0 #define PLATFORM_LITTLEENDIAN 0
#else #else
@ -65,7 +65,7 @@ typedef uint32_t UINT;
#endif #endif
#if defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__) || defined(_ARCH_PPC64) \ #if defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__) || defined(_ARCH_PPC64) \
|| defined(_M_IA64) || defined(__IA64__) || defined(__e2k__) || defined(_M_IA64) || defined(__IA64__) || defined(__e2k__) || defined(__alpha__) || defined(__loongarch__) || defined(__riscv) || defined(__s390x__) || (defined(__mips__) && _MIPS_SIM == _ABI64) || (defined(__sparc__) && defined(__arch64__))
#define PLATFORM_64BIT 1 #define PLATFORM_64BIT 1
@ -759,6 +759,9 @@ inline __uint64 BYTESWAP64_unsigned(__uint64 x)
val = *((SLONG *) &uval); val = *((SLONG *) &uval);
} }
/**
* BOOL is int32_t , just like SLONG
* so don't define the same function twice
static inline void BYTESWAP(BOOL &val) static inline void BYTESWAP(BOOL &val)
{ {
// !!! FIXME: reinterpret_cast ? // !!! FIXME: reinterpret_cast ?
@ -766,6 +769,7 @@ inline __uint64 BYTESWAP64_unsigned(__uint64 x)
BYTESWAP(uval); BYTESWAP(uval);
val = *((BOOL *) &uval); val = *((BOOL *) &uval);
} }
*/
static inline void BYTESWAP(FLOAT &val) static inline void BYTESWAP(FLOAT &val)
{ {

View File

@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
typedef unsigned char Byte; // !!! FIXME: not sure why I suddenly needed this typedef here. typedef unsigned char Byte; // !!! FIXME: not sure why I suddenly needed this typedef here.
#endif #endif
#include <Engine/zlib/zlib.h> #include <zlib.h>
extern CTCriticalSection zip_csLock; // critical section for access to zlib functions extern CTCriticalSection zip_csLock; // critical section for access to zlib functions
#pragma pack(1) #pragma pack(1)

View File

@ -18,7 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <Engine/Base/Stream.h> #include <Engine/Base/Stream.h>
#include <Engine/Network/Compression.h> #include <Engine/Network/Compression.h>
#include <Engine/Base/Synchronization.h> #include <Engine/Base/Synchronization.h>
#include <Engine/zlib/zlib.h> #include <zlib.h>
extern CTCriticalSection zip_csLock; // critical section for access to zlib functions extern CTCriticalSection zip_csLock; // critical section for access to zlib functions

View File

@ -21,7 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
extern FLOAT mth_fCSGEpsilon; extern FLOAT mth_fCSGEpsilon;
#ifdef __arm__ #if defined __arm__ && defined __ARM_PCS_VFP
#define SPHERE_HACK #define SPHERE_HACK
#endif #endif

View File

@ -1534,7 +1534,7 @@ void CGame::UnpackHighScoreTable(SLONG slSize)
gm_ahseHighScores[i].hse_strPlayer = (const char*)pub; gm_ahseHighScores[i].hse_strPlayer = (const char*)pub;
pub += MAX_HIGHSCORENAME+1; pub += MAX_HIGHSCORENAME+1;
memcpy(&gm_ahseHighScores[i].hse_gdDifficulty, pub, sizeof(INDEX)); memcpy(&gm_ahseHighScores[i].hse_gdDifficulty, pub, sizeof(INDEX));
BYTESWAP(gm_ahseHighScores[i].hse_gdDifficulty); BYTESWAP((int&)gm_ahseHighScores[i].hse_gdDifficulty);
pub += sizeof(INDEX); pub += sizeof(INDEX);
memcpy(&gm_ahseHighScores[i].hse_tmTime , pub, sizeof(FLOAT)); memcpy(&gm_ahseHighScores[i].hse_tmTime , pub, sizeof(FLOAT));
BYTESWAP(gm_ahseHighScores[i].hse_tmTime); BYTESWAP(gm_ahseHighScores[i].hse_tmTime);