diff options
Diffstat (limited to 'src/net/tmwa')
-rw-r--r-- | src/net/tmwa/adminhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/chathandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/inventoryhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/itemhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/messagehandler.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/messagein.cpp | 11 | ||||
-rw-r--r-- | src/net/tmwa/messagein.h | 5 | ||||
-rw-r--r-- | src/net/tmwa/messageout.cpp | 10 | ||||
-rw-r--r-- | src/net/tmwa/messageout.h | 13 | ||||
-rw-r--r-- | src/net/tmwa/npchandler.cpp | 4 |
10 files changed, 20 insertions, 33 deletions
diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp index 53e4bfd8..d18b6fc9 100644 --- a/src/net/tmwa/adminhandler.cpp +++ b/src/net/tmwa/adminhandler.cpp @@ -43,7 +43,7 @@ namespace TmwAthena { AdminHandler::AdminHandler() { - static const Uint16 _messages[] = + static const uint16_t _messages[] = { SMSG_ADMIN_KICK_ACK, SMSG_ADMIN_IP, diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index 51974eb2..97304c28 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -44,7 +44,7 @@ namespace TmwAthena { ChatHandler::ChatHandler() { - static const Uint16 _messages[] = { + static const uint16_t _messages[] = { SMSG_BEING_CHAT, SMSG_PLAYER_CHAT, SMSG_WHISPER, diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index 48f40e11..ff875e69 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -43,8 +43,6 @@ #include "utils/gettext.h" #include "utils/stringutils.h" -#include <SDL_types.h> - extern Net::InventoryHandler *inventoryHandler; namespace TmwAthena { diff --git a/src/net/tmwa/itemhandler.cpp b/src/net/tmwa/itemhandler.cpp index e452ccf2..9f303617 100644 --- a/src/net/tmwa/itemhandler.cpp +++ b/src/net/tmwa/itemhandler.cpp @@ -33,7 +33,7 @@ namespace TmwAthena { ItemHandler::ItemHandler() { - static const Uint16 _messages[] = { + static const uint16_t _messages[] = { SMSG_ITEM_VISIBLE, SMSG_ITEM_DROPPED, SMSG_ITEM_REMOVE, diff --git a/src/net/tmwa/messagehandler.h b/src/net/tmwa/messagehandler.h index 0fa2e80c..e7810591 100644 --- a/src/net/tmwa/messagehandler.h +++ b/src/net/tmwa/messagehandler.h @@ -27,8 +27,6 @@ #include "net/tmwa/messageout.h" -#include <SDL_types.h> - #include <memory> namespace TmwAthena { diff --git a/src/net/tmwa/messagein.cpp b/src/net/tmwa/messagein.cpp index 1a860a25..ca2d52ab 100644 --- a/src/net/tmwa/messagein.cpp +++ b/src/net/tmwa/messagein.cpp @@ -21,9 +21,6 @@ #include "net/tmwa/messagein.h" -#include <SDL.h> -#include <SDL_endian.h> - namespace TmwAthena { MessageIn::MessageIn(const char *data, unsigned int length): @@ -33,9 +30,9 @@ MessageIn::MessageIn(const char *data, unsigned int length): mId = readInt16(); } -Uint16 MessageIn::readInt16() +uint16_t MessageIn::readInt16() { - Uint16 value = 0; + uint16_t value = 0; if (mPos + 2 <= mLength) { value = (mData[mPos + 1] << 8) | mData[mPos]; @@ -44,9 +41,9 @@ Uint16 MessageIn::readInt16() return value; } -Uint32 MessageIn::readInt32() +uint32_t MessageIn::readInt32() { - Uint32 value = 0; + uint32_t value = 0; if (mPos + 4 <= mLength) { value = (mData[mPos + 3] << 24) | (mData[mPos + 2] << 16) | (mData[mPos + 1] << 8) | mData[mPos]; diff --git a/src/net/tmwa/messagein.h b/src/net/tmwa/messagein.h index 21375257..38fbb139 100644 --- a/src/net/tmwa/messagein.h +++ b/src/net/tmwa/messagein.h @@ -24,7 +24,6 @@ #include "net/messagein.h" -#include <SDL_types.h> #include <string> namespace TmwAthena { @@ -39,8 +38,8 @@ namespace TmwAthena { public: MessageIn(const char *data, unsigned int length); - Uint16 readInt16(); /**< Reads a short. */ - Uint32 readInt32(); /**< Reads a "long". */ + uint16_t readInt16(); + uint32_t readInt32(); }; } diff --git a/src/net/tmwa/messageout.cpp b/src/net/tmwa/messageout.cpp index 71b8f756..7c3a3c61 100644 --- a/src/net/tmwa/messageout.cpp +++ b/src/net/tmwa/messageout.cpp @@ -31,7 +31,7 @@ namespace TmwAthena { -MessageOut::MessageOut(Uint16 id): +MessageOut::MessageOut(uint16_t id): Net::MessageOut(id) { mNetwork = TmwAthena::Network::instance(); @@ -44,7 +44,7 @@ void MessageOut::expand(size_t bytes) mNetwork->mOutSize += bytes; } -void MessageOut::writeInt16(Uint16 value) +void MessageOut::writeInt16(uint16_t value) { expand(2); mData[mPos] = value; @@ -52,7 +52,7 @@ void MessageOut::writeInt16(Uint16 value) mPos += 2; } -void MessageOut::writeInt32(Uint32 value) +void MessageOut::writeInt32(uint32_t value) { expand(4); mData[mPos] = value; @@ -62,13 +62,13 @@ void MessageOut::writeInt32(Uint32 value) mPos += 4; } -void MessageOut::writeCoordinates(Uint16 x, Uint16 y, Uint8 direction) +void MessageOut::writeCoordinates(uint16_t x, uint16_t y, uint8_t direction) { char *data = mData + mPos; mNetwork->mOutSize += 3; mPos += 3; - Uint16 temp = x; + int16_t temp = x; temp <<= 6; data[0] = temp >> 8; data[1] = temp; diff --git a/src/net/tmwa/messageout.h b/src/net/tmwa/messageout.h index 3a6f34a9..24a0a37c 100644 --- a/src/net/tmwa/messageout.h +++ b/src/net/tmwa/messageout.h @@ -24,9 +24,6 @@ #include "net/messageout.h" -#include <iosfwd> -#include <SDL_types.h> - namespace TmwAthena { class Network; @@ -39,16 +36,16 @@ class Network; class MessageOut : public Net::MessageOut { public: - MessageOut(Uint16 id); + MessageOut(uint16_t id); - void writeInt16(Uint16 value); /**< Writes a short. */ - void writeInt32(Uint32 value); /**< Writes a "long". */ + void writeInt16(uint16_t value); + void writeInt32(uint32_t value); /** * Encodes coordinates and direction in 3 bytes. */ - void writeCoordinates(Uint16 x, Uint16 y, - Uint8 direction); + void writeCoordinates(uint16_t x, uint16_t y, + uint8_t direction); private: void expand(size_t size); diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp index 092e3046..904fe388 100644 --- a/src/net/tmwa/npchandler.cpp +++ b/src/net/tmwa/npchandler.cpp @@ -34,8 +34,6 @@ #include "utils/stringutils.h" -#include <SDL_types.h> - extern Net::NpcHandler *npcHandler; static void parseMenu(Event *event, const std::string &options) @@ -57,7 +55,7 @@ namespace TmwAthena { NpcHandler::NpcHandler() { - static const Uint16 _messages[] = { + static const uint16_t _messages[] = { SMSG_NPC_CHOICE, SMSG_NPC_MESSAGE, SMSG_NPC_NEXT, |