From 85ca6125a6d838d2da0778ed467b2971e844b8b4 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Sat, 11 Nov 2006 18:48:28 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@593 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/main.cpp | 2 -- source/src/savegamedemo.cpp | 6 ++---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/source/src/main.cpp b/source/src/main.cpp index 55f429a6..5bffad5c 100644 --- a/source/src/main.cpp +++ b/source/src/main.cpp @@ -201,7 +201,6 @@ void keyrepeat(bool on) VARF(gamespeed, 10, 100, 1000, if(multiplayer()) gamespeed = 100); -int islittleendian = 1; int framesinmap = 0; int main(int argc, char **argv) @@ -209,7 +208,6 @@ int main(int argc, char **argv) bool dedicated = false; int fs = SDL_FULLSCREEN, depth = 0, bpp = 0, fsaa = 0, par = 0, uprate = 0, maxcl = DEFAULTCLIENTS; char *sdesc = "", *ip = "", *master = NULL, *passwd = "", *maprot = NULL, *masterpwd = NULL; - islittleendian = *((char *)&islittleendian); #define log(s) puts("init: " s) log("sdl"); diff --git a/source/src/savegamedemo.cpp b/source/src/savegamedemo.cpp index 1fe2cb36..b020eb10 100644 --- a/source/src/savegamedemo.cpp +++ b/source/src/savegamedemo.cpp @@ -2,8 +2,6 @@ #include "cube.h" -extern int islittleendian; - gzFile f = NULL; bool demorecording = false; bool demoplayback = false; @@ -45,7 +43,7 @@ void savestate(char *fn) f = gzopen(fn, "wb9"); if(!f) { conoutf("could not write %s", fn); return; }; gzwrite(f, (void *)"CUBESAVE", 8); - gzputc(f, islittleendian); + gzputc(f, SDL_BYTEORDER==SDL_LITTL_ENDIAN ? 1 : 0); gzputi(SAVEGAMEVERSION); gzputi(sizeof(dynent)); gzwrite(f, getclientmap(), _MAXDEFSTR); @@ -77,7 +75,7 @@ void loadstate(char *fn) string buf; gzread(f, buf, 8); if(strncmp(buf, "CUBESAVE", 8)) goto out; - if(gzgetc(f)!=islittleendian) goto out; // not supporting save->load accross incompatible architectures simpifies things a LOT + if(gzgetc(f)!=(SDL_BYTEORDER==SDL_LITTL_ENDIAN ? 1 : 0)) goto out; // not supporting save->load accross incompatible architectures simpifies things a LOT if(gzgeti()!=SAVEGAMEVERSION || gzgeti()!=sizeof(dynent)) goto out; string mapname; gzread(f, mapname, _MAXDEFSTR);