summaryrefslogtreecommitdiff
path: root/source/q_msg.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2010-06-13 17:26:28 +0000
committerAndrey Nazarov <skuller@skuller.net>2010-06-13 17:26:28 +0000
commita4c98a614298d56fae192528323dcc74c5465e75 (patch)
treea29b39c0c35f2aa2ff831db5a0b9258bc15970ec /source/q_msg.c
parentb4778982f31e6465cd7a61a16cc57add05c2eb46 (diff)
Fixed endianess issues in *.wav and *.tga loading code.
Renamed MakeLong/MakeShort macros into MakeRawLong/MakeRawShort to prevent further confusion. Introduced LittleLongMem/LittleShortMem and RawLongMem/RawShortMem macros. Use more efficient versions of ShortSwap/LongSwap functions.
Diffstat (limited to 'source/q_msg.c')
-rw-r--r--source/q_msg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/q_msg.c b/source/q_msg.c
index bbfd655..5887a88 100644
--- a/source/q_msg.c
+++ b/source/q_msg.c
@@ -1488,7 +1488,7 @@ int MSG_ReadShort( void ) {
if (!buf) {
c = -1;
} else {
- c = (signed short)(buf[0] | (buf[1]<<8));
+ c = (signed short)LittleShortMem(buf);
}
return c;
@@ -1501,7 +1501,7 @@ int MSG_ReadWord( void ) {
if (!buf) {
c = -1;
} else {
- c = (unsigned short)(buf[0] | (buf[1]<<8));
+ c = (unsigned short)LittleShortMem(buf);
}
return c;
@@ -1514,7 +1514,7 @@ int MSG_ReadLong( void ) {
if (!buf) {
c = -1;
} else {
- c = buf[0] | (buf[1]<<8) | (buf[2]<<16) | (buf[3]<<24);
+ c = LittleLongMem(buf);
}
return c;