diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-10-09 03:34:45 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-10-09 03:34:45 +0000 |
commit | 8bde9095c5840b8d62ebafe11beaed98877d6ac2 (patch) | |
tree | 537f717a339d1247cae222eb7a354ea5dbe8babf /src/net | |
parent | a246c08cef5e4d598fc07a681eb971bfbcf01519 (diff) | |
download | mana-8bde9095c5840b8d62ebafe11beaed98877d6ac2.tar.gz mana-8bde9095c5840b8d62ebafe11beaed98877d6ac2.tar.bz2 mana-8bde9095c5840b8d62ebafe11beaed98877d6ac2.tar.xz mana-8bde9095c5840b8d62ebafe11beaed98877d6ac2.zip |
* Made Sprite into an interface implemented by both FloorItem and Being, which
hook themselves into the map on construction. The improved fringe layer is
working as expected now.
* Made sure TMW compiles without warnings even when using "-Wconversion
-Wshadow -Wcast-qual -Wwrite-strings -ansi -pedantic", lots of cleanups.
* Added two new small tilesets that contain the desert tiles that are twice and
three times the height of a normal tile. One well in new_3-1 has been
converted to use the new double tiles for testing purposes.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/messagein.cpp | 5 | ||||
-rw-r--r-- | src/net/packet.cpp | 8 | ||||
-rw-r--r-- | src/net/packet.h | 4 |
3 files changed, 8 insertions, 9 deletions
diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp index 6086e096..25bf2f07 100644 --- a/src/net/messagein.cpp +++ b/src/net/messagein.cpp @@ -126,7 +126,6 @@ std::string MessageIn::readString(int length) { int stringLength = 0; - std::string readString = ""; // Get string length if (length < 0) { @@ -144,10 +143,10 @@ MessageIn::readString(int length) tmpString[stringLength] = 0; mPos += stringLength; - readString = tmpString; + std::string read = tmpString; delete[] tmpString; - return readString; + return read; } char& operator<<(char &lhs, MessageIn &msg) diff --git a/src/net/packet.cpp b/src/net/packet.cpp index 6d7b2b3e..e77ac117 100644 --- a/src/net/packet.cpp +++ b/src/net/packet.cpp @@ -26,15 +26,15 @@ #include <cstring> Packet::Packet(const char *data, int length): - length(length) + mLength(length) { // Create a copy of the data - this->data = new char[length]; - memcpy(this->data, data, length); + mData = new char[mLength]; + memcpy(mData, data, mLength); } Packet::~Packet() { // Clean up the data - delete[] data; + delete[] mData; } diff --git a/src/net/packet.h b/src/net/packet.h index 6b9fd18d..84d16d5e 100644 --- a/src/net/packet.h +++ b/src/net/packet.h @@ -40,8 +40,8 @@ class Packet */ ~Packet(); - char *data; /**< Packet data */ - unsigned int length; /**< Length of data in bytes */ + char *mData; /**< Packet data */ + unsigned int mLength; /**< Length of data in bytes */ }; #endif |