From 9778af6489253e79308aaf073c242cc69234a7c5 Mon Sep 17 00:00:00 2001 From: hnt_ts Date: Sat, 16 Aug 2008 22:15:46 +0000 Subject: [PATCH] 1. Reverted the savegame change. Changed to use the bitptr. 2. Updated --help. AS IS. git-svn-id: https://svn.eduke32.com/eduke32@983 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/game.c | 22 +++++++++++++++++++--- polymer/eduke32/source/savegame.c | 13 ++++++------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 14a9a84f8..4dfe7c889 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -8601,16 +8601,23 @@ FAKE_F3: static void comlinehelp(void) { - char *s = "Usage: eduke32 [OPTIONS]\n" + char *s = "Usage: eduke32 [FILES] [OPTIONS]\n" "Example: eduke32 -q4 -a -m -tx -map nukeland.map\n\n" + "FILES\n" + "can be *.grp, *.zip, *.con, *.def\n" + "" + "OPTIONS\n" "-NUM\t\tLoad and run a game from slot NUM (0-9)\n" "-a\t\tUse fake player AI (fake multiplayer only)\n" "-cNUM\t\tUse MP mode NUM, 1 = DukeMatch(spawn), 2 = Coop, 3 = Dukematch(no spawn)\n" - "-cfg FILE\t\tUse configuration file FILE\n" + "-cfg FILE\tUse configuration file FILE\n" "-dFILE\t\tStart to play demo FILE\n" /* "-fNUM\t\tSend fewer packets in multiplayer (1, 2, 4) (deprecated)\n" */ "-game_dir DIR\tSee -j\n" "-gFILE, -grp FILE\tUse extra group file FILE\n" + "-gamegrp FILE\tUse FILE as a default GRP\n" + "-nam\t\tRun in Nam-compatible mode\n" + "-ww2gi\t\tRun in ww2gi-compatible mode\n" "-hFILE\t\tUse definitions file FILE\n" "-iNUM\t\tUse networking mode NUM (1/0) (multiplayer only) (default == 1)\n" "-jDIR\t\tAdds DIR to the file path stack\n" @@ -8625,9 +8632,18 @@ static void comlinehelp(void) "-qNUM\t\tUse NUM players for fake multiplayer (2-8)\n" "-r\t\tRecord demo\n" "-rmnet FILE\tUse FILE for network play configuration (see documentation)\n" + "-keepaddr\n" + "-stun\n" + "-w\t\tShow coordinates" + + "-noautoload\tDo not use the autoload directory\n" + "-nologo\t\tSkip the logo anim\n" + "-cachesize SIZE\tUse SIZE Kb for cache\n" "-sNUM\t\tUse skill level NUM (1-4)\n" #if defined RENDERTYPEWIN || (defined RENDERTYPESDL && !defined __APPLE__ && defined HAVE_GTK2) "-setup\t\tDisplays the configuration dialog\n" + + "-nosetup\t\t\n" #endif "-tNUM\t\tUse respawn mode NUM, 1 = Monsters, 2 = Items, 3 = Inventory, x = All\n" "-u#########\tUser's favorite weapon order (default: 3425689071)\n" @@ -8637,7 +8653,7 @@ static void comlinehelp(void) "-vNUM\t\tWarp to volume NUM (1-4), see -l\n" "-xFILE\t\tLoad CON script FILE (default EDUKE.CON/GAME.CON)\n" "-zNUM,\n-condebug\tLine-by-line CON compilation debugging, NUM is verbosity\n" - "\n-?, -help\tDisplay this help message and exit" + "\n-?, -help, --help\tDisplay this help message and exit" ; #if defined RENDERTYPEWIN wm_msgbox(HEAD2,s); diff --git a/polymer/eduke32/source/savegame.c b/polymer/eduke32/source/savegame.c index fb5ce15c1..4b51bcad2 100644 --- a/polymer/eduke32/source/savegame.c +++ b/polymer/eduke32/source/savegame.c @@ -24,6 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "duke3d.h" +extern char *bitptr; + void readsavenames(void) { int dummy,j; @@ -127,7 +129,6 @@ int loadplayer(int spot) int fil, bv, i, x; intptr_t j; int32 nump; - int codeextra=0; strcpy(fn, "egam0.sav"); strcpy(mpfn, "egamA_00.sav"); @@ -276,9 +277,8 @@ int loadplayer(int spot) if (kdfread(&scriptptrs[0],sizeof(scriptptrs),g_ScriptSize,fil) != g_ScriptSize) goto corrupt; if (script != NULL) Bfree(script); - if (bv>=183)codeextra=g_ScriptSize; script = Bcalloc(1,g_ScriptSize * sizeof(intptr_t)); - if (kdfread(&script[0],sizeof(script),g_ScriptSize+codeextra,fil) != g_ScriptSize) goto corrupt; + if (kdfread(&script[0],sizeof(script),g_ScriptSize,fil) != g_ScriptSize) goto corrupt; for (i=0;i=183)codeextra=g_ScriptSize; for (i=0;i= (intptr_t)(&script[0]) && (intptr_t)script[i] < (intptr_t)(&script[g_ScriptSize])) + if (bitptr[i]) + // if ((intptr_t)script[i] >= (intptr_t)(&script[0]) && (intptr_t)script[i] < (intptr_t)(&script[g_ScriptSize])) { scriptptrs[i] = 1; j = (intptr_t)script[i] - (intptr_t)&script[0]; @@ -653,7 +652,7 @@ int saveplayer(int spot) } dfwrite(&scriptptrs[0],sizeof(scriptptrs),g_ScriptSize,fil); - dfwrite(&script[0],sizeof(script),g_ScriptSize+codeextra,fil); + dfwrite(&script[0],sizeof(script),g_ScriptSize,fil); for (i=0;i