diff options
author | Duane Bailey <nayryeliab@gmail.com> | 2005-09-17 21:35:26 +0000 |
---|---|---|
committer | Duane Bailey <nayryeliab@gmail.com> | 2005-09-17 21:35:26 +0000 |
commit | 3debd1554b39a6a2e790526fa02d56d1b81fda85 (patch) | |
tree | 360aed13b07b78d6260786cf28706b637037abdd /src/net | |
parent | 7eaa123ee5129ccd81ff169ada7665a812dee435 (diff) | |
download | mana-3debd1554b39a6a2e790526fa02d56d1b81fda85.tar.gz mana-3debd1554b39a6a2e790526fa02d56d1b81fda85.tar.bz2 mana-3debd1554b39a6a2e790526fa02d56d1b81fda85.tar.xz mana-3debd1554b39a6a2e790526fa02d56d1b81fda85.zip |
2005-09-17 Duane Bailey <nayryeliab@gmail.com>
* src/net/messagin.cpp, src/net/messageout.cpp, src/net/network.cpp:
removed replaced MACOSX defines with big endian defines
* src/graphics.cpp, src/graphics.h: added screenshot method
* src/game.cpp: added code, so that when one presses 'alt-p' (for
picture), it takes a screenshot and saves it to a png
* src/Makefile.am, config.ac: added png library stuff
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/messagein.cpp | 6 | ||||
-rw-r--r-- | src/net/messageout.cpp | 4 | ||||
-rw-r--r-- | src/net/network.cpp | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp index c7760c82..77f6a54f 100644 --- a/src/net/messagein.cpp +++ b/src/net/messagein.cpp @@ -25,7 +25,7 @@ #include <cassert> #include <SDL_net.h> -#ifdef MACOSX +#ifdef SDL_BYTEORDER == SDL_BIG_ENDIAN #include "win2mac.h" #endif @@ -55,7 +55,7 @@ MessageIn::readShort() { assert(mPos + 2 <= mLength); mPos += 2; -#ifdef MACOSX +#ifdef SDL_BYTEORDER == SDL_BIG_ENDIAN return DR_SwapTwoBytes(*(short*)(mData + (mPos - 2))); #else return (*(short*)(mData + (mPos - 2))); @@ -67,7 +67,7 @@ MessageIn::readLong() { assert(mPos + 4 <= mLength); mPos += 4; -#ifdef MACOSX +#ifdef SDL_BYTEORDER == SDL_BIG_ENDIAN return DR_SwapFourBytes(*(long*)(mData + (mPos - 4))); #else return (*(long*)(mData + (mPos - 4))); diff --git a/src/net/messageout.cpp b/src/net/messageout.cpp index 9c6527e0..b3f74078 100644 --- a/src/net/messageout.cpp +++ b/src/net/messageout.cpp @@ -69,7 +69,7 @@ void MessageOut::writeByte(char value) void MessageOut::writeShort(short value) { expand(mPos + sizeof(short)); -#ifdef MACOSX +#ifdef SDL_BYTEORDER == SDL_BIG_ENDIAN (*(short *)(mData + mPos)) = DR_SwapTwoBytes(value); #else (*(short *)(mData + mPos)) = value; @@ -81,7 +81,7 @@ void MessageOut::writeShort(short value) void MessageOut::writeLong(long value) { expand(mPos + sizeof(long)); -#ifdef MACOSX +#ifdef SDL_BYTEORDER == SDL_BIG_ENDIAN (*(long *)(mData + mPos)) = DR_SwapFourBytes(value); #else (*(long *)(mData + mPos)) = value; diff --git a/src/net/network.cpp b/src/net/network.cpp index 4656a233..e5a0dead 100644 --- a/src/net/network.cpp +++ b/src/net/network.cpp @@ -30,7 +30,7 @@ #include "messagein.h" #include "../log.h" -#ifdef MACOSX +#ifdef SDL_BYTEORDER == SDL_BIG_ENDIAN #include "win2mac.h" #endif @@ -247,7 +247,7 @@ void flush() unsigned short readWord(int pos) { -#ifdef MACOSX +#ifdef SDL_BYTEORDER == SDL_BIG_ENDIAN return DR_SwapTwoBytes((*(unsigned short*)(in+(pos)))); #else return (*(unsigned short *)(in+(pos))); |