summaryrefslogtreecommitdiff
path: root/src/messageout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/messageout.cpp')
-rw-r--r--src/messageout.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/messageout.cpp b/src/messageout.cpp
index e5400e64..7fa6e1fd 100644
--- a/src/messageout.cpp
+++ b/src/messageout.cpp
@@ -23,10 +23,10 @@
#include "messageout.h"
-#include <cstdlib>
-#include <SDL_net.h>
#include <string>
+#include <enet/enet.h>
+
#include "packet.h"
MessageOut::MessageOut():
@@ -66,7 +66,7 @@ MessageOut::writeByte(char value)
void MessageOut::writeShort(short value)
{
expand(mPos + sizeof(short));
- SDLNet_Write16(value, &mData[mPos]);
+ (*(short *)&mData[mPos]) = ENET_HOST_TO_NET_16(value);
mPos += sizeof(short);
}
@@ -74,7 +74,7 @@ void
MessageOut::writeLong(long value)
{
expand(mPos + sizeof(long));
- SDLNet_Write32(value, &mData[mPos]);
+ (*(long *)&mData[mPos]) = ENET_HOST_TO_NET_32(value);
mPos += sizeof(long);
}
@@ -119,3 +119,15 @@ MessageOut::getPacket()
return mPacket;
}
+
+char*
+MessageOut::getData()
+{
+ return mData;
+}
+
+unsigned int
+MessageOut::getDataSize()
+{
+ return mDataSize;
+}