mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2025-02-25 10:20:03 +01:00
fix build on big endian architectures
This commit is contained in:
parent
2b732d72c8
commit
cfd4fc1124
@ -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)
|
||||||
{
|
{
|
||||||
|
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user