Replaced the 'dynquote' primitive with 'qsprintf' and fixed a parsing bug with some of the level and sound name definition stuff.

git-svn-id: https://svn.eduke32.com/eduke32@290 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-09-06 04:18:28 +00:00
parent 11e8db76a8
commit e2ccbf6870
5 changed files with 33 additions and 25 deletions

View File

@ -9087,7 +9087,6 @@ void app_main(int argc,char **argv)
{ {
Bsprintf(ud.user_name[j],"PLAYER %d",j+1); Bsprintf(ud.user_name[j],"PLAYER %d",j+1);
ps[j].team = ud.pteam[j] = i; ps[j].team = ud.pteam[j] = i;
initprintf("p %d t %d\n",j,ps[j].team);
i = 1-i; i = 1-i;
} }
} }

View File

@ -408,7 +408,7 @@ char *keyw[] = {
"precache", // 261 "precache", // 261
"definegamefuncname", // 262 "definegamefuncname", // 262
"redefinequote", // 263 "redefinequote", // 263
"dynquote", // 264 "qsprintf", // 264
"getpname", // 265 "getpname", // 265
"qstrcat", // 266 "qstrcat", // 266
"qstrcpy", // 267 "qstrcpy", // 267
@ -2788,7 +2788,8 @@ char parsecommand(void)
ReportError(WARNING_EVENTSYNC); ReportError(WARNING_EVENTSYNC);
return 0; return 0;
case CON_DYNQUOTE: case CON_QSPRINTF:
transnum(LABEL_DEFINE);
transnum(LABEL_DEFINE); transnum(LABEL_DEFINE);
for(j = 0;j < 4;j++) for(j = 0;j < 4;j++)
{ {
@ -4309,7 +4310,7 @@ repeatcase:
transnum(LABEL_DEFINE); transnum(LABEL_DEFINE);
scriptptr--; scriptptr--;
j = *scriptptr; j = *scriptptr;
while( *textptr == ' ' ) textptr++; skipcomments();
if (j < 0 || j > MAXVOLUMES-1) if (j < 0 || j > MAXVOLUMES-1)
{ {
@ -4342,7 +4343,7 @@ repeatcase:
transnum(LABEL_DEFINE); transnum(LABEL_DEFINE);
scriptptr--; scriptptr--;
j = *scriptptr; j = *scriptptr;
while( *textptr == ' ' ) textptr++; skipcomments();
if (j < 0 || j > NUMGAMEFUNCTIONS-1) if (j < 0 || j > NUMGAMEFUNCTIONS-1)
{ {
@ -4376,7 +4377,7 @@ repeatcase:
transnum(LABEL_DEFINE); transnum(LABEL_DEFINE);
scriptptr--; scriptptr--;
j = *scriptptr; j = *scriptptr;
while( *textptr == ' ' ) textptr++; skipcomments();
if (j < 0 || j > 4) if (j < 0 || j > 4)
{ {
@ -4413,7 +4414,7 @@ repeatcase:
scriptptr--; //remove it from compiled code scriptptr--; //remove it from compiled code
gametype_flags[j] = *scriptptr; //put it into the flags gametype_flags[j] = *scriptptr; //put it into the flags
while( *textptr == ' ' ) textptr++; skipcomments();
if (j < 0 || j > MAXGAMETYPES-1) if (j < 0 || j > MAXGAMETYPES-1)
{ {
@ -4449,7 +4450,7 @@ repeatcase:
transnum(LABEL_DEFINE); transnum(LABEL_DEFINE);
scriptptr--; scriptptr--;
k = *scriptptr; k = *scriptptr;
while( *textptr == ' ' ) textptr++; skipcomments();
if (j < 0 || j > MAXVOLUMES-1) if (j < 0 || j > MAXVOLUMES-1)
{ {
@ -4468,7 +4469,7 @@ repeatcase:
} }
i = 0; i = 0;
while( *textptr != ' ' && *textptr != 0x0a ) while( *textptr != ' ' && *textptr != 0x0d && *textptr != 0x0a )
{ {
level_file_names[j*11+k][i] = *textptr; level_file_names[j*11+k][i] = *textptr;
textptr++,i++; textptr++,i++;
@ -4482,21 +4483,21 @@ repeatcase:
} }
level_names[j*11+k][i] = '\0'; level_names[j*11+k][i] = '\0';
while( *textptr == ' ' ) textptr++; skipcomments();
partime[j*11+k] = partime[j*11+k] =
(((*(textptr+0)-'0')*10+(*(textptr+1)-'0'))*26*60)+ (((*(textptr+0)-'0')*10+(*(textptr+1)-'0'))*26*60)+
(((*(textptr+3)-'0')*10+(*(textptr+4)-'0'))*26); (((*(textptr+3)-'0')*10+(*(textptr+4)-'0'))*26);
textptr += 5; textptr += 5;
while( *textptr == ' ' ) textptr++; skipcomments();
designertime[j*11+k] = designertime[j*11+k] =
(((*(textptr+0)-'0')*10+(*(textptr+1)-'0'))*26*60)+ (((*(textptr+0)-'0')*10+(*(textptr+1)-'0'))*26*60)+
(((*(textptr+3)-'0')*10+(*(textptr+4)-'0'))*26); (((*(textptr+3)-'0')*10+(*(textptr+4)-'0'))*26);
textptr += 5; textptr += 5;
while( *textptr == ' ' ) textptr++; skipcomments();
i = 0; i = 0;
@ -4544,8 +4545,7 @@ repeatcase:
i = 0; i = 0;
while( *textptr == ' ' ) skipcomments();
textptr++;
if (tw == CON_REDEFINEQUOTE) if (tw == CON_REDEFINEQUOTE)
{ {
@ -4613,8 +4613,9 @@ repeatcase:
} }
scriptptr--; scriptptr--;
i = 0; i = 0;
while( *textptr == ' ' )
textptr++; skipcomments();
while( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 && *textptr != ' ') while( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 && *textptr != ' ')
{ {
cheatquotes[k][i] = *textptr; cheatquotes[k][i] = *textptr;
@ -4643,7 +4644,7 @@ repeatcase:
i = 0; i = 0;
skipcomments(); skipcomments();
while( *textptr != ' ' ) while( *textptr != ' ' && *textptr != 0x0d && *textptr != 0x0a)
{ {
sounds[k][i] = *textptr; sounds[k][i] = *textptr;
textptr++,i++; textptr++,i++;

View File

@ -695,7 +695,7 @@ enum keywords {
CON_PRECACHE, // 261 CON_PRECACHE, // 261
CON_DEFINEGAMEFUNCNAME, // 262 CON_DEFINEGAMEFUNCNAME, // 262
CON_REDEFINEQUOTE, // 263 CON_REDEFINEQUOTE, // 263
CON_DYNQUOTE, // 264 CON_QSPRINTF, // 264
CON_GETPNAME, // 265 CON_GETPNAME, // 265
CON_QSTRCAT, // 266 CON_QSTRCAT, // 266
CON_QSTRCPY, // 267 CON_QSTRCPY, // 267

View File

@ -5364,21 +5364,23 @@ SKIPJIBS:
ps[g_p].pals[j] = *insptr++; ps[g_p].pals[j] = *insptr++;
break; break;
case CON_DYNQUOTE: case CON_QSPRINTF:
{ {
long var1, var2, var3, var4; long var1, var2, var3, var4, sq, dq;
insptr++; insptr++;
if(fta_quotes[*insptr] != NULL) dq = *insptr++;
sq = *insptr++;
if(fta_quotes[sq] != NULL && fta_quotes[dq] != NULL)
{ {
Bstrcpy(tempbuf,fta_quotes[*insptr++]); Bstrcpy(tempbuf,fta_quotes[sq]);
var1 = GetGameVarID(*insptr++, g_i, g_p); var1 = GetGameVarID(*insptr++, g_i, g_p);
var2 = GetGameVarID(*insptr++, g_i, g_p); var2 = GetGameVarID(*insptr++, g_i, g_p);
var3 = GetGameVarID(*insptr++, g_i, g_p); var3 = GetGameVarID(*insptr++, g_i, g_p);
var4 = GetGameVarID(*insptr++, g_i, g_p); var4 = GetGameVarID(*insptr++, g_i, g_p);
Bsprintf(fta_quotes[122],tempbuf,var1,var2,var3,var4); Bsprintf(fta_quotes[dq],tempbuf,var1,var2,var3,var4);
FTA(122,&ps[g_p]);
} else { } else {
OSD_Printf("%s %d null quote %d\n",__FILE__,__LINE__,*insptr); if(fta_quotes[sq] == NULL) OSD_Printf("%s %d null quote %d\n",__FILE__,__LINE__,sq);
if(fta_quotes[dq] == NULL) OSD_Printf("%s %d null quote %d\n",__FILE__,__LINE__,dq);
insptr += 5; insptr += 5;
} }
break; break;

View File

@ -61,6 +61,12 @@ static int osdcmd_setsoundfilter(const osdfuncparm_t *parm);
# include <cmath> # include <cmath>
#endif #endif
#ifdef JFAUD
#define MAXCACHE1DSIZE (16*1048576)
#else
#define MAXCACHE1DSIZE (32*1048576)
#endif
class KenFile : public JFAudFile { class KenFile : public JFAudFile {
private: private:
int fh; int fh;