diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-09-02 13:03:20 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-09-02 13:03:20 +0000 |
commit | 3bce14c324e1d7bbd058e18072acc7bd953d6475 (patch) | |
tree | e51a4c8fd00bd0be1c63faae4984aaf72a72a6bc /src/net/messagein.cpp | |
parent | 2b322bf18d80acb464a9dc1820e581e7204cca1e (diff) | |
download | mana-3bce14c324e1d7bbd058e18072acc7bd953d6475.tar.gz mana-3bce14c324e1d7bbd058e18072acc7bd953d6475.tar.bz2 mana-3bce14c324e1d7bbd058e18072acc7bd953d6475.tar.xz mana-3bce14c324e1d7bbd058e18072acc7bd953d6475.zip |
Removed pixel-based synchronisation. Added variable length move messages.
Diffstat (limited to 'src/net/messagein.cpp')
-rw-r--r-- | src/net/messagein.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp index 2c452a4d..a1707e06 100644 --- a/src/net/messagein.cpp +++ b/src/net/messagein.cpp @@ -77,6 +77,17 @@ long MessageIn::readLong() return value; } +void MessageIn::readCoordinates(Uint16 &x, Uint16 &y) +{ + if (mPos + 3 <= mLength) + { + unsigned char const *p = reinterpret_cast< unsigned char const * >(mData + mPos); + x = p[0] | ((p[1] & 0x07) << 8); + y = (p[1] >> 3) | ((p[2] & 0x3F) << 5); + } + mPos += 3; +} + std::string MessageIn::readString(int length) { // Get string length |