summaryrefslogtreecommitdiff
path: root/src/net/tmwa/messageout.h
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-04-17 09:19:52 +0200
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-04-18 08:53:51 +0200
commit1c19fb5173c59b8dd7de10af93347bc9d9279e7e (patch)
tree48e1f3cf9ab986de82d2becd0dbb35f21c2f8ec2 /src/net/tmwa/messageout.h
parentaecbf876cd0a7894396a2e5034af9d93bf028aa0 (diff)
downloadmana-1c19fb5173c59b8dd7de10af93347bc9d9279e7e.tar.gz
mana-1c19fb5173c59b8dd7de10af93347bc9d9279e7e.tar.bz2
mana-1c19fb5173c59b8dd7de10af93347bc9d9279e7e.tar.xz
mana-1c19fb5173c59b8dd7de10af93347bc9d9279e7e.zip
Simplify TmwAthena::MessageOut
Since for tmwAthena we're writing messages directly into the output buffer, the MessageOut implementation does not need any members. Also used SDL_SwapLE16 and SDL_SwapLE32 for convenience.
Diffstat (limited to 'src/net/tmwa/messageout.h')
-rw-r--r--src/net/tmwa/messageout.h27
1 files changed, 3 insertions, 24 deletions
diff --git a/src/net/tmwa/messageout.h b/src/net/tmwa/messageout.h
index 4f1faa9d..b60644de 100644
--- a/src/net/tmwa/messageout.h
+++ b/src/net/tmwa/messageout.h
@@ -27,8 +27,6 @@
namespace TmwAthena {
-class Network;
-
/**
* Used for building an outgoing message to eAthena.
*
@@ -66,31 +64,12 @@ class MessageOut
void writeCoordinates(uint16_t x, uint16_t y,
uint8_t direction);
- /**
- * Returns the content of the message.
- */
- char *getData() const { return mData; }
-
- /**
- * Returns the length of the data.
- */
- unsigned int getDataSize() const { return mDataSize; }
-
private:
/**
- * Expand the packet data to be able to hold more data.
- *
- * NOTE: For performance enhancements this method could allocate extra
- * memory in advance instead of expanding size every time more data is
- * added.
+ * Expand the packet data to be able to hold more data. Returns a
+ * pointer to the start of the new data.
*/
- void expand(size_t size);
-
- Network *mNetwork;
-
- char *mData; /**< Data building up. */
- unsigned int mDataSize = 0; /**< Size of data. */
- unsigned int mPos = 0; /**< Position in the data. */
+ static char *expand(size_t size);
};
} // namespace TmwAthena