GRP loading fixes

git-svn-id: https://svn.eduke32.com/eduke32@236 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-07-22 02:54:07 +00:00
parent 6310806b44
commit 9fcbb72c59

View file

@ -59,6 +59,7 @@ char playerswhenstarted;
char qe,cp,usecwd = 0; char qe,cp,usecwd = 0;
static int32 CommandSetup = 0; static int32 CommandSetup = 0;
static int32 NoSetup = 0;
static int32 CommandSoundToggleOff = 0; static int32 CommandSoundToggleOff = 0;
static int32 CommandMusicToggleOff = 0; static int32 CommandMusicToggleOff = 0;
static char *CommandMap = NULL; static char *CommandMap = NULL;
@ -8874,6 +8875,7 @@ void app_main(int argc,char **argv)
for (i=1;i<argc;i++) { for (i=1;i<argc;i++) {
if (argv[i][0] != '-' && argv[i][0] != '/') continue; if (argv[i][0] != '-' && argv[i][0] != '/') continue;
if (!Bstrcasecmp(argv[i]+1, "setup")) CommandSetup = TRUE; if (!Bstrcasecmp(argv[i]+1, "setup")) CommandSetup = TRUE;
else if (!Bstrcasecmp(argv[i]+1, "net")) NoSetup = TRUE;
else if (!Bstrcasecmp(argv[i]+1, "nam")) { else if (!Bstrcasecmp(argv[i]+1, "nam")) {
strcpy(defaultduke3dgrp, "nam.grp"); strcpy(defaultduke3dgrp, "nam.grp");
namversion = 1; namversion = 1;
@ -8884,13 +8886,6 @@ void app_main(int argc,char **argv)
} }
} }
if (getenv("DUKE3DGRP")) {
duke3dgrp = getenv("DUKE3DGRP");
initprintf("Using `%s' as main GRP file\n", duke3dgrp);
}
checkcommandline(argc,argv);
i = CONFIG_ReadSetup(); i = CONFIG_ReadSetup();
if (preinitengine()) { if (preinitengine()) {
@ -8900,7 +8895,7 @@ void app_main(int argc,char **argv)
} }
#if defined RENDERTYPEWIN || (defined RENDERTYPESDL && !defined __APPLE__ && defined HAVE_GTK2) #if defined RENDERTYPEWIN || (defined RENDERTYPESDL && !defined __APPLE__ && defined HAVE_GTK2)
if (i < 0 || (netparam == NULL && ForceSetup) || CommandSetup) { if (i < 0 || !NoSetup && ForceSetup || CommandSetup) {
if (quitevent || !startwin_run()) { if (quitevent || !startwin_run()) {
uninitengine(); uninitengine();
exit(0); exit(0);
@ -8915,6 +8910,11 @@ void app_main(int argc,char **argv)
Bsprintf(confilename, "nam.con"); Bsprintf(confilename, "nam.con");
} }
if (getenv("DUKE3DGRP")) {
duke3dgrp = getenv("DUKE3DGRP");
initprintf("Using `%s' as main GRP file\n", duke3dgrp);
}
initgroupfile(duke3dgrp); initgroupfile(duke3dgrp);
i = kopen4load("DUKESW.BIN",1); // JBF 20030810 i = kopen4load("DUKESW.BIN",1); // JBF 20030810
if (i!=-1) { if (i!=-1) {
@ -8922,9 +8922,15 @@ void app_main(int argc,char **argv)
shareware = 1; shareware = 1;
kclose(i); kclose(i);
} }
copyprotect(); copyprotect();
if (cp) return; if (cp) return;
checkcommandline(argc,argv);
if (VOLUMEALL)
loadgroupfiles(duke3ddef);
// gotta set the proper title after we compile the CONs if this is the full version // gotta set the proper title after we compile the CONs if this is the full version
if (VOLUMEALL) wm_setapptitle(HEAD2); if (VOLUMEALL) wm_setapptitle(HEAD2);
@ -8932,9 +8938,6 @@ void app_main(int argc,char **argv)
ud.multimode = 1; ud.multimode = 1;
if (VOLUMEALL)
loadgroupfiles(duke3ddef);
initprintf("\n"); initprintf("\n");
if (condebug) if (condebug)