summaryrefslogtreecommitdiff
path: root/src/net/tmwa/messagein.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-06-19 10:10:15 +0200
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-06-19 10:10:15 +0200
commit61d02a395b0ca594640f0fb917d7162a5aba2c37 (patch)
tree7dd6f7f540dda3d89d37bc7e19f3f4d27dd53c85 /src/net/tmwa/messagein.cpp
parent5da59b807d9840fb23feb42df729bf5e88ee9678 (diff)
parentac0b338b3e026d0d05a447894de9a6a994da82dc (diff)
downloadmana-online-player-list.tar.gz
mana-online-player-list.tar.bz2
mana-online-player-list.tar.xz
mana-online-player-list.zip
Merge branch 'master' into online-player-listonline-player-list
Conflicts: src/net/tmwa/chathandler.cpp
Diffstat (limited to 'src/net/tmwa/messagein.cpp')
-rw-r--r--src/net/tmwa/messagein.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/net/tmwa/messagein.cpp b/src/net/tmwa/messagein.cpp
index 899b135d..7c142619 100644
--- a/src/net/tmwa/messagein.cpp
+++ b/src/net/tmwa/messagein.cpp
@@ -21,7 +21,6 @@
#include "net/tmwa/messagein.h"
-#include <SDL.h>
#include <SDL_endian.h>
#define MAKEWORD(low,high) \
@@ -55,13 +54,8 @@ uint16_t MessageIn::readInt16()
uint16_t value = 0;
if (mPos + 2 <= mLength)
{
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
- uint16_t swap;
- memcpy(&swap, mData + mPos, sizeof(uint16_t));
- value = SDL_Swap16(swap);
-#else
memcpy(&value, mData + mPos, sizeof(uint16_t));
-#endif
+ value = SDL_SwapLE16(value);
}
mPos += 2;
return value;
@@ -72,13 +66,8 @@ uint32_t MessageIn::readInt32()
uint32_t value = 0;
if (mPos + 4 <= mLength)
{
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
- uint32_t swap;
- memcpy(&swap, mData + mPos, sizeof(uint32_t));
- value = SDL_Swap32(swap);
-#else
memcpy(&value, mData + mPos, sizeof(uint32_t));
-#endif
+ value = SDL_SwapLE32(value);
}
mPos += 4;
return value;