mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-11 18:50:46 +00:00
git-svn-id: https://svn.eduke32.com/eduke32@693 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
ec7c642585
commit
4e58984de5
7 changed files with 43 additions and 6 deletions
|
@ -836,7 +836,7 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
char *szLabel;
|
||||
intptr_t *plValues; // array of values
|
||||
int *plValues; // array of values
|
||||
int size;
|
||||
char bReset;
|
||||
} gamearray_t;
|
||||
|
|
|
@ -447,6 +447,9 @@ static const char *keyw[] =
|
|||
"rotatesprite16", // 315
|
||||
"gamearray", // 316
|
||||
"setarray", // 317
|
||||
"resizearray", // 318
|
||||
"writearraytofile", // 319
|
||||
"readarrayfromfile", // 320
|
||||
"<null>"
|
||||
};
|
||||
|
||||
|
@ -3371,6 +3374,16 @@ static int parsecommand(void)
|
|||
textptr++;
|
||||
transvar();
|
||||
return 0;
|
||||
case CON_RESIZEARRAY:
|
||||
getlabel();
|
||||
i=GetADefID(label+(labelcnt<<6));
|
||||
if (i > (-1))
|
||||
*scriptptr++=i;
|
||||
else
|
||||
ReportError(ERROR_NOTAGAMEARRAY);
|
||||
skipcomments();
|
||||
transvar();
|
||||
return 0;
|
||||
case CON_RANDVARVAR:
|
||||
if (!CheckEventSync(current_event))
|
||||
ReportError(WARNING_EVENTSYNC);
|
||||
|
@ -4508,6 +4521,7 @@ repeatcase:
|
|||
cheatkey[0] = *(scriptptr-1);
|
||||
transnum(LABEL_DEFINE);
|
||||
cheatkey[1] = *(scriptptr-1);
|
||||
scriptptr -= 2;
|
||||
return 0;
|
||||
|
||||
case CON_DEFINECHEAT:
|
||||
|
|
|
@ -807,4 +807,7 @@ enum keywords
|
|||
CON_ROTATESPRITE16, // 315
|
||||
CON_GAMEARRAY, // 316
|
||||
CON_SETARRAY, // 317
|
||||
CON_RESIZEARRAY, // 318
|
||||
CON_WRITEARRAYTOFILE, // 319
|
||||
CON_READARRAYFROMFILE, // 320
|
||||
};
|
||||
|
|
|
@ -6776,6 +6776,7 @@ static int parse(void)
|
|||
SetGameVarID(*insptr, *(insptr+1), g_i, g_p);
|
||||
insptr += 2;
|
||||
break;
|
||||
|
||||
case CON_SETARRAY:
|
||||
insptr++;
|
||||
j=*insptr++;
|
||||
|
@ -6787,6 +6788,20 @@ static int parse(void)
|
|||
break;
|
||||
}
|
||||
|
||||
case CON_RESIZEARRAY:
|
||||
insptr++;
|
||||
j=*insptr++;
|
||||
{
|
||||
int asize = GetGameVarID(*insptr++, g_i, g_p);
|
||||
if (asize > 0)
|
||||
{
|
||||
OSD_Printf("resizing array %s, old size %d new size %d\n", aGameArrays[j].szLabel, aGameArrays[j].size, asize);
|
||||
aGameArrays[j].plValues=Brealloc(aGameArrays[j].plValues, sizeof(int) * asize);
|
||||
aGameArrays[j].size = asize;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case CON_RANDVAR:
|
||||
insptr++;
|
||||
SetGameVarID(*insptr, mulscale(krand(), *(insptr+1)+1, 16), g_i, g_p);
|
||||
|
|
|
@ -172,7 +172,7 @@ int ReadGameVars(int fil)
|
|||
{
|
||||
//Bsprintf(g_szBuf,"Reading value array for %s (%d)",aGameVars[i].szLabel,sizeof(int) * MAXPLAYERS);
|
||||
//AddLog(g_szBuf);
|
||||
if (kdfread(aGameArrays[i].plValues,sizeof(int) * aGameArrays[i].size, 1, fil) != 1) goto corrupt;
|
||||
if (kdfread(aGameArrays[i].plValues,sizeof(intptr_t) * aGameArrays[i].size, 1, fil) != 1) goto corrupt;
|
||||
}
|
||||
|
||||
// Bsprintf(g_szBuf,"CP:%s %d",__FILE__,__LINE__);
|
||||
|
@ -255,7 +255,7 @@ void SaveGameVars(FILE *fil)
|
|||
|
||||
for (i=0;i<iGameArrayCount;i++)
|
||||
{
|
||||
dfwrite(aGameArrays[i].plValues,sizeof(int) * aGameArrays[i].size, 1, fil);
|
||||
dfwrite(aGameArrays[i].plValues,sizeof(intptr_t) * aGameArrays[i].size, 1, fil);
|
||||
}
|
||||
|
||||
for (i=0;i<MAXGAMEEVENTS;i++)
|
||||
|
|
|
@ -401,8 +401,12 @@ void cacheit(void)
|
|||
if (ud.recstat == 2)
|
||||
return;
|
||||
|
||||
MUSIC_Pause();
|
||||
if (map[MAXVOLUMES*MAXLEVELS+2].musicfn1)
|
||||
{
|
||||
MUSIC_StopSong();
|
||||
playmusic(&env_music_fn[2][0],MAXVOLUMES*MAXLEVELS+2); // loadmus
|
||||
}
|
||||
|
||||
starttime = getticks();
|
||||
|
||||
|
|
|
@ -412,11 +412,12 @@ int loadplayer(int spot)
|
|||
|
||||
i = music_select;
|
||||
music_select = (ud.volume_number*MAXLEVELS) + ud.level_number;
|
||||
if (map[(unsigned char)music_select].musicfn != NULL && (i != music_select || env_music_fn[2][0]))
|
||||
if (map[(unsigned char)music_select].musicfn != NULL && (i != music_select || map[MAXVOLUMES*MAXLEVELS+2].musicfn1))
|
||||
{
|
||||
MUSIC_StopSong();
|
||||
playmusic(&map[(unsigned char)music_select].musicfn[0],music_select);
|
||||
}
|
||||
MUSIC_Continue();
|
||||
|
||||
g_player[myconnectindex].ps->gm = MODE_GAME;
|
||||
ud.recstat = 0;
|
||||
|
|
Loading…
Reference in a new issue