Support for demo prefixes (/pXXX) so we can finally see the .dmo recordings

some mods ship with, without overriding the builtin ones.
This commit is contained in:
Marco Cawthorne 2022-02-14 15:00:48 -08:00
parent f3fa036eba
commit 9af0e5a448
Signed by: eukara
GPG Key ID: C196CD8BA993248A
1 changed files with 17 additions and 1 deletions

18
game.c
View File

@ -76,6 +76,7 @@ char qe,cp;
int32 CommandSoundToggleOff = 0;
int32 CommandMusicToggleOff = 0;
char demoprefix[128];
char confilename[128] = {"GAME.CON"},boardfilename[128] = {0};
char waterpal[768], slimepal[768], titlepal[768], drealms[768], endingpal[768];
char firstdemofile[80] = { '\0' };
@ -6721,6 +6722,16 @@ void checkcommandline(int argc,char **argv)
case '?':
comlinehelp(argv);
exit(0);
/* demo prefix --eukara */
case 'p':
case 'P':
c++;
if(*c)
{
strcpy(demoprefix,c);
printf("Using demo prefix: '%s'\n",demoprefix);
}
break;
case 'x':
case 'X':
c++;
@ -7794,6 +7805,7 @@ int main(int argc,char **argv)
char opendemoread(char which_demo) // 0 = mine
{
char d[] = "demo_.dmo";
char dest[128];
char *fname = d;
char ver;
short i;
@ -7803,6 +7815,10 @@ char opendemoread(char which_demo) // 0 = mine
else
d[4] = '0' + which_demo;
/* demo prefix support --eukara */
strcpy(dest, demoprefix);
strcat(dest, d);
ud.reccnt = 0;
if(which_demo == 1 && firstdemofile[0] != 0)
@ -7811,7 +7827,7 @@ char opendemoread(char which_demo) // 0 = mine
if ((recfilep = kopen4load(firstdemofile,loadfromgrouponly)) == -1) return(0);
}
else
if ((recfilep = kopen4load(d,loadfromgrouponly)) == -1) return(0);
if ((recfilep = kopen4load(dest,loadfromgrouponly)) == -1) return(0);
kread32(recfilep,&ud.reccnt);
kread8(recfilep,&ver);