mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
The handling for grp, con, and def filenames has been massively cleaned up and factored into common.c. A new header, common_game.h, was created because common.h was placed in build/include (see r2542) and we need a common header for things that strictly should not be in the engine. RTS file names were also improved but some of the patterned changes were already made in r2420, and they were not factored because they are strictly part of the game, not the editor.
NAM and Napalm can now share their con, def, and rts files if the one for their respective game is not present because the con and rts files are identical. Also, decapitalize two string literals missed in r2540. git-svn-id: https://svn.eduke32.com/eduke32@2726 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
19d9d0a71e
commit
67ed6945fd
18 changed files with 350 additions and 236 deletions
|
@ -6,6 +6,8 @@
|
||||||
#include "duke3d.h"
|
#include "duke3d.h"
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
#undef GetTime
|
#undef GetTime
|
||||||
|
#include "common.h"
|
||||||
|
#include "common_game.h"
|
||||||
#include "build.h"
|
#include "build.h"
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
#include "baselayer.h"
|
#include "baselayer.h"
|
||||||
|
@ -416,7 +418,7 @@ int startwin_run(void)
|
||||||
settings.channels = ud.config.NumChannels;
|
settings.channels = ud.config.NumChannels;
|
||||||
settings.forcesetup = ud.config.ForceSetup;
|
settings.forcesetup = ud.config.ForceSetup;
|
||||||
// settings.game = gametype;
|
// settings.game = gametype;
|
||||||
strncpy(settings.selectedgrp, defaultduke3dgrp, BMAX_PATH);
|
strncpy(settings.selectedgrp, G_GrpFile(), BMAX_PATH);
|
||||||
|
|
||||||
[startwin setupRunMode];
|
[startwin setupRunMode];
|
||||||
|
|
||||||
|
@ -437,7 +439,8 @@ int startwin_run(void)
|
||||||
ud.config.NumBits = settings.bitspersample;
|
ud.config.NumBits = settings.bitspersample;
|
||||||
ud.config.NumChannels = settings.channels;
|
ud.config.NumChannels = settings.channels;
|
||||||
ud.config.ForceSetup = settings.forcesetup;
|
ud.config.ForceSetup = settings.forcesetup;
|
||||||
strncpy(defaultduke3dgrp, settings.selectedgrp, BMAX_PATH);
|
clearGrpNamePtr();
|
||||||
|
g_grpNamePtr = dup_filename(settings.selectedgrp);
|
||||||
// gametype = settings.game;
|
// gametype = settings.game;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -798,7 +798,8 @@ int32_t md_loadmodel(const char *fn);
|
||||||
int32_t md_setmisc(int32_t modelid, float scale, int32_t shadeoff, float zadd, float yoffset, int32_t flags);
|
int32_t md_setmisc(int32_t modelid, float scale, int32_t shadeoff, float zadd, float yoffset, int32_t flags);
|
||||||
// int32_t md_tilehasmodel(int32_t tilenume, int32_t pal);
|
// int32_t md_tilehasmodel(int32_t tilenume, int32_t pal);
|
||||||
|
|
||||||
extern char defsfilename[BMAX_PATH];
|
extern char *G_DefaultDefFile(void);
|
||||||
|
extern char *G_DefFile(void);
|
||||||
extern char *g_defNamePtr;
|
extern char *g_defNamePtr;
|
||||||
|
|
||||||
extern char **g_defModules;
|
extern char **g_defModules;
|
||||||
|
|
|
@ -619,7 +619,7 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
Bstrcpy(kensig,"Uses BUILD technology by Ken Silverman");
|
Bstrcpy(kensig,"Uses BUILD technology by Ken Silverman");
|
||||||
initcrc();
|
initcrc();
|
||||||
|
|
||||||
if (!loaddefinitionsfile(g_defNamePtr))
|
if (!loaddefinitionsfile(G_DefFile()))
|
||||||
initprintf("Definitions file loaded.\n");
|
initprintf("Definitions file loaded.\n");
|
||||||
|
|
||||||
for (i=0; i < g_defModulesNum; ++i)
|
for (i=0; i < g_defModulesNum; ++i)
|
||||||
|
|
|
@ -264,7 +264,7 @@ static int32_t defsparser(scriptfile *script)
|
||||||
}
|
}
|
||||||
case T_INCLUDEDEFAULT:
|
case T_INCLUDEDEFAULT:
|
||||||
{
|
{
|
||||||
defsparser_include(defsfilename, script, cmdtokptr);
|
defsparser_include(G_DefaultDefFile(), script, cmdtokptr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case T_DEFINE:
|
case T_DEFINE:
|
||||||
|
|
|
@ -32,6 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include "names.h"
|
#include "names.h"
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "common_game.h"
|
||||||
#include "mapster32.h"
|
#include "mapster32.h"
|
||||||
#include "keys.h"
|
#include "keys.h"
|
||||||
|
|
||||||
|
@ -67,12 +68,6 @@ static char levelname[BMAX_PATH];
|
||||||
// static char *startwin_labeltext = "Starting Mapster32...";
|
// static char *startwin_labeltext = "Starting Mapster32...";
|
||||||
static char setupfilename[BMAX_PATH] = "mapster32.cfg";
|
static char setupfilename[BMAX_PATH] = "mapster32.cfg";
|
||||||
|
|
||||||
char defsfilename[BMAX_PATH] = "duke3d.def";
|
|
||||||
static char defaultduke3dgrp[BMAX_PATH] = "duke3d.grp";
|
|
||||||
// g_defNamePtr can ONLY point to one of: defsfilename, malloc'd block (all
|
|
||||||
// length BMAX_PATH)
|
|
||||||
char *g_defNamePtr = defsfilename;
|
|
||||||
|
|
||||||
int32_t fixmaponsave_sprites = 1;
|
int32_t fixmaponsave_sprites = 1;
|
||||||
static int32_t fixmaponsave_walls = 0;
|
static int32_t fixmaponsave_walls = 0;
|
||||||
static int32_t lastsave = -180*60;
|
static int32_t lastsave = -180*60;
|
||||||
|
@ -82,32 +77,6 @@ static int32_t spnoclip=1;
|
||||||
static char *default_tiles_cfg = "tiles.cfg";
|
static char *default_tiles_cfg = "tiles.cfg";
|
||||||
static int32_t pathsearchmode_oninit;
|
static int32_t pathsearchmode_oninit;
|
||||||
|
|
||||||
// Sound in Mapster32
|
|
||||||
static char defaultgamecon[2][BMAX_PATH] = { "eduke.con", "game.con" };
|
|
||||||
|
|
||||||
static void clearDefNamePtr(void)
|
|
||||||
{
|
|
||||||
if (g_defNamePtr != defsfilename)
|
|
||||||
Bfree(g_defNamePtr);
|
|
||||||
// g_defNamePtr assumed to be assigned to right after
|
|
||||||
}
|
|
||||||
|
|
||||||
char * defaultgameconfile(void)
|
|
||||||
{
|
|
||||||
int32_t script; // scriptfile *script;
|
|
||||||
|
|
||||||
script = kopen4load(defaultgamecon[0],0); // script = scriptfile_fromfile(defaultgamecon[0]);
|
|
||||||
|
|
||||||
if (script >= 0)
|
|
||||||
return defaultgamecon[0];
|
|
||||||
|
|
||||||
return defaultgamecon[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
static const char *gamecon = "\0";
|
|
||||||
static int32_t g_skipDefaultCons = 0;
|
|
||||||
static int32_t g_skipDefaultDefs = 0; // primarily for NAM/WWII GI appeasement
|
|
||||||
|
|
||||||
char **g_scriptModules = NULL;
|
char **g_scriptModules = NULL;
|
||||||
int32_t g_scriptModulesNum = 0;
|
int32_t g_scriptModulesNum = 0;
|
||||||
char **g_defModules = NULL;
|
char **g_defModules = NULL;
|
||||||
|
@ -8598,7 +8567,8 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
{
|
{
|
||||||
if (argc > i+1)
|
if (argc > i+1)
|
||||||
{
|
{
|
||||||
Bstrncpyz(defaultduke3dgrp, argv[i+1], sizeof(defaultduke3dgrp));
|
clearGrpNamePtr();
|
||||||
|
g_grpNamePtr = dup_filename(argv[i+1]);
|
||||||
COPYARG(i);
|
COPYARG(i);
|
||||||
COPYARG(i+1);
|
COPYARG(i+1);
|
||||||
i++;
|
i++;
|
||||||
|
@ -8606,15 +8576,6 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
i++;
|
i++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!Bstrcasecmp(c+1,"nam"))
|
|
||||||
{
|
|
||||||
Bstrcpy(defaultduke3dgrp, "nam.grp");
|
|
||||||
Bstrcpy(defsfilename, "nam.def");
|
|
||||||
Bstrcpy(defaultgamecon[0], "nam.con");
|
|
||||||
COPYARG(i);
|
|
||||||
i++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!Bstrcasecmp(c+1,"namesfile"))
|
if (!Bstrcasecmp(c+1,"namesfile"))
|
||||||
{
|
{
|
||||||
g_namesFileName = argv[i+1];
|
g_namesFileName = argv[i+1];
|
||||||
|
@ -8665,11 +8626,23 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
i++;
|
i++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!Bstrcasecmp(c+1,"nam"))
|
||||||
|
{
|
||||||
|
g_gameType = GAMEFLAG_NAM;
|
||||||
|
COPYARG(i);
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!Bstrcasecmp(c+1,"napalm"))
|
||||||
|
{
|
||||||
|
g_gameType = GAMEFLAG_NAM|GAMEFLAG_NAPALM;
|
||||||
|
COPYARG(i);
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!Bstrcasecmp(c+1,"ww2gi"))
|
if (!Bstrcasecmp(c+1,"ww2gi"))
|
||||||
{
|
{
|
||||||
Bstrcpy(defaultduke3dgrp, "ww2gi.grp");
|
g_gameType = GAMEFLAG_WW2GI;
|
||||||
Bstrcpy(defaultgamecon[0], "ww2gi.con");
|
|
||||||
Bstrcpy(defsfilename, "ww2gi.def");
|
|
||||||
COPYARG(i);
|
COPYARG(i);
|
||||||
i++;
|
i++;
|
||||||
continue;
|
continue;
|
||||||
|
@ -8732,7 +8705,6 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
{
|
{
|
||||||
clearDefNamePtr();
|
clearDefNamePtr();
|
||||||
g_defNamePtr = dup_filename(c);
|
g_defNamePtr = dup_filename(c);
|
||||||
g_skipDefaultDefs = 1;
|
|
||||||
COPYARG(i);
|
COPYARG(i);
|
||||||
initprintf("Using DEF file \"%s\".\n",g_defNamePtr);
|
initprintf("Using DEF file \"%s\".\n",g_defNamePtr);
|
||||||
}
|
}
|
||||||
|
@ -8754,11 +8726,12 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
case 'x':
|
case 'x':
|
||||||
case 'X':
|
case 'X':
|
||||||
c++;
|
c++;
|
||||||
if (!*c) break;
|
if (*c)
|
||||||
gamecon = c;
|
{
|
||||||
g_skipDefaultCons = 1;
|
clearScriptNamePtr();
|
||||||
COPYARG(i);
|
g_scriptNamePtr = dup_filename(c);
|
||||||
initprintf("Using CON file \"%s\".\n",gamecon);
|
initprintf("Using CON file \"%s\".\n",g_scriptNamePtr);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8778,16 +8751,15 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
COPYARG(i);
|
COPYARG(i);
|
||||||
clearDefNamePtr();
|
clearDefNamePtr();
|
||||||
g_defNamePtr = dup_filename(argv[i++]);
|
g_defNamePtr = dup_filename(argv[i++]);
|
||||||
g_skipDefaultDefs = 1;
|
|
||||||
initprintf("Using DEF file \"%s\".\n",g_defNamePtr);
|
initprintf("Using DEF file \"%s\".\n",g_defNamePtr);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (!Bstrcasecmp(k,".con"))
|
else if (!Bstrcasecmp(k,".con"))
|
||||||
{
|
{
|
||||||
COPYARG(i);
|
COPYARG(i);
|
||||||
gamecon = argv[i++];
|
clearScriptNamePtr();
|
||||||
g_skipDefaultCons = 1;
|
g_scriptNamePtr = dup_filename(argv[i++]);
|
||||||
initprintf("Using CON file \"%s\".\n",gamecon);
|
initprintf("Using CON file \"%s\".\n",g_scriptNamePtr);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9680,7 +9652,7 @@ int32_t parsegroupfiles(scriptfile *script)
|
||||||
break;
|
break;
|
||||||
case T_INCLUDEDEFAULT:
|
case T_INCLUDEDEFAULT:
|
||||||
{
|
{
|
||||||
parsegroupfiles_include(defsfilename, script, cmdtokptr);
|
parsegroupfiles_include(G_DefaultDefFile(), script, cmdtokptr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10120,7 +10092,7 @@ static int32_t parseconsounds(scriptfile *script)
|
||||||
}
|
}
|
||||||
case T_INCLUDEDEFAULT:
|
case T_INCLUDEDEFAULT:
|
||||||
{
|
{
|
||||||
parseconsounds_include(defaultgameconfile(), script, cmdtokptr);
|
parseconsounds_include(G_DefaultConFile(), script, cmdtokptr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case T_DEFINE:
|
case T_DEFINE:
|
||||||
|
@ -10367,41 +10339,45 @@ int32_t ExtInit(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const char *grpNamePtr = defaultduke3dgrp;
|
|
||||||
|
|
||||||
// JBF 20031220: Because it's annoying renaming GRP files whenever I want to test different game data
|
// JBF 20031220: Because it's annoying renaming GRP files whenever I want to test different game data
|
||||||
if (getenv("DUKE3DGRP"))
|
// (CODEDUP game.c)
|
||||||
|
if (g_grpNamePtr == NULL)
|
||||||
{
|
{
|
||||||
grpNamePtr = getenv("DUKE3DGRP");
|
const char *cp = getenv("DUKE3DGRP");
|
||||||
initprintf("Using \"%s\" as main GRP file\n", grpNamePtr);
|
if (cp)
|
||||||
|
{
|
||||||
|
clearGrpNamePtr();
|
||||||
|
g_grpNamePtr = dup_filename(cp);
|
||||||
|
initprintf("Using \"%s\" as main GRP file\n", g_grpNamePtr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
i = initgroupfile(grpNamePtr);
|
const char *grpfile = G_GrpFile();
|
||||||
|
|
||||||
|
i = initgroupfile(grpfile);
|
||||||
|
|
||||||
if (!NoAutoLoad)
|
if (!NoAutoLoad)
|
||||||
{
|
{
|
||||||
G_LoadGroupsInDir("autoload");
|
G_LoadGroupsInDir("autoload");
|
||||||
|
|
||||||
if (i != -1)
|
if (i != -1)
|
||||||
G_DoAutoload(grpNamePtr);
|
G_DoAutoload(grpfile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// (CODEDUP game.c)
|
// (CODEDUP game.c)
|
||||||
|
if (g_defNamePtr == NULL)
|
||||||
{
|
{
|
||||||
const char *tmpptr = getenv("DUKE3DDEF");
|
const char *tmpptr = getenv("DUKE3DDEF");
|
||||||
if (tmpptr)
|
if (tmpptr)
|
||||||
{
|
{
|
||||||
|
clearDefNamePtr();
|
||||||
g_defNamePtr = dup_filename(tmpptr);
|
g_defNamePtr = dup_filename(tmpptr);
|
||||||
g_skipDefaultDefs = 1;
|
|
||||||
initprintf("Using \"%s\" as definitions file\n", g_defNamePtr);
|
initprintf("Using \"%s\" as definitions file\n", g_defNamePtr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (g_skipDefaultDefs == 0)
|
|
||||||
if (g_defNamePtr != defsfilename)
|
|
||||||
Bstrcpy(g_defNamePtr, defsfilename); // it MAY have changed, with NAM/WWII GI
|
|
||||||
|
|
||||||
loadgroupfiles(g_defNamePtr); // the defs are actually loaded in app_main in build.c
|
loadgroupfiles(G_DefFile()); // the defs are actually loaded in app_main in build.c
|
||||||
|
|
||||||
{
|
{
|
||||||
struct strllist *s;
|
struct strllist *s;
|
||||||
|
@ -11156,10 +11132,7 @@ void ExtCheckKeys(void)
|
||||||
{
|
{
|
||||||
g_numsounds = 0;
|
g_numsounds = 0;
|
||||||
|
|
||||||
if (g_skipDefaultCons == 0)
|
loadconsounds(G_ConFile());
|
||||||
loadconsounds(defaultgameconfile());
|
|
||||||
else
|
|
||||||
loadconsounds(gamecon);
|
|
||||||
|
|
||||||
if (g_numsounds > 0)
|
if (g_numsounds > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,13 +3,143 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
|
#include "build.h"
|
||||||
#include "scriptfile.h"
|
#include "scriptfile.h"
|
||||||
#include "cache1d.h"
|
#include "cache1d.h"
|
||||||
#include "kplib.h"
|
#include "kplib.h"
|
||||||
#include "baselayer.h"
|
#include "baselayer.h"
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "common_game.h"
|
||||||
|
|
||||||
|
int32_t g_gameType = 0;
|
||||||
|
|
||||||
|
// grp/con/def handling
|
||||||
|
|
||||||
|
char *defaultgamegrp[GAMECOUNT] = { "DUKE3D.GRP", "NAM.GRP", "NAPALM.GRP", "WW2GI.GRP" };
|
||||||
|
char *defaultdeffilename[GAMECOUNT] = { "duke3d.def", "nam.def", "napalm.def", "ww2gi.def" };
|
||||||
|
char *defaultconfilename = "GAME.CON";
|
||||||
|
char *defaultgameconfilename[GAMECOUNT] = { "EDUKE.CON", "NAM.CON", "NAPALM.CON", "WW2GI.CON" };
|
||||||
|
|
||||||
|
// g_grpNamePtr can ONLY point to a malloc'd block (length BMAX_PATH)
|
||||||
|
char *g_grpNamePtr = NULL;
|
||||||
|
// g_defNamePtr can ONLY point to a malloc'd block (length BMAX_PATH)
|
||||||
|
char *g_defNamePtr = NULL;
|
||||||
|
// g_scriptNamePtr can ONLY point to a malloc'd block (length BMAX_PATH)
|
||||||
|
char *g_scriptNamePtr = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
void clearGrpNamePtr(void)
|
||||||
|
{
|
||||||
|
if (g_grpNamePtr != NULL)
|
||||||
|
Bfree(g_grpNamePtr);
|
||||||
|
// g_grpNamePtr assumed to be assigned to right after
|
||||||
|
}
|
||||||
|
|
||||||
|
void clearDefNamePtr(void)
|
||||||
|
{
|
||||||
|
if (g_defNamePtr != NULL)
|
||||||
|
Bfree(g_defNamePtr);
|
||||||
|
// g_defNamePtr assumed to be assigned to right after
|
||||||
|
}
|
||||||
|
|
||||||
|
void clearScriptNamePtr(void)
|
||||||
|
{
|
||||||
|
if (g_scriptNamePtr != NULL)
|
||||||
|
Bfree(g_scriptNamePtr);
|
||||||
|
// g_scriptNamePtr assumed to be assigned to right after
|
||||||
|
}
|
||||||
|
|
||||||
|
char *G_DefaultGrpFile(void)
|
||||||
|
{
|
||||||
|
if (DUKE)
|
||||||
|
return defaultgamegrp[GAME_DUKE];
|
||||||
|
// order is important for the following three because GAMEFLAG_NAM overlaps all
|
||||||
|
else if (NAPALM)
|
||||||
|
return defaultgamegrp[GAME_NAPALM];
|
||||||
|
else if (WW2GI)
|
||||||
|
return defaultgamegrp[GAME_WW2GI];
|
||||||
|
else if (NAM)
|
||||||
|
return defaultgamegrp[GAME_NAM];
|
||||||
|
|
||||||
|
return defaultgamegrp[0];
|
||||||
|
}
|
||||||
|
char *G_DefaultDefFile(void)
|
||||||
|
{
|
||||||
|
if (DUKE)
|
||||||
|
return defaultdeffilename[GAME_DUKE];
|
||||||
|
else if (WW2GI)
|
||||||
|
return defaultdeffilename[GAME_WW2GI];
|
||||||
|
else if (NAPALM)
|
||||||
|
{
|
||||||
|
if ((kopen4load(defaultdeffilename[GAME_NAPALM],0) < 0) && (kopen4load(defaultdeffilename[GAME_NAM],0) >= 0))
|
||||||
|
return defaultdeffilename[GAME_NAM]; // NAM/Napalm Sharing
|
||||||
|
else
|
||||||
|
return defaultdeffilename[GAME_NAPALM];
|
||||||
|
}
|
||||||
|
else if (NAM)
|
||||||
|
{
|
||||||
|
if ((kopen4load(defaultdeffilename[GAME_NAM],0) < 0) && (kopen4load(defaultdeffilename[GAME_NAPALM],0) >= 0))
|
||||||
|
return defaultdeffilename[GAME_NAPALM]; // NAM/Napalm Sharing
|
||||||
|
else
|
||||||
|
return defaultdeffilename[GAME_NAM];
|
||||||
|
}
|
||||||
|
|
||||||
|
return defaultdeffilename[0];
|
||||||
|
}
|
||||||
|
char *G_DefaultConFile(void)
|
||||||
|
{
|
||||||
|
if (DUKE && (kopen4load(defaultgameconfilename[GAME_DUKE],0) >= 0))
|
||||||
|
return defaultgameconfilename[GAME_DUKE];
|
||||||
|
else if (WW2GI && (kopen4load(defaultgameconfilename[GAME_WW2GI],0) >= 0))
|
||||||
|
return defaultgameconfilename[GAME_WW2GI];
|
||||||
|
else if (NAPALM)
|
||||||
|
{
|
||||||
|
if (kopen4load(defaultgameconfilename[GAME_NAPALM],0) < 0)
|
||||||
|
{
|
||||||
|
if (kopen4load(defaultgameconfilename[GAME_NAM],0) >= 0)
|
||||||
|
return defaultgameconfilename[GAME_NAM]; // NAM/Napalm Sharing
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return defaultgameconfilename[GAME_NAPALM];
|
||||||
|
}
|
||||||
|
else if (NAM)
|
||||||
|
{
|
||||||
|
if (kopen4load(defaultgameconfilename[GAME_NAM],0) < 0)
|
||||||
|
{
|
||||||
|
if (kopen4load(defaultgameconfilename[GAME_NAPALM],0) >= 0)
|
||||||
|
return defaultgameconfilename[GAME_NAPALM]; // NAM/Napalm Sharing
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return defaultgameconfilename[GAME_NAM];
|
||||||
|
}
|
||||||
|
|
||||||
|
return defaultconfilename;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *G_GrpFile(void)
|
||||||
|
{
|
||||||
|
if (g_grpNamePtr == NULL)
|
||||||
|
return G_DefaultGrpFile();
|
||||||
|
else
|
||||||
|
return g_grpNamePtr;
|
||||||
|
}
|
||||||
|
char *G_DefFile(void)
|
||||||
|
{
|
||||||
|
if (g_defNamePtr == NULL)
|
||||||
|
return G_DefaultDefFile();
|
||||||
|
else
|
||||||
|
return g_defNamePtr;
|
||||||
|
}
|
||||||
|
char *G_ConFile(void)
|
||||||
|
{
|
||||||
|
if (g_scriptNamePtr == NULL)
|
||||||
|
return G_DefaultConFile();
|
||||||
|
else
|
||||||
|
return g_scriptNamePtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////
|
||||||
|
|
||||||
struct strllist *CommandPaths, *CommandGrps;
|
struct strllist *CommandPaths, *CommandGrps;
|
||||||
|
|
||||||
|
|
48
polymer/eduke32/source/common_game.h
Normal file
48
polymer/eduke32/source/common_game.h
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
//
|
||||||
|
// Definitions of common game-only data structures/functions
|
||||||
|
// (and declarations of data appearing in both)
|
||||||
|
// for EDuke32 and Mapster32
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef EDUKE32_COMMON_GAME_H_
|
||||||
|
#define EDUKE32_COMMON_GAME_H_
|
||||||
|
|
||||||
|
#define GAMEFLAG_DUKE 0x00000001
|
||||||
|
#define GAMEFLAG_NAM 0x00000002
|
||||||
|
#define GAMEFLAG_NAPALM 0x00000004
|
||||||
|
#define GAMEFLAG_WW2GI 0x00000008
|
||||||
|
|
||||||
|
extern int32_t g_gameType;
|
||||||
|
|
||||||
|
#define DUKE (g_gameType & GAMEFLAG_DUKE)
|
||||||
|
#define NAM (g_gameType & GAMEFLAG_NAM)
|
||||||
|
#define NAPALM (g_gameType & GAMEFLAG_NAPALM)
|
||||||
|
#define WW2GI (g_gameType & GAMEFLAG_WW2GI)
|
||||||
|
|
||||||
|
enum Games_t {
|
||||||
|
GAME_DUKE = 0,
|
||||||
|
GAME_NAM,
|
||||||
|
GAME_NAPALM,
|
||||||
|
GAME_WW2GI,
|
||||||
|
GAMECOUNT
|
||||||
|
};
|
||||||
|
|
||||||
|
extern char *defaultgamegrp[GAMECOUNT];
|
||||||
|
extern char *defaultdeffilename[GAMECOUNT];
|
||||||
|
extern char *defaultconfilename;
|
||||||
|
extern char *defaultgameconfilename[GAMECOUNT];
|
||||||
|
|
||||||
|
extern char *g_grpNamePtr;
|
||||||
|
extern char *g_scriptNamePtr;
|
||||||
|
|
||||||
|
extern char *G_DefaultGrpFile(void);
|
||||||
|
extern char *G_GrpFile(void);
|
||||||
|
|
||||||
|
extern char *G_DefaultConFile(void);
|
||||||
|
extern char *G_ConFile(void);
|
||||||
|
|
||||||
|
extern void clearGrpNamePtr(void);
|
||||||
|
extern void clearDefNamePtr(void);
|
||||||
|
extern void clearScriptNamePtr(void);
|
||||||
|
|
||||||
|
#endif
|
|
@ -31,6 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include "baselayer.h"
|
#include "baselayer.h"
|
||||||
#include "duke3d.h"
|
#include "duke3d.h"
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
|
#include "common_game.h"
|
||||||
#include "scriplib.h"
|
#include "scriplib.h"
|
||||||
#include "osd.h"
|
#include "osd.h"
|
||||||
#include "osdcmds.h"
|
#include "osdcmds.h"
|
||||||
|
@ -267,7 +268,7 @@ void CONFIG_SetDefaults(void)
|
||||||
ud.config.CheckForUpdates = 1;
|
ud.config.CheckForUpdates = 1;
|
||||||
|
|
||||||
if (g_rtsNamePtr == NULL)
|
if (g_rtsNamePtr == NULL)
|
||||||
Bstrcpy(ud.rtsname, defaultrtsfilename);
|
Bstrcpy(ud.rtsname, G_DefaultRtsFile());
|
||||||
Bstrcpy(szPlayerName, "Duke");
|
Bstrcpy(szPlayerName, "Duke");
|
||||||
|
|
||||||
Bstrcpy(ud.ridecule[0], "An inspiration for birth control.");
|
Bstrcpy(ud.ridecule[0], "An inspiration for birth control.");
|
||||||
|
@ -686,7 +687,7 @@ int32_t CONFIG_ReadSetup(void)
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
if (!Bstrcmp(defaultduke3dgrp,"duke3d.grp"))
|
if (g_grpNamePtr != NULL && !Bstrcmp(g_grpNamePtr,defaultgamegrp[0]))
|
||||||
SCRIPT_GetString(ud.config.scripthandle, "Setup","SelectedGRP",&g_grpNamePtr[0]);
|
SCRIPT_GetString(ud.config.scripthandle, "Setup","SelectedGRP",&g_grpNamePtr[0]);
|
||||||
|
|
||||||
if (!NAM)
|
if (!NAM)
|
||||||
|
|
|
@ -52,17 +52,10 @@ extern "C" {
|
||||||
#define VERSION "2.0.0devel"
|
#define VERSION "2.0.0devel"
|
||||||
#define HEAD2 APPNAME" "VERSION
|
#define HEAD2 APPNAME" "VERSION
|
||||||
|
|
||||||
#define GAME_DUKE 0
|
|
||||||
#define GAME_NAM 1
|
|
||||||
#define GAME_WW2 2
|
|
||||||
|
|
||||||
#define VOLUMEALL (g_Shareware == 0)
|
#define VOLUMEALL (g_Shareware == 0)
|
||||||
#define PLUTOPAK (g_scriptVersion == 14)
|
#define PLUTOPAK (g_scriptVersion == 14)
|
||||||
#define VOLUMEONE (g_Shareware == 1)
|
#define VOLUMEONE (g_Shareware == 1)
|
||||||
|
|
||||||
#define NAM (g_gameType & GAME_NAM)
|
|
||||||
#define WW2GI (g_gameType & GAME_WW2)
|
|
||||||
|
|
||||||
// increase by 3, because atomic GRP adds 1, and Shareware adds 2
|
// increase by 3, because atomic GRP adds 1, and Shareware adds 2
|
||||||
#define BYTEVERSION_JF 243
|
#define BYTEVERSION_JF 243
|
||||||
|
|
||||||
|
@ -106,6 +99,7 @@ extern "C" {
|
||||||
// so that debugging with valgrind --smc-check=none is possible:
|
// so that debugging with valgrind --smc-check=none is possible:
|
||||||
//#define DEBUG_VALGRIND_NO_SMC
|
//#define DEBUG_VALGRIND_NO_SMC
|
||||||
|
|
||||||
|
#include "common_game.h"
|
||||||
#include "namesdyn.h"
|
#include "namesdyn.h"
|
||||||
#include "function.h"
|
#include "function.h"
|
||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
|
|
|
@ -52,6 +52,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include "anim.h"
|
#include "anim.h"
|
||||||
#include "demo.h"
|
#include "demo.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "common_game.h"
|
||||||
|
|
||||||
#ifdef LUNATIC
|
#ifdef LUNATIC
|
||||||
# include "lunatic.h"
|
# include "lunatic.h"
|
||||||
|
@ -106,9 +107,6 @@ uint8_t *basepaltable[BASEPALCOUNT] = { palette, water_pal, slime_pal, dre_alms,
|
||||||
|
|
||||||
int8_t g_noFloorPal[MAXPALOOKUPS]; // 1 if sprite pal should not be taken over from floor pal
|
int8_t g_noFloorPal[MAXPALOOKUPS]; // 1 if sprite pal should not be taken over from floor pal
|
||||||
|
|
||||||
static int32_t g_skipDefaultCons = 0;
|
|
||||||
static int32_t g_skipDefaultDefs = 0; // primarily for NAM/WWII GI appeasement
|
|
||||||
|
|
||||||
int32_t voting = -1;
|
int32_t voting = -1;
|
||||||
int32_t vote_map = -1, vote_episode = -1;
|
int32_t vote_map = -1, vote_episode = -1;
|
||||||
|
|
||||||
|
@ -116,47 +114,14 @@ static int32_t g_Debug = 0;
|
||||||
static int32_t g_noLogoAnim = 0;
|
static int32_t g_noLogoAnim = 0;
|
||||||
static int32_t g_noLogo = 0;
|
static int32_t g_noLogo = 0;
|
||||||
|
|
||||||
char defaultduke3dgrp[BMAX_PATH] = "duke3d.grp";
|
const char *defaultrtsfilename[GAMECOUNT] = { "DUKE.RTS", "NAM.RTS", "NAPALM.RTS", "WW2GI.RTS" };
|
||||||
char defsfilename[BMAX_PATH] = "duke3d.def";
|
|
||||||
static char defaultconfilename[2][BMAX_PATH] = { "EDUKE.CON", "GAME.CON" };
|
|
||||||
const char *defaultrtsfilename = "DUKE.RTS";
|
|
||||||
|
|
||||||
// g_grpNamePtr can ONLY point to one of: defaultduke3dgrp, malloc'd block (all
|
|
||||||
// length BMAX_PATH)
|
|
||||||
char *g_grpNamePtr = defaultduke3dgrp;
|
|
||||||
// g_defNamePtr can ONLY point to one of: defsfilename, malloc'd block (all
|
|
||||||
// length BMAX_PATH)
|
|
||||||
char *g_defNamePtr = defsfilename;
|
|
||||||
// g_scriptNamePtr can ONLY point to defaultconfilename[0] OR to malloc'd block
|
|
||||||
// (all length BMAX_PATH)
|
|
||||||
static char *g_scriptNamePtr = defaultconfilename[0];
|
|
||||||
// g_gameNamePtr can point to one of: grpfiles[].name (string literal), string
|
// g_gameNamePtr can point to one of: grpfiles[].name (string literal), string
|
||||||
// literal, malloc'd block (XXX: possible leak)
|
// literal, malloc'd block (XXX: possible leak)
|
||||||
const char *g_gameNamePtr = NULL;
|
const char *g_gameNamePtr = NULL;
|
||||||
// g_rtsNamePtr can point to an argv[] element
|
// g_rtsNamePtr can point to an argv[] element
|
||||||
const char *g_rtsNamePtr = NULL;
|
const char *g_rtsNamePtr = NULL;
|
||||||
|
|
||||||
void clearGrpNamePtr(void)
|
|
||||||
{
|
|
||||||
if (g_grpNamePtr != defaultduke3dgrp)
|
|
||||||
Bfree(g_grpNamePtr);
|
|
||||||
// g_grpNamePtr assumed to be assigned to right after
|
|
||||||
}
|
|
||||||
|
|
||||||
void clearDefNamePtr(void)
|
|
||||||
{
|
|
||||||
if (g_defNamePtr != defsfilename)
|
|
||||||
Bfree(g_defNamePtr);
|
|
||||||
// g_defNamePtr assumed to be assigned to right after
|
|
||||||
}
|
|
||||||
|
|
||||||
static void clearScriptNamePtr(void)
|
|
||||||
{
|
|
||||||
if (g_scriptNamePtr != defaultconfilename[0])
|
|
||||||
Bfree(g_scriptNamePtr);
|
|
||||||
// g_scriptNamePtr assumed to be assigned to right after
|
|
||||||
}
|
|
||||||
|
|
||||||
char **g_scriptModules = NULL;
|
char **g_scriptModules = NULL;
|
||||||
int32_t g_scriptModulesNum = 0;
|
int32_t g_scriptModulesNum = 0;
|
||||||
char **g_defModules = NULL;
|
char **g_defModules = NULL;
|
||||||
|
@ -174,7 +139,6 @@ El_State g_ElState;
|
||||||
extern int32_t lastvisinc;
|
extern int32_t lastvisinc;
|
||||||
|
|
||||||
int32_t g_Shareware = 0;
|
int32_t g_Shareware = 0;
|
||||||
int32_t g_gameType = 0;
|
|
||||||
|
|
||||||
#define MAXUSERQUOTES 6
|
#define MAXUSERQUOTES 6
|
||||||
int32_t quotebot, quotebotgoal;
|
int32_t quotebot, quotebotgoal;
|
||||||
|
@ -239,16 +203,28 @@ int32_t kopen4loadfrommod(const char *filename, char searchfirst)
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *defaultconfile(void)
|
const char *G_DefaultRtsFile(void)
|
||||||
{
|
{
|
||||||
int32_t i;
|
if (DUKE)
|
||||||
|
return defaultrtsfilename[GAME_DUKE];
|
||||||
|
else if (WW2GI)
|
||||||
|
return defaultrtsfilename[GAME_WW2GI];
|
||||||
|
else if (NAPALM)
|
||||||
|
{
|
||||||
|
if ((kopen4load(defaultrtsfilename[GAME_NAPALM],0) < 0) && (kopen4load(defaultrtsfilename[GAME_NAM],0) >= 0))
|
||||||
|
return defaultrtsfilename[GAME_NAM]; // NAM/Napalm Sharing
|
||||||
|
else
|
||||||
|
return defaultrtsfilename[GAME_NAPALM];
|
||||||
|
}
|
||||||
|
else if (NAM)
|
||||||
|
{
|
||||||
|
if ((kopen4load(defaultrtsfilename[GAME_NAM],0) < 0) && (kopen4load(defaultrtsfilename[GAME_NAPALM],0) >= 0))
|
||||||
|
return defaultrtsfilename[GAME_NAPALM]; // NAM/Napalm Sharing
|
||||||
|
else
|
||||||
|
return defaultrtsfilename[GAME_NAM];
|
||||||
|
}
|
||||||
|
|
||||||
i = kopen4load(defaultconfilename[0],0);
|
return defaultrtsfilename[0];
|
||||||
|
|
||||||
if (i >= 0)
|
|
||||||
return defaultconfilename[0];
|
|
||||||
|
|
||||||
return defaultconfilename[1];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum gametokens
|
enum gametokens
|
||||||
|
@ -8158,7 +8134,8 @@ static void G_ShowParameterHelp(void)
|
||||||
"-mh [file.def]\tInclude an additional definitions module\n"
|
"-mh [file.def]\tInclude an additional definitions module\n"
|
||||||
"-mx [file.con]\tInclude an additional CON script module\n"
|
"-mx [file.con]\tInclude an additional CON script module\n"
|
||||||
"-m\t\tDisable monsters\n"
|
"-m\t\tDisable monsters\n"
|
||||||
"-nam\t\tRun in NAM/NAPALM compatibility mode\n"
|
"-nam\t\tRun in NAM compatibility mode\n"
|
||||||
|
"-napalm\t\tRun in Napalm compatibility mode\n"
|
||||||
"-rts [file.rts]\tLoad a custom Remote Ridicule sound bank\n"
|
"-rts [file.rts]\tLoad a custom Remote Ridicule sound bank\n"
|
||||||
"-r\t\tRecord demo\n"
|
"-r\t\tRecord demo\n"
|
||||||
"-s#\t\tSet skill level (1-4)\n"
|
"-s#\t\tSet skill level (1-4)\n"
|
||||||
|
@ -8172,7 +8149,7 @@ static void G_ShowParameterHelp(void)
|
||||||
#endif
|
#endif
|
||||||
"-u#########\tUser's favorite weapon order (default: 3425689071)\n"
|
"-u#########\tUser's favorite weapon order (default: 3425689071)\n"
|
||||||
"-v#\t\tWarp to volume #, see -l\n"
|
"-v#\t\tWarp to volume #, see -l\n"
|
||||||
"-ww2gi\t\tRun in WW2GI compatibility mode\n"
|
"-ww2gi\t\tRun in WWII GI compatibility mode\n"
|
||||||
"-x[game.con]\tLoad custom CON script\n"
|
"-x[game.con]\tLoad custom CON script\n"
|
||||||
"-#\t\tLoad and run a game from slot # (0-9)\n"
|
"-#\t\tLoad and run a game from slot # (0-9)\n"
|
||||||
// "\n-?/--help\tDisplay this help message and exit\n"
|
// "\n-?/--help\tDisplay this help message and exit\n"
|
||||||
|
@ -8390,7 +8367,7 @@ static int32_t parsedefinitions_game(scriptfile *script, int32_t preload)
|
||||||
}
|
}
|
||||||
case T_INCLUDEDEFAULT:
|
case T_INCLUDEDEFAULT:
|
||||||
{
|
{
|
||||||
parsedefinitions_game_include(defsfilename, script, cmdtokptr, preload);
|
parsedefinitions_game_include(G_DefaultDefFile(), script, cmdtokptr, preload);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case T_NOAUTOLOAD:
|
case T_NOAUTOLOAD:
|
||||||
|
@ -8747,7 +8724,8 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
{
|
{
|
||||||
if (argc > i+1)
|
if (argc > i+1)
|
||||||
{
|
{
|
||||||
Bstrcpy(defaultduke3dgrp,argv[i+1]);
|
clearGrpNamePtr();
|
||||||
|
g_grpNamePtr = dup_filename(argv[i+1]);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
|
@ -8755,21 +8733,19 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
}
|
}
|
||||||
if (!Bstrcasecmp(c+1,"nam"))
|
if (!Bstrcasecmp(c+1,"nam"))
|
||||||
{
|
{
|
||||||
Bstrcpy(defaultduke3dgrp, "nam.grp");
|
g_gameType = GAMEFLAG_NAM;
|
||||||
Bstrcpy(defsfilename, "nam.def");
|
i++;
|
||||||
// Bstrcpy(g_defNamePtr, "nam.def");
|
continue;
|
||||||
Bstrcpy(defaultconfilename[0], "nam.con");
|
}
|
||||||
g_gameType = GAME_NAM;
|
if (!Bstrcasecmp(c+1,"napalm"))
|
||||||
|
{
|
||||||
|
g_gameType = GAMEFLAG_NAM|GAMEFLAG_NAPALM;
|
||||||
i++;
|
i++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!Bstrcasecmp(c+1,"ww2gi"))
|
if (!Bstrcasecmp(c+1,"ww2gi"))
|
||||||
{
|
{
|
||||||
Bstrcpy(defaultduke3dgrp, "ww2gi.grp");
|
g_gameType = GAMEFLAG_WW2GI;
|
||||||
Bstrcpy(defsfilename, "ww2gi.def");
|
|
||||||
// Bstrcpy(g_defNamePtr, "ww2gi.def");
|
|
||||||
Bstrcpy(defaultconfilename[0], "ww2gi.con");
|
|
||||||
g_gameType = GAME_WW2;
|
|
||||||
i++;
|
i++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -9039,7 +9015,6 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
{
|
{
|
||||||
clearDefNamePtr();
|
clearDefNamePtr();
|
||||||
g_defNamePtr = dup_filename(c);
|
g_defNamePtr = dup_filename(c);
|
||||||
g_skipDefaultDefs = 1;
|
|
||||||
initprintf("Using DEF file \"%s\".\n",g_defNamePtr);
|
initprintf("Using DEF file \"%s\".\n",g_defNamePtr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -9164,7 +9139,6 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
{
|
{
|
||||||
clearScriptNamePtr();
|
clearScriptNamePtr();
|
||||||
g_scriptNamePtr = dup_filename(c);
|
g_scriptNamePtr = dup_filename(c);
|
||||||
g_skipDefaultCons = 1;
|
|
||||||
initprintf("Using CON file \"%s\".\n",g_scriptNamePtr);
|
initprintf("Using CON file \"%s\".\n",g_scriptNamePtr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -9212,7 +9186,6 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
{
|
{
|
||||||
clearScriptNamePtr();
|
clearScriptNamePtr();
|
||||||
g_scriptNamePtr = dup_filename(argv[i++]);
|
g_scriptNamePtr = dup_filename(argv[i++]);
|
||||||
g_skipDefaultCons = 1;
|
|
||||||
initprintf("Using CON file \"%s\".\n",g_scriptNamePtr);
|
initprintf("Using CON file \"%s\".\n",g_scriptNamePtr);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -9220,7 +9193,6 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
{
|
{
|
||||||
clearDefNamePtr();
|
clearDefNamePtr();
|
||||||
g_defNamePtr = dup_filename(argv[i++]);
|
g_defNamePtr = dup_filename(argv[i++]);
|
||||||
g_skipDefaultDefs = 1;
|
|
||||||
initprintf("Using DEF file \"%s\".\n",g_defNamePtr);
|
initprintf("Using DEF file \"%s\".\n",g_defNamePtr);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -9515,27 +9487,16 @@ static void G_CompileScripts(void)
|
||||||
labelcode = (int32_t *)§or[0]; // V8: 4096*40/4 = 40960 V7: 1024*40/4 = 10240
|
labelcode = (int32_t *)§or[0]; // V8: 4096*40/4 = 40960 V7: 1024*40/4 = 10240
|
||||||
labeltype = (int32_t *)&wall[0]; // V8: 16384*32/4 = 131072 V7: 8192*32/4 = 65536
|
labeltype = (int32_t *)&wall[0]; // V8: 16384*32/4 = 131072 V7: 8192*32/4 = 65536
|
||||||
|
|
||||||
Bcorrectfilename(g_scriptNamePtr,0);
|
if (g_scriptNamePtr != NULL)
|
||||||
|
Bcorrectfilename(g_scriptNamePtr,0);
|
||||||
|
|
||||||
// if we compile for a V7 engine wall[] should be used for label names since it's bigger
|
// if we compile for a V7 engine wall[] should be used for label names since it's bigger
|
||||||
pathsearchmode = 1;
|
pathsearchmode = 1;
|
||||||
if (g_skipDefaultCons == 0)
|
|
||||||
{
|
C_Compile(G_ConFile());
|
||||||
const char *cp = defaultconfile();
|
|
||||||
if (cp != g_scriptNamePtr)
|
|
||||||
Bsprintf(g_scriptNamePtr, "%s", cp);
|
|
||||||
}
|
|
||||||
C_Compile(g_scriptNamePtr);
|
|
||||||
|
|
||||||
if (g_loadFromGroupOnly) // g_loadFromGroupOnly is true only when compiling fails and internal defaults are utilized
|
if (g_loadFromGroupOnly) // g_loadFromGroupOnly is true only when compiling fails and internal defaults are utilized
|
||||||
{
|
C_Compile(G_ConFile());
|
||||||
if (g_skipDefaultCons == 0)
|
|
||||||
{
|
|
||||||
const char *cp = defaultconfile();
|
|
||||||
if (cp != g_scriptNamePtr)
|
|
||||||
Bsprintf(g_scriptNamePtr, "%s", cp);
|
|
||||||
}
|
|
||||||
C_Compile(g_scriptNamePtr);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((uint32_t)g_numLabels > MAXSPRITES*sizeof(spritetype)/64) // see the arithmetic above for why
|
if ((uint32_t)g_numLabels > MAXSPRITES*sizeof(spritetype)/64) // see the arithmetic above for why
|
||||||
G_GameExit("Error: too many labels defined!");
|
G_GameExit("Error: too many labels defined!");
|
||||||
|
@ -10073,6 +10034,8 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
|
|
||||||
i = CONFIG_ReadSetup();
|
i = CONFIG_ReadSetup();
|
||||||
|
|
||||||
|
// CODEDUP astub.c
|
||||||
|
if (g_grpNamePtr == NULL)
|
||||||
{
|
{
|
||||||
const char *cp = getenv("DUKE3DGRP");
|
const char *cp = getenv("DUKE3DGRP");
|
||||||
if (cp)
|
if (cp)
|
||||||
|
@ -10145,7 +10108,7 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
|
|
||||||
ScanGroups();
|
ScanGroups();
|
||||||
{
|
{
|
||||||
// try and identify the 'defaultduke3dgrp' in the set of GRPs.
|
// try and identify the 'defaultgamegrp' in the set of GRPs.
|
||||||
// if it is found, set up the environment accordingly for the game it represents.
|
// if it is found, set up the environment accordingly for the game it represents.
|
||||||
// if it is not found, choose the first GRP from the list
|
// if it is not found, choose the first GRP from the list
|
||||||
struct grpfile *fg, *first = NULL;
|
struct grpfile *fg, *first = NULL;
|
||||||
|
@ -10156,7 +10119,7 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
if (i == NUMGRPFILES) continue; // unrecognised grp file
|
if (i == NUMGRPFILES) continue; // unrecognised grp file
|
||||||
fg->game = grpfiles[i].game;
|
fg->game = grpfiles[i].game;
|
||||||
if (!first) first = fg;
|
if (!first) first = fg;
|
||||||
if (!Bstrcasecmp(fg->name, defaultduke3dgrp))
|
if (!Bstrcasecmp(fg->name, G_DefaultGrpFile()))
|
||||||
{
|
{
|
||||||
g_gameType = grpfiles[i].game;
|
g_gameType = grpfiles[i].game;
|
||||||
g_gameNamePtr = grpfiles[i].name;
|
g_gameNamePtr = grpfiles[i].name;
|
||||||
|
@ -10165,7 +10128,11 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
}
|
}
|
||||||
if (!fg && first)
|
if (!fg && first)
|
||||||
{
|
{
|
||||||
Bstrcpy(defaultduke3dgrp, first->name);
|
if (g_grpNamePtr == NULL)
|
||||||
|
{
|
||||||
|
clearGrpNamePtr();
|
||||||
|
g_grpNamePtr = dup_filename(first->name);
|
||||||
|
}
|
||||||
g_gameType = first->game;
|
g_gameType = first->game;
|
||||||
g_gameNamePtr = grpfiles[0].name;
|
g_gameNamePtr = grpfiles[0].name;
|
||||||
}
|
}
|
||||||
|
@ -10187,15 +10154,8 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
|
|
||||||
if (WW2GI || NAM)
|
if (WW2GI || NAM)
|
||||||
{
|
{
|
||||||
// overwrite the default GRP and CON so that if the user chooses
|
Bstrcpy(GametypeNames[0],"GruntMatch (Spawn)");
|
||||||
// something different, they get what they asked for
|
Bstrcpy(GametypeNames[2],"GruntMatch (No Spawn)");
|
||||||
Bstrcpy(defaultduke3dgrp, WW2GI ? "ww2gi.grp" : "nam.grp");
|
|
||||||
Bstrcpy(defsfilename, WW2GI ? "ww2gi.def" : "nam.def");
|
|
||||||
// Bstrcpy(g_defNamePtr, WW2GI ? "ww2gi.def" : "nam.def");
|
|
||||||
Bstrcpy(defaultconfilename[0], WW2GI ? "ww2gi.con" : "nam.con");
|
|
||||||
|
|
||||||
Bstrcpy(GametypeNames[0],"GRUNTMATCH (SPAWN)");
|
|
||||||
Bstrcpy(GametypeNames[2],"GRUNTMATCH (NO SPAWN)");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_modDir[0] != '/')
|
if (g_modDir[0] != '/')
|
||||||
|
@ -10302,40 +10262,40 @@ CLEAN_DIRECTORY:
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((i = initgroupfile(g_grpNamePtr)) == -1)
|
|
||||||
initprintf("Warning: could not find main data file \"%s\"!\n",g_grpNamePtr);
|
|
||||||
else
|
|
||||||
initprintf("Using \"%s\" as main game data file.\n", g_grpNamePtr);
|
|
||||||
|
|
||||||
if (!g_noAutoLoad && !ud.config.NoAutoLoad)
|
|
||||||
{
|
{
|
||||||
G_LoadGroupsInDir("autoload");
|
const char *grpfile = G_GrpFile();
|
||||||
|
|
||||||
if (i != -1)
|
if ((i = initgroupfile(grpfile)) == -1)
|
||||||
G_DoAutoload(g_grpNamePtr);
|
initprintf("Warning: could not find main data file \"%s\"!\n",grpfile);
|
||||||
|
else
|
||||||
|
initprintf("Using \"%s\" as main game data file.\n", grpfile);
|
||||||
|
|
||||||
|
if (!g_noAutoLoad && !ud.config.NoAutoLoad)
|
||||||
|
{
|
||||||
|
G_LoadGroupsInDir("autoload");
|
||||||
|
|
||||||
|
if (i != -1)
|
||||||
|
G_DoAutoload(grpfile);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_modDir[0] != '/')
|
if (g_modDir[0] != '/')
|
||||||
G_LoadGroupsInDir(g_modDir);
|
G_LoadGroupsInDir(g_modDir);
|
||||||
|
|
||||||
// CODEDUP astub.c
|
// CODEDUP astub.c
|
||||||
|
if (g_defNamePtr == NULL)
|
||||||
{
|
{
|
||||||
const char *tmpptr = getenv("DUKE3DDEF");
|
const char *tmpptr = getenv("DUKE3DDEF");
|
||||||
if (tmpptr)
|
if (tmpptr)
|
||||||
{
|
{
|
||||||
clearDefNamePtr();
|
clearDefNamePtr();
|
||||||
g_defNamePtr = dup_filename(tmpptr);
|
g_defNamePtr = dup_filename(tmpptr);
|
||||||
g_skipDefaultDefs = 1;
|
|
||||||
initprintf("Using \"%s\" as definitions file\n", g_defNamePtr);
|
initprintf("Using \"%s\" as definitions file\n", g_defNamePtr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_skipDefaultDefs == 0)
|
|
||||||
if (g_defNamePtr != defsfilename)
|
|
||||||
Bstrcpy(g_defNamePtr, defsfilename); // it MAY have changed, with NAM/WWII GI
|
|
||||||
|
|
||||||
flushlogwindow = 0;
|
flushlogwindow = 0;
|
||||||
loaddefinitions_game(g_defNamePtr, TRUE);
|
loaddefinitions_game(G_DefFile(), TRUE);
|
||||||
// flushlogwindow = 1;
|
// flushlogwindow = 1;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -10417,10 +10377,13 @@ CLEAN_DIRECTORY:
|
||||||
|
|
||||||
if (quitevent) return 4;
|
if (quitevent) return 4;
|
||||||
|
|
||||||
if (!loaddefinitionsfile(g_defNamePtr))
|
|
||||||
{
|
{
|
||||||
initprintf("Definitions file \"%s\" loaded.\n",g_defNamePtr);
|
char *defsfile = G_DefFile();
|
||||||
loaddefinitions_game(g_defNamePtr, FALSE);
|
if (!loaddefinitionsfile(defsfile))
|
||||||
|
{
|
||||||
|
initprintf("Definitions file \"%s\" loaded.\n",defsfile);
|
||||||
|
loaddefinitions_game(defsfile, FALSE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=0; i < g_defModulesNum; ++i)
|
for (i=0; i < g_defModulesNum; ++i)
|
||||||
|
@ -10449,18 +10412,15 @@ CLEAN_DIRECTORY:
|
||||||
playerswhenstarted = ud.multimode;
|
playerswhenstarted = ud.multimode;
|
||||||
ud.last_level = 0;
|
ud.last_level = 0;
|
||||||
|
|
||||||
|
// the point of this block is to avoid overwriting the default in the cfg while asserting our selection
|
||||||
if (g_rtsNamePtr == NULL &&
|
if (g_rtsNamePtr == NULL &&
|
||||||
(!Bstrcasecmp(ud.rtsname,defaultrtsfilename) ||
|
(!Bstrcasecmp(ud.rtsname,defaultrtsfilename[GAME_DUKE]) ||
|
||||||
!Bstrcasecmp(ud.rtsname,"WW2GI.RTS") ||
|
!Bstrcasecmp(ud.rtsname,defaultrtsfilename[GAME_WW2GI]) ||
|
||||||
!Bstrcasecmp(ud.rtsname,"NAM.RTS")))
|
!Bstrcasecmp(ud.rtsname,defaultrtsfilename[GAME_NAM]) ||
|
||||||
|
!Bstrcasecmp(ud.rtsname,defaultrtsfilename[GAME_NAPALM])))
|
||||||
{
|
{
|
||||||
// ud.last_level is used as a flag here to reset the string to default after load
|
// ud.last_level is used as a flag here to reset the string to default after load
|
||||||
if (WW2GI)
|
ud.last_level = (Bstrcpy(ud.rtsname, G_DefaultRtsFile()) == ud.rtsname);
|
||||||
ud.last_level = (Bstrcpy(ud.rtsname, "WW2GI.RTS") == ud.rtsname);
|
|
||||||
else if (NAM)
|
|
||||||
ud.last_level = (Bstrcpy(ud.rtsname, "NAM.RTS") == ud.rtsname);
|
|
||||||
else
|
|
||||||
ud.last_level = (Bstrcpy(ud.rtsname, defaultrtsfilename) == ud.rtsname);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RTS_Init(ud.rtsname);
|
RTS_Init(ud.rtsname);
|
||||||
|
@ -10469,7 +10429,7 @@ CLEAN_DIRECTORY:
|
||||||
initprintf("Using RTS file \"%s\".\n",ud.rtsname);
|
initprintf("Using RTS file \"%s\".\n",ud.rtsname);
|
||||||
|
|
||||||
if (ud.last_level)
|
if (ud.last_level)
|
||||||
Bstrcpy(ud.rtsname, defaultrtsfilename);
|
Bstrcpy(ud.rtsname, defaultrtsfilename[0]);
|
||||||
|
|
||||||
ud.last_level = -1;
|
ud.last_level = -1;
|
||||||
|
|
||||||
|
|
|
@ -178,17 +178,19 @@ extern cactype cac[];
|
||||||
|
|
||||||
// this is checked against http://eduke32.com/VERSION
|
// this is checked against http://eduke32.com/VERSION
|
||||||
extern const char *s_buildDate;
|
extern const char *s_buildDate;
|
||||||
extern char *g_grpNamePtr;
|
|
||||||
extern char *g_defNamePtr;
|
|
||||||
extern const char *g_gameNamePtr;
|
extern const char *g_gameNamePtr;
|
||||||
extern const char *g_rtsNamePtr;
|
extern const char *g_rtsNamePtr;
|
||||||
|
|
||||||
extern char **g_scriptModules;
|
extern char **g_scriptModules;
|
||||||
extern int32_t g_scriptModulesNum;
|
extern int32_t g_scriptModulesNum;
|
||||||
|
|
||||||
extern char CheatStrings[][MAXCHEATLEN];
|
extern char CheatStrings[][MAXCHEATLEN];
|
||||||
extern char boardfilename[BMAX_PATH], currentboardfilename[BMAX_PATH];
|
extern char boardfilename[BMAX_PATH], currentboardfilename[BMAX_PATH];
|
||||||
extern char boardfilename[BMAX_PATH];
|
extern char boardfilename[BMAX_PATH];
|
||||||
extern char defaultduke3dgrp[BMAX_PATH];
|
|
||||||
extern const char *defaultrtsfilename;
|
extern const char *defaultrtsfilename[GAMECOUNT];
|
||||||
|
extern const char *G_DefaultRtsFile(void);
|
||||||
|
|
||||||
extern char g_modDir[BMAX_PATH];
|
extern char g_modDir[BMAX_PATH];
|
||||||
extern char g_modDir[BMAX_PATH];
|
extern char g_modDir[BMAX_PATH];
|
||||||
extern char inputloc;
|
extern char inputloc;
|
||||||
|
@ -209,7 +211,6 @@ extern int32_t g_cameraDistance;
|
||||||
extern int32_t g_crosshairSum;
|
extern int32_t g_crosshairSum;
|
||||||
extern int32_t g_doQuickSave;
|
extern int32_t g_doQuickSave;
|
||||||
extern int32_t g_forceWeaponChoice;
|
extern int32_t g_forceWeaponChoice;
|
||||||
extern int32_t g_gameType;
|
|
||||||
extern int32_t g_levelTextTime;
|
extern int32_t g_levelTextTime;
|
||||||
extern int32_t g_noSetup;
|
extern int32_t g_noSetup;
|
||||||
extern int32_t g_quitDeadline;
|
extern int32_t g_quitDeadline;
|
||||||
|
@ -242,9 +243,6 @@ extern user_defs ud;
|
||||||
|
|
||||||
//extern int32_t g_yax_smoothratio;
|
//extern int32_t g_yax_smoothratio;
|
||||||
|
|
||||||
void clearDefNamePtr(void);
|
|
||||||
void clearGrpNamePtr(void);
|
|
||||||
|
|
||||||
int32_t A_CheckInventorySprite(spritetype *s);
|
int32_t A_CheckInventorySprite(spritetype *s);
|
||||||
int32_t A_InsertSprite(int32_t whatsect,int32_t s_x,int32_t s_y,int32_t s_z,int32_t s_pn,int32_t s_s,int32_t s_xr,int32_t s_yr,int32_t s_a,int32_t s_ve,int32_t s_zv,int32_t s_ow,int32_t s_ss);
|
int32_t A_InsertSprite(int32_t whatsect,int32_t s_x,int32_t s_y,int32_t s_z,int32_t s_pn,int32_t s_s,int32_t s_xr,int32_t s_yr,int32_t s_a,int32_t s_ve,int32_t s_zv,int32_t s_ow,int32_t s_ss);
|
||||||
int32_t A_Spawn(int32_t j,int32_t pn);
|
int32_t A_Spawn(int32_t j,int32_t pn);
|
||||||
|
@ -255,7 +253,6 @@ int32_t G_PrintGameText(int32_t f,int32_t tile,int32_t x,int32_t y,const char *t
|
||||||
int32_t GetTime(void);
|
int32_t GetTime(void);
|
||||||
int32_t _EnterText(int32_t small,int32_t x,int32_t y,char *t,int32_t dalen,int32_t c);
|
int32_t _EnterText(int32_t small,int32_t x,int32_t y,char *t,int32_t dalen,int32_t c);
|
||||||
int32_t kopen4loadfrommod(const char *filename,char searchfirst);
|
int32_t kopen4loadfrommod(const char *filename,char searchfirst);
|
||||||
char * defaultconfile(void);
|
|
||||||
int32_t minitext_(int32_t x,int32_t y,const char *t,int32_t s,int32_t p,int32_t sb);
|
int32_t minitext_(int32_t x,int32_t y,const char *t,int32_t s,int32_t p,int32_t sb);
|
||||||
int32_t mpgametext(int32_t y,const char *t,int32_t s,int32_t dabits);
|
int32_t mpgametext(int32_t y,const char *t,int32_t s,int32_t dabits);
|
||||||
int32_t startwin_run(void);
|
int32_t startwin_run(void);
|
||||||
|
|
|
@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include "gameexec.h"
|
#include "gameexec.h"
|
||||||
#include "savegame.h"
|
#include "savegame.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "common_game.h"
|
||||||
|
|
||||||
#include "osd.h"
|
#include "osd.h"
|
||||||
|
|
||||||
|
@ -2529,7 +2530,7 @@ static int32_t C_ParseCommand(int32_t loop)
|
||||||
|
|
||||||
case CON_INCLUDEDEFAULT:
|
case CON_INCLUDEDEFAULT:
|
||||||
C_SkipComments();
|
C_SkipComments();
|
||||||
C_Include(defaultconfile());
|
C_Include(G_DefaultConFile());
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case CON_AI:
|
case CON_AI:
|
||||||
|
@ -5776,7 +5777,7 @@ void C_Compile(const char *filenam)
|
||||||
"version of Duke Nukem 3D: Atomic Edition immediately for only $5.99 through our partnership with GOG.com.\n\n"
|
"version of Duke Nukem 3D: Atomic Edition immediately for only $5.99 through our partnership with GOG.com.\n\n"
|
||||||
"Not a typo; it's less than 6 bucks. Get Duke now?\n\n"
|
"Not a typo; it's less than 6 bucks. Get Duke now?\n\n"
|
||||||
"(Clicking yes will bring you to our web store)",
|
"(Clicking yes will bring you to our web store)",
|
||||||
g_grpNamePtr,g_grpNamePtr);
|
G_GrpFile(),G_GrpFile());
|
||||||
|
|
||||||
if (wm_ynbox("Important - Duke Nukem 3D not found - EDuke32","%s",tempbuf))
|
if (wm_ynbox("Important - Duke Nukem 3D not found - EDuke32","%s",tempbuf))
|
||||||
{
|
{
|
||||||
|
@ -5799,7 +5800,7 @@ void C_Compile(const char *filenam)
|
||||||
Bsprintf(tempbuf,"Duke Nukem 3D game data was not found. A valid copy of \"%s\" or other compatible data is needed to run EDuke32.\n"
|
Bsprintf(tempbuf,"Duke Nukem 3D game data was not found. A valid copy of \"%s\" or other compatible data is needed to run EDuke32.\n"
|
||||||
"You can find \"%s\" in the 'DN3DINST' or 'ATOMINST' directory on your Duke Nukem 3D installation CD-ROM.\n\n"
|
"You can find \"%s\" in the 'DN3DINST' or 'ATOMINST' directory on your Duke Nukem 3D installation CD-ROM.\n\n"
|
||||||
"EDuke32 will now close.",
|
"EDuke32 will now close.",
|
||||||
g_grpNamePtr,g_grpNamePtr);
|
G_GrpFile(),G_GrpFile());
|
||||||
G_GameExit(tempbuf);
|
G_GameExit(tempbuf);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
#include "duke3d.h"
|
#include "duke3d.h"
|
||||||
|
#include "common_game.h"
|
||||||
#include "gamevars.h"
|
#include "gamevars.h"
|
||||||
#include "gamedef.h"
|
#include "gamedef.h"
|
||||||
#include "osd.h"
|
#include "osd.h"
|
||||||
|
|
|
@ -28,18 +28,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include "crc32.h"
|
#include "crc32.h"
|
||||||
|
|
||||||
#include "duke3d.h"
|
#include "duke3d.h"
|
||||||
|
#include "common_game.h"
|
||||||
#include "grpscan.h"
|
#include "grpscan.h"
|
||||||
|
|
||||||
struct grpfile grpfiles[NUMGRPFILES] =
|
struct grpfile grpfiles[NUMGRPFILES] =
|
||||||
{
|
{
|
||||||
{ "Duke Nukem 3D", 0xBBC9CE44, 26524524, GAME_DUKE, NULL },
|
{ "Duke Nukem 3D", 0xBBC9CE44, 26524524, GAMEFLAG_DUKE, NULL },
|
||||||
{ "Duke Nukem 3D: Atomic Edition", 0xF514A6AC, 44348015, GAME_DUKE, NULL },
|
{ "Duke Nukem 3D: Atomic Edition", 0xF514A6AC, 44348015, GAMEFLAG_DUKE, NULL },
|
||||||
{ "Duke Nukem 3D: Atomic Edition", 0xFD3DCFF1, 44356548, GAME_DUKE, NULL },
|
{ "Duke Nukem 3D: Atomic Edition", 0xFD3DCFF1, 44356548, GAMEFLAG_DUKE, NULL },
|
||||||
{ "Duke Nukem 3D Shareware", 0x983AD923, 11035779, GAME_DUKE, NULL },
|
{ "Duke Nukem 3D Shareware", 0x983AD923, 11035779, GAMEFLAG_DUKE, NULL },
|
||||||
{ "Duke Nukem 3D Mac Shareware", 0xC5F71561, 10444391, GAME_DUKE, NULL },
|
{ "Duke Nukem 3D Mac Shareware", 0xC5F71561, 10444391, GAMEFLAG_DUKE, NULL },
|
||||||
{ "NAM", 0x75C1F07B, 43448927, GAME_NAM, NULL },
|
{ "NAM", 0x75C1F07B, 43448927, GAMEFLAG_NAM, NULL },
|
||||||
{ "Napalm", 0x3DE1589A, 44365728, GAME_NAM, NULL },
|
{ "Napalm", 0x3DE1589A, 44365728, GAMEFLAG_NAM|GAMEFLAG_NAPALM, NULL },
|
||||||
{ "WW2GI", 0x907B82BF, 77939508, GAME_WW2|GAME_NAM, NULL },
|
{ "WWII GI", 0x907B82BF, 77939508, GAMEFLAG_WW2GI|GAMEFLAG_NAM, NULL },
|
||||||
};
|
};
|
||||||
struct grpfile *foundgrps = NULL;
|
struct grpfile *foundgrps = NULL;
|
||||||
|
|
||||||
|
@ -68,10 +69,10 @@ static int32_t LoadGroupsCache(void)
|
||||||
|
|
||||||
while (!scriptfile_eof(script))
|
while (!scriptfile_eof(script))
|
||||||
{
|
{
|
||||||
if (scriptfile_getstring(script, &fname)) break; // filename
|
if (scriptfile_getstring(script, &fname)) break; // filename
|
||||||
if (scriptfile_getnumber(script, &fsize)) break; // filesize
|
if (scriptfile_getnumber(script, &fsize)) break; // filesize
|
||||||
if (scriptfile_getnumber(script, &fmtime)) break; // modification time
|
if (scriptfile_getnumber(script, &fmtime)) break; // modification time
|
||||||
if (scriptfile_getnumber(script, &fcrcval)) break; // crc checksum
|
if (scriptfile_getnumber(script, &fcrcval)) break; // crc checksum
|
||||||
|
|
||||||
fg = Bcalloc(1, sizeof(struct grpcache));
|
fg = Bcalloc(1, sizeof(struct grpcache));
|
||||||
fg->next = grpcache;
|
fg->next = grpcache;
|
||||||
|
@ -130,12 +131,12 @@ int32_t ScanGroups(void)
|
||||||
|
|
||||||
if (fg)
|
if (fg)
|
||||||
{
|
{
|
||||||
if (findfrompath(sidx->name, &fn)) continue; // failed to resolve the filename
|
if (findfrompath(sidx->name, &fn)) continue; // failed to resolve the filename
|
||||||
if (Bstat(fn, &st))
|
if (Bstat(fn, &st))
|
||||||
{
|
{
|
||||||
Bfree(fn);
|
Bfree(fn);
|
||||||
continue;
|
continue;
|
||||||
} // failed to stat the file
|
} // failed to stat the file
|
||||||
Bfree(fn);
|
Bfree(fn);
|
||||||
if (fg->size == st.st_size && fg->mtime == st.st_mtime)
|
if (fg->size == st.st_size && fg->mtime == st.st_mtime)
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,6 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include "demo.h"
|
#include "demo.h"
|
||||||
#include "crc32.h"
|
#include "crc32.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "common_game.h"
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
#include "duke3d.h"
|
#include "duke3d.h"
|
||||||
|
#include "common_game.h"
|
||||||
#include "osd.h"
|
#include "osd.h"
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "demo.h"
|
#include "demo.h"
|
||||||
|
|
|
@ -33,6 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "common_game.h"
|
||||||
|
|
||||||
#define RDR_POLYMOST 3 // sould be defined elsewhere
|
#define RDR_POLYMOST 3 // sould be defined elsewhere
|
||||||
#define RDR_POLYMER 4 // sould be defined elsewhere
|
#define RDR_POLYMER 4 // sould be defined elsewhere
|
||||||
|
@ -886,7 +887,7 @@ int32_t startwin_run(void)
|
||||||
settings.custommoddir = g_modDir;
|
settings.custommoddir = g_modDir;
|
||||||
settings.forcesetup = ud.config.ForceSetup;
|
settings.forcesetup = ud.config.ForceSetup;
|
||||||
settings.game = g_gameType;
|
settings.game = g_gameType;
|
||||||
Bstrncpyz(settings.selectedgrp, g_grpNamePtr, BMAX_PATH);
|
Bstrncpyz(settings.selectedgrp, G_GrpFile(), BMAX_PATH);
|
||||||
if (ud.config.NoAutoLoad) settings.autoload = FALSE;
|
if (ud.config.NoAutoLoad) settings.autoload = FALSE;
|
||||||
else settings.autoload = TRUE;
|
else settings.autoload = TRUE;
|
||||||
#ifdef POLYMER
|
#ifdef POLYMER
|
||||||
|
|
|
@ -46,6 +46,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "common_game.h"
|
||||||
|
|
||||||
#define TAB_CONFIG 0
|
#define TAB_CONFIG 0
|
||||||
// #define TAB_GAME 1
|
// #define TAB_GAME 1
|
||||||
|
@ -738,7 +739,7 @@ int32_t startwin_run(void)
|
||||||
settings.usejoy = ud.config.UseJoystick;
|
settings.usejoy = ud.config.UseJoystick;
|
||||||
settings.game = g_gameType;
|
settings.game = g_gameType;
|
||||||
// settings.crcval = 0;
|
// settings.crcval = 0;
|
||||||
Bstrncpyz(settings.selectedgrp, g_grpNamePtr, BMAX_PATH);
|
Bstrncpyz(settings.selectedgrp, G_GrpFile(), BMAX_PATH);
|
||||||
settings.gamedir = g_modDir;
|
settings.gamedir = g_modDir;
|
||||||
PopulateForm(-1);
|
PopulateForm(-1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue