summaryrefslogtreecommitdiff
path: root/src/net/messagein.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-15 01:06:00 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-15 01:06:00 +0300
commit553ca65f60d72a12f1a579dc3948568d684ac950 (patch)
treeccf0e7b20ac1a76cde56a2a28fc269e5724131e4 /src/net/messagein.cpp
parent84e2a85c11eadd62572539d429c1de1d67223fae (diff)
downloadmanaplus-553ca65f60d72a12f1a579dc3948568d684ac950.tar.gz
manaplus-553ca65f60d72a12f1a579dc3948568d684ac950.tar.bz2
manaplus-553ca65f60d72a12f1a579dc3948568d684ac950.tar.xz
manaplus-553ca65f60d72a12f1a579dc3948568d684ac950.zip
Add net function readInt8 and use it for item pixel offset.
Diffstat (limited to 'src/net/messagein.cpp')
-rw-r--r--src/net/messagein.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp
index 301d51ad9..ccc80a838 100644
--- a/src/net/messagein.cpp
+++ b/src/net/messagein.cpp
@@ -55,6 +55,18 @@ unsigned char MessageIn::readUInt8()
mPos += 1;
PacketCounters::incInBytes(1);
+ DEBUGLOG("readUInt8: " + toStringPrint(static_cast<int>(value)));
+ return value;
+}
+
+signed char MessageIn::readInt8()
+{
+ signed char value = static_cast<signed char>(-1);
+ if (mPos < mLength)
+ value = static_cast<signed char>(mData[mPos]);
+
+ mPos += 1;
+ PacketCounters::incInBytes(1);
DEBUGLOG("readInt8: " + toStringPrint(static_cast<int>(value)));
return value;
}