Support for using a different cfg file via command line

git-svn-id: https://svn.eduke32.com/eduke32@360 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-11-24 04:25:13 +00:00
parent cac0d84384
commit 8efa4670bb
5 changed files with 20 additions and 9 deletions

View file

@ -97,10 +97,6 @@ int32 ScreenBPP = 8;
#endif
int32 ForceSetup = 1;
static char setupfilename[BMAX_PATH]=
{
SETUPFILENAME
};
int32 scripthandle = -1;
static int32 setupread=0;
@ -635,6 +631,8 @@ int32 CONFIG_ReadSetup(void)
if (SafeFileExists(setupfilename) && scripthandle < 0) // JBF 20031211
scripthandle = SCRIPT_Load(setupfilename);
initprintf("Using config file %s.\n",setupfilename);
if (scripthandle < 0) return -1;
if (scripthandle >= 0)

View file

@ -880,6 +880,8 @@ extern short weapon_sprites[MAX_WEAPONS];
extern int redefined_quote_count;
extern char setupfilename[BMAX_PATH];
#ifdef __cplusplus
}
#endif

View file

@ -8304,9 +8304,9 @@ int loadgroupfiles(char *fn)
int j = initgroupfile(fn);
if (j == -1)
initprintf("Could not find GRP file %s.\n",fn);
initprintf("Warning: could not find group file %s.\n",fn);
else
initprintf("Using GRP file %s.\n",fn);
initprintf("Using group file %s.\n",fn);
}
}
break;
@ -8359,6 +8359,16 @@ void checkcommandline(int argc,char **argv)
c = argv[i];
if (((*c == '/') || (*c == '-')) && (!firstnet))
{
if (!Bstrcasecmp(c+1,"cfg"))
{
if (argc > i+1)
{
Bstrcpy(setupfilename,argv[i+1]);
i++;
}
i++;
continue;
}
if (!Bstrcasecmp(c+1,"nam"))
{
strcpy(defaultduke3dgrp, "nam.grp");
@ -9660,6 +9670,8 @@ void app_main(int argc,char **argv)
kclose(i);
}
loadgroupfiles(duke3ddef);
{
struct strllist *s;
while (CommandGrps)
@ -9679,8 +9691,6 @@ void app_main(int argc,char **argv)
}
}
loadgroupfiles(duke3ddef);
copyprotect();
if (cp) return;

View file

@ -6910,7 +6910,7 @@ good:
}
default:
OSD_Printf("fatal error: default processing: %ld, %ld\ncurrent actor: %d (%d)\n",*insptr,*(insptr-1),g_i,g_sp->picnum);
OSD_Printf("fatal error: default processing: prev inst: %ld, curr inst: %ld, next inst: %ld\ncurrent actor: %d (%d)\n",*(insptr-1),*insptr,*(insptr+1),g_i,g_sp->picnum);
gameexit("An error has occurred in the EDuke32 CON executor.\n\nPlease mail all of your CON files along with the file eduke32.log\nto terminx@gmail.com.\n\nThank you.");
break;
}

View file

@ -179,3 +179,4 @@ int spriteflags[MAXTILES], actorspriteflags[MAXSPRITES];
proj_struct projectile[MAXTILES], thisprojectile[MAXSPRITES], defaultprojectile[MAXTILES];
char cheatkey[2] = { sc_D, sc_N };
char setupfilename[BMAX_PATH]= "duke3d.cfg";