mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 11:10:47 +00:00
This rips all of the camera control shit out of userdefs and re-implements it as a bunch of pointer gamevars. This required adding in support for vars which are pointers to chars and short ints. It appears to work properly, without overwriting anything that happens to be adjacent (in memory) to the values being set. We'll see.
git-svn-id: https://svn.eduke32.com/eduke32@502 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
b436f4fb71
commit
7da6eb3f8e
7 changed files with 84 additions and 268 deletions
|
@ -862,6 +862,10 @@ void CONFIG_WriteSetup(void)
|
||||||
SCRIPT_PutNumber(scripthandle, "Sound Setup", "FXVolume",FXVolume,false,false);
|
SCRIPT_PutNumber(scripthandle, "Sound Setup", "FXVolume",FXVolume,false,false);
|
||||||
SCRIPT_PutNumber(scripthandle, "Sound Setup", "MusicToggle",MusicToggle,false,false);
|
SCRIPT_PutNumber(scripthandle, "Sound Setup", "MusicToggle",MusicToggle,false,false);
|
||||||
SCRIPT_PutNumber(scripthandle, "Sound Setup", "MusicVolume",MusicVolume,false,false);
|
SCRIPT_PutNumber(scripthandle, "Sound Setup", "MusicVolume",MusicVolume,false,false);
|
||||||
|
SCRIPT_PutNumber(scripthandle, "Sound Setup", "NumVoices",NumVoices,false,false);
|
||||||
|
SCRIPT_PutNumber(scripthandle, "Sound Setup", "NumChannels",NumChannels,false,false);
|
||||||
|
SCRIPT_PutNumber(scripthandle, "Sound Setup", "NumBits",NumBits,false,false);
|
||||||
|
SCRIPT_PutNumber(scripthandle, "Sound Setup", "MixRate",MixRate,false,false);
|
||||||
SCRIPT_PutNumber(scripthandle, "Sound Setup", "ReverseStereo",ReverseStereo,false,false);
|
SCRIPT_PutNumber(scripthandle, "Sound Setup", "ReverseStereo",ReverseStereo,false,false);
|
||||||
SCRIPT_PutNumber(scripthandle, "Sound Setup", "SoundToggle",SoundToggle,false,false);
|
SCRIPT_PutNumber(scripthandle, "Sound Setup", "SoundToggle",SoundToggle,false,false);
|
||||||
SCRIPT_PutNumber(scripthandle, "Sound Setup", "VoiceToggle",VoiceToggle,false,false);
|
SCRIPT_PutNumber(scripthandle, "Sound Setup", "VoiceToggle",VoiceToggle,false,false);
|
||||||
|
|
|
@ -727,17 +727,19 @@ enum events {
|
||||||
enum gamevarflags {
|
enum gamevarflags {
|
||||||
MAXGAMEVARS = 2048,
|
MAXGAMEVARS = 2048,
|
||||||
MAXVARLABEL = 26,
|
MAXVARLABEL = 26,
|
||||||
GAMEVAR_FLAG_NORMAL = 0, // normal
|
GAMEVAR_FLAG_NORMAL = 0, // normal
|
||||||
GAMEVAR_FLAG_PERPLAYER = 1, // per-player variable
|
GAMEVAR_FLAG_PERPLAYER = 1, // per-player variable
|
||||||
GAMEVAR_FLAG_PERACTOR = 2, // per-actor variable
|
GAMEVAR_FLAG_PERACTOR = 2, // per-actor variable
|
||||||
GAMEVAR_FLAG_USER_MASK = 3,
|
GAMEVAR_FLAG_USER_MASK = 3,
|
||||||
GAMEVAR_FLAG_DEFAULT = 256, // allow override
|
GAMEVAR_FLAG_DEFAULT = 256, // allow override
|
||||||
GAMEVAR_FLAG_SECRET = 512, // don't dump...
|
GAMEVAR_FLAG_SECRET = 512, // don't dump...
|
||||||
GAMEVAR_FLAG_NODEFAULT = 1024, // don't reset on actor spawn
|
GAMEVAR_FLAG_NODEFAULT = 1024, // don't reset on actor spawn
|
||||||
GAMEVAR_FLAG_SYSTEM = 2048, // cannot change mode flags...(only default value)
|
GAMEVAR_FLAG_SYSTEM = 2048, // cannot change mode flags...(only default value)
|
||||||
GAMEVAR_FLAG_READONLY = 4096, // values are read-only (no setvar allowed)
|
GAMEVAR_FLAG_READONLY = 4096, // values are read-only (no setvar allowed)
|
||||||
GAMEVAR_FLAG_PLONG = 8192, // plValue is a pointer to a long
|
GAMEVAR_FLAG_PLONG = 8192, // plValue is a pointer to a long
|
||||||
GAMEVAR_FLAG_SYNCCHECK = 16384 // check event sync when translating
|
GAMEVAR_FLAG_SYNCCHECK = 16384, // check event sync when translating
|
||||||
|
GAMEVAR_FLAG_PSHORT = 32768, // plValue is a pointer to a short
|
||||||
|
GAMEVAR_FLAG_PCHAR = 65536 // plValue is a pointer to a char
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -179,7 +179,7 @@ inline void setstatusbarscale(long sc)
|
||||||
|
|
||||||
static inline long sbarx(long x)
|
static inline long sbarx(long x)
|
||||||
{
|
{
|
||||||
if (ud.screen_size == 4 || ud.statusbarmode == 1) return scale(x<<16,ud.statusbarscale,100);
|
if (ud.screen_size == 4 /*|| ud.statusbarmode == 1*/) return scale(x<<16,ud.statusbarscale,100);
|
||||||
return (((320l<<16) - scale(320l<<16,ud.statusbarscale,100)) >> 1) + scale(x<<16,ud.statusbarscale,100);
|
return (((320l<<16) - scale(320l<<16,ud.statusbarscale,100)) >> 1) + scale(x<<16,ud.statusbarscale,100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,9 +209,9 @@ static void patchstatusbar(long x1, long y1, long x2, long y2)
|
||||||
clofx = (xdim - scale(xdim,ud.statusbarscale,100)) >> 1;
|
clofx = (xdim - scale(xdim,ud.statusbarscale,100)) >> 1;
|
||||||
clofy = (ydim - scale(ydim,ud.statusbarscale,100));
|
clofy = (ydim - scale(ydim,ud.statusbarscale,100));
|
||||||
|
|
||||||
if (ud.statusbarmode == 0)
|
// if (ud.statusbarmode == 0)
|
||||||
rotatesprite(tx,ty,scl,0,BOTTOMSTATUSBAR,4,0,10+16+64,clx1+clofx,cly1+clofy,clx2+clofx-1,cly2+clofy-1);
|
rotatesprite(tx,ty,scl,0,BOTTOMSTATUSBAR,4,0,10+16+64,clx1+clofx,cly1+clofy,clx2+clofx-1,cly2+clofy-1);
|
||||||
else rotatesprite(tx,ty,scl,0,BOTTOMSTATUSBAR,4,0,10+16+64,clx1,cly1,clx2+clofx-1,cly2+clofy-1);
|
// else rotatesprite(tx,ty,scl,0,BOTTOMSTATUSBAR,4,0,10+16+64,clx1,cly1,clx2+clofx-1,cly2+clofy-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setgamepalette(struct player_struct *player, char *pal, int set)
|
void setgamepalette(struct player_struct *player, char *pal, int set)
|
||||||
|
@ -3567,7 +3567,7 @@ void drawbackground(void)
|
||||||
if (ps[myconnectindex].gm & MODE_GAME || ud.recstat == 2)
|
if (ps[myconnectindex].gm & MODE_GAME || ud.recstat == 2)
|
||||||
//if (ud.recstat == 0 || ud.recstat == 1 || (ud.recstat == 2 && ud.reccnt > 0)) // JBF 20040717
|
//if (ud.recstat == 0 || ud.recstat == 1 || (ud.recstat == 2 && ud.reccnt > 0)) // JBF 20040717
|
||||||
{
|
{
|
||||||
if (ud.screen_size == 8)
|
if (ud.screen_size == 8 && ud.statusbarmode == 0)
|
||||||
y1 = scale(ydim,200-scale(tilesizy[BOTTOMSTATUSBAR],ud.statusbarscale,100),200);
|
y1 = scale(ydim,200-scale(tilesizy[BOTTOMSTATUSBAR],ud.statusbarscale,100),200);
|
||||||
else if (gametype_flags[ud.coop] & GAMETYPE_FLAG_FRAGBAR)
|
else if (gametype_flags[ud.coop] & GAMETYPE_FLAG_FRAGBAR)
|
||||||
{
|
{
|
||||||
|
@ -3615,7 +3615,7 @@ void drawbackground(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw in the bits to the left and right of the non-fullsize status bar
|
// draw in the bits to the left and right of the non-fullsize status bar
|
||||||
if (ud.statusbarscale < 100)
|
if (ud.statusbarscale < 100 && ud.screen_size >= 8 && ud.statusbarmode == 0)
|
||||||
{
|
{
|
||||||
y1 = y2;
|
y1 = y2;
|
||||||
x2 = (xdim - scale(xdim,ud.statusbarscale,100)) >> 1;
|
x2 = (xdim - scale(xdim,ud.statusbarscale,100)) >> 1;
|
||||||
|
|
|
@ -812,35 +812,6 @@ LABELS userdefslabels[]=
|
||||||
{ "automsg", USERDEFS_AUTOMSG, 0, 0 },
|
{ "automsg", USERDEFS_AUTOMSG, 0, 0 },
|
||||||
{ "idplayers", USERDEFS_IDPLAYERS, 0, 0 },
|
{ "idplayers", USERDEFS_IDPLAYERS, 0, 0 },
|
||||||
{ "team", USERDEFS_TEAM, 0, 0 },
|
{ "team", USERDEFS_TEAM, 0, 0 },
|
||||||
#if 1
|
|
||||||
{ "myx", USERDEFS_MYX, 0, 0 },
|
|
||||||
{ "omyx", USERDEFS_OMYX, 0, 0 },
|
|
||||||
{ "myxvel", USERDEFS_MYXVEL, 0, 0 },
|
|
||||||
{ "myy", USERDEFS_MYY, 0, 0 },
|
|
||||||
{ "omyy", USERDEFS_OMYY, 0, 0 },
|
|
||||||
{ "myyvel", USERDEFS_MYYVEL, 0, 0 },
|
|
||||||
{ "myz", USERDEFS_MYZ, 0, 0 },
|
|
||||||
{ "omyz", USERDEFS_OMYZ, 0, 0 },
|
|
||||||
{ "myzvel", USERDEFS_MYZVEL, 0, 0 },
|
|
||||||
{ "myhoriz", USERDEFS_MYHORIZ, 0, 0 },
|
|
||||||
{ "omyhoriz", USERDEFS_OMYHORIZ, 0, 0 },
|
|
||||||
{ "myhorizoff", USERDEFS_MYHORIZOFF, 0, 0 },
|
|
||||||
{ "omyhorizoff", USERDEFS_OMYHORIZOFF, 0, 0 },
|
|
||||||
{ "myang", USERDEFS_MYANG, 0, 0 },
|
|
||||||
{ "omyang", USERDEFS_OMYANG, 0, 0 },
|
|
||||||
{ "mycursectnum", USERDEFS_MYCURSECTNUM, 0, 0 },
|
|
||||||
{ "myjumpingcounter", USERDEFS_MYJUMPINGCOUNTER, 0, 0 },
|
|
||||||
{ "myjumpingtoggle", USERDEFS_MYJUMPINGTOGGLE, 0, 0 },
|
|
||||||
{ "myonground", USERDEFS_MYONGROUND, 0, 0 },
|
|
||||||
{ "myhardlanding", USERDEFS_MYHARDLANDING, 0, 0 },
|
|
||||||
{ "myreturntocenter", USERDEFS_MYRETURNTOCENTER, 0, 0 },
|
|
||||||
#endif
|
|
||||||
{ "camerax", USERDEFS_CAMERAX, 0, 0 },
|
|
||||||
{ "cameray", USERDEFS_CAMERAY, 0, 0 },
|
|
||||||
{ "cameraz", USERDEFS_CAMERAZ, 0, 0 },
|
|
||||||
{ "cameraang", USERDEFS_CAMERAANG, 0, 0 },
|
|
||||||
{ "camerasect", USERDEFS_CAMERASECT, 0, 0 },
|
|
||||||
{ "camerahoriz", USERDEFS_CAMERAHORIZ, 0, 0 },
|
|
||||||
{ "", -1, 0, 0 } // END OF LIST
|
{ "", -1, 0, 0 } // END OF LIST
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -314,37 +314,7 @@ enum userdefslabels {
|
||||||
USERDEFS_AUTOVOTE,
|
USERDEFS_AUTOVOTE,
|
||||||
USERDEFS_AUTOMSG,
|
USERDEFS_AUTOMSG,
|
||||||
USERDEFS_IDPLAYERS,
|
USERDEFS_IDPLAYERS,
|
||||||
USERDEFS_TEAM,
|
USERDEFS_TEAM
|
||||||
// this stuff isn't really userdef stuff, but getuserdef/setuserdef is already set up for what I want to do
|
|
||||||
#if 1
|
|
||||||
USERDEFS_MYX,
|
|
||||||
USERDEFS_OMYX,
|
|
||||||
USERDEFS_MYXVEL,
|
|
||||||
USERDEFS_MYY,
|
|
||||||
USERDEFS_OMYY,
|
|
||||||
USERDEFS_MYYVEL,
|
|
||||||
USERDEFS_MYZ,
|
|
||||||
USERDEFS_OMYZ,
|
|
||||||
USERDEFS_MYZVEL,
|
|
||||||
USERDEFS_MYHORIZ,
|
|
||||||
USERDEFS_OMYHORIZ,
|
|
||||||
USERDEFS_MYHORIZOFF,
|
|
||||||
USERDEFS_OMYHORIZOFF,
|
|
||||||
USERDEFS_MYANG,
|
|
||||||
USERDEFS_OMYANG,
|
|
||||||
USERDEFS_MYCURSECTNUM,
|
|
||||||
USERDEFS_MYJUMPINGCOUNTER,
|
|
||||||
USERDEFS_MYJUMPINGTOGGLE,
|
|
||||||
USERDEFS_MYONGROUND,
|
|
||||||
USERDEFS_MYHARDLANDING,
|
|
||||||
USERDEFS_MYRETURNTOCENTER,
|
|
||||||
#endif
|
|
||||||
USERDEFS_CAMERAX,
|
|
||||||
USERDEFS_CAMERAY,
|
|
||||||
USERDEFS_CAMERAZ,
|
|
||||||
USERDEFS_CAMERAANG,
|
|
||||||
USERDEFS_CAMERASECT,
|
|
||||||
USERDEFS_CAMERAHORIZ,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum sectorlabels {
|
enum sectorlabels {
|
||||||
|
|
|
@ -665,197 +665,6 @@ static void DoUserDef(int iSet, int lLabelID, int lVar2)
|
||||||
SetGameVarID(lVar2, ud.team, g_i, g_p);
|
SetGameVarID(lVar2, ud.team, g_i, g_p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if 1
|
|
||||||
case USERDEFS_MYX:
|
|
||||||
if (iSet)
|
|
||||||
myx = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, myx, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_OMYX:
|
|
||||||
if (iSet)
|
|
||||||
omyx = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, omyx, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_MYXVEL:
|
|
||||||
if (iSet)
|
|
||||||
myxvel = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, myxvel, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_MYY:
|
|
||||||
if (iSet)
|
|
||||||
myy = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, myy, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_OMYY:
|
|
||||||
if (iSet)
|
|
||||||
omyy = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, omyy, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_MYYVEL:
|
|
||||||
if (iSet)
|
|
||||||
myyvel = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, myyvel, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_MYZ:
|
|
||||||
if (iSet)
|
|
||||||
myx = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, myx, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_OMYZ:
|
|
||||||
if (iSet)
|
|
||||||
omyz = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, omyz, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_MYZVEL:
|
|
||||||
if (iSet)
|
|
||||||
myzvel = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, myzvel, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_MYHORIZ:
|
|
||||||
if (iSet)
|
|
||||||
myhoriz = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, myhoriz, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_OMYHORIZ:
|
|
||||||
if (iSet)
|
|
||||||
omyhoriz = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, omyhoriz, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_MYHORIZOFF:
|
|
||||||
if (iSet)
|
|
||||||
myhorizoff = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, myhorizoff, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_OMYHORIZOFF:
|
|
||||||
if (iSet)
|
|
||||||
omyhorizoff = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, omyhorizoff, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_MYANG:
|
|
||||||
if (iSet)
|
|
||||||
myang = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, myang, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_OMYANG:
|
|
||||||
if (iSet)
|
|
||||||
omyang = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, omyang, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_MYCURSECTNUM:
|
|
||||||
if (iSet)
|
|
||||||
mycursectnum = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, mycursectnum, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_MYJUMPINGCOUNTER:
|
|
||||||
if (iSet)
|
|
||||||
myjumpingcounter = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, myjumpingcounter, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_MYJUMPINGTOGGLE:
|
|
||||||
if (iSet)
|
|
||||||
myjumpingtoggle = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, myjumpingtoggle, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_MYONGROUND:
|
|
||||||
if (iSet)
|
|
||||||
myonground = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, myonground, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_MYHARDLANDING:
|
|
||||||
if (iSet)
|
|
||||||
myhardlanding = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, myhardlanding, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_MYRETURNTOCENTER:
|
|
||||||
if (iSet)
|
|
||||||
myreturntocenter = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, myreturntocenter, g_i, g_p);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case USERDEFS_CAMERAX:
|
|
||||||
if (iSet)
|
|
||||||
ud.camerax = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, ud.camerax, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_CAMERAY:
|
|
||||||
if (iSet)
|
|
||||||
ud.cameray = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, ud.cameray, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_CAMERAZ:
|
|
||||||
if (iSet)
|
|
||||||
ud.cameraz = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, ud.cameraz, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_CAMERAANG:
|
|
||||||
if (iSet)
|
|
||||||
ud.cameraang = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, ud.cameraang, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_CAMERASECT:
|
|
||||||
if (iSet)
|
|
||||||
ud.camerasect = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, ud.camerasect, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case USERDEFS_CAMERAHORIZ:
|
|
||||||
if (iSet)
|
|
||||||
ud.camerahoriz = lValue;
|
|
||||||
else
|
|
||||||
SetGameVarID(lVar2, ud.camerahoriz, g_i, g_p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,6 +236,10 @@ void DumpGameVars(FILE *fp)
|
||||||
|
|
||||||
if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_PLONG))
|
if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_PLONG))
|
||||||
fprintf(fp,"%ld",*((long*)aGameVars[i].lValue));
|
fprintf(fp,"%ld",*((long*)aGameVars[i].lValue));
|
||||||
|
else if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_PSHORT))
|
||||||
|
fprintf(fp,"%d",*((short*)aGameVars[i].lValue));
|
||||||
|
else if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_PCHAR))
|
||||||
|
fprintf(fp,"%d",*((char*)aGameVars[i].lValue));
|
||||||
else
|
else
|
||||||
fprintf(fp,"%ld",aGameVars[i].lValue);
|
fprintf(fp,"%ld",aGameVars[i].lValue);
|
||||||
if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_PERPLAYER))
|
if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_PERPLAYER))
|
||||||
|
@ -247,7 +251,7 @@ void DumpGameVars(FILE *fp)
|
||||||
fprintf(fp," // ");
|
fprintf(fp," // ");
|
||||||
if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_SYSTEM))
|
if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_SYSTEM))
|
||||||
fprintf(fp," (system)");
|
fprintf(fp," (system)");
|
||||||
if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_PLONG))
|
if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_PLONG|GAMEVAR_FLAG_PSHORT|GAMEVAR_FLAG_PCHAR))
|
||||||
fprintf(fp," (pointer)");
|
fprintf(fp," (pointer)");
|
||||||
if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_READONLY))
|
if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_READONLY))
|
||||||
fprintf(fp," (read only)");
|
fprintf(fp," (read only)");
|
||||||
|
@ -295,7 +299,7 @@ int AddGameVar(const char *pszLabel, long lValue, unsigned long dwFlags)
|
||||||
if (Bstrcmp(pszLabel,aGameVars[i].szLabel) == 0)
|
if (Bstrcmp(pszLabel,aGameVars[i].szLabel) == 0)
|
||||||
{
|
{
|
||||||
// found it...
|
// found it...
|
||||||
if (aGameVars[i].dwFlags & GAMEVAR_FLAG_PLONG)
|
if (aGameVars[i].dwFlags & (GAMEVAR_FLAG_PLONG|GAMEVAR_FLAG_PSHORT|GAMEVAR_FLAG_PCHAR))
|
||||||
{
|
{
|
||||||
// warning++;
|
// warning++;
|
||||||
// initprintf("%s:%ld: warning: Internal gamevar '%s' cannot be redefined.\n",compilefile,line_number,label+(labelcnt<<6));
|
// initprintf("%s:%ld: warning: Internal gamevar '%s' cannot be redefined.\n",compilefile,line_number,label+(labelcnt<<6));
|
||||||
|
@ -470,6 +474,18 @@ long GetGameVarID(int id, int iActor, int iPlayer)
|
||||||
return(*((long*)aGameVars[id].lValue));
|
return(*((long*)aGameVars[id].lValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (aGameVars[id].dwFlags & GAMEVAR_FLAG_PSHORT)
|
||||||
|
{
|
||||||
|
if (inv) return(-(*((short*)aGameVars[id].lValue)));
|
||||||
|
return(*((short*)aGameVars[id].lValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aGameVars[id].dwFlags & GAMEVAR_FLAG_PCHAR)
|
||||||
|
{
|
||||||
|
if (inv) return(-(*((char*)aGameVars[id].lValue)));
|
||||||
|
return(*((char*)aGameVars[id].lValue));
|
||||||
|
}
|
||||||
|
|
||||||
if (inv) return(-aGameVars[id].lValue);
|
if (inv) return(-aGameVars[id].lValue);
|
||||||
return (aGameVars[id].lValue);
|
return (aGameVars[id].lValue);
|
||||||
}
|
}
|
||||||
|
@ -514,6 +530,21 @@ void SetGameVarID(int id, long lValue, int iActor, int iPlayer)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (aGameVars[id].dwFlags & GAMEVAR_FLAG_PSHORT)
|
||||||
|
{
|
||||||
|
// set the value at pointer
|
||||||
|
*((short*)aGameVars[id].lValue)=(short)lValue;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aGameVars[id].dwFlags & GAMEVAR_FLAG_PCHAR)
|
||||||
|
{
|
||||||
|
// set the value at pointer
|
||||||
|
*((char*)aGameVars[id].lValue)=(char)lValue;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
aGameVars[id].lValue=lValue;
|
aGameVars[id].lValue=lValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1123,6 +1154,35 @@ static void AddSystemVars()
|
||||||
AddGameVar("framerate",(long)&framerate, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
|
AddGameVar("framerate",(long)&framerate, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
AddGameVar("CLIPMASK0", CLIPMASK0, GAMEVAR_FLAG_SYSTEM|GAMEVAR_FLAG_READONLY);
|
AddGameVar("CLIPMASK0", CLIPMASK0, GAMEVAR_FLAG_SYSTEM|GAMEVAR_FLAG_READONLY);
|
||||||
AddGameVar("CLIPMASK1", CLIPMASK1, GAMEVAR_FLAG_SYSTEM|GAMEVAR_FLAG_READONLY);
|
AddGameVar("CLIPMASK1", CLIPMASK1, GAMEVAR_FLAG_SYSTEM|GAMEVAR_FLAG_READONLY);
|
||||||
|
|
||||||
|
AddGameVar("camerax",(long)&ud.camerax, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("cameray",(long)&ud.cameray, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("cameraz",(long)&ud.cameraz, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("cameraang",(long)&ud.cameraang, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("camerahoriz",(long)&ud.camerahoriz, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("camerasect",(long)&ud.camerasect, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
|
||||||
|
AddGameVar("myx",(long)&myx, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("myy",(long)&myy, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("myz",(long)&myz, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("omyx",(long)&omyx, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("omyy",(long)&omyy, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("omyz",(long)&omyz, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("myxvel",(long)&myxvel, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("myyvel",(long)&myyvel, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("myzvel",(long)&myzvel, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("myhoriz",(long)&myhoriz, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("myhorizoff",(long)&myhorizoff, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("omyhoriz",(long)&omyhoriz, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("omyhorizoff",(long)&omyhorizoff, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("myang",(long)&myang, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("omyang",(long)&omyang, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("mycursectnum",(long)&mycursectnum, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("myjumpingcounter",(long)&myjumpingcounter, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PSHORT | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("myjumpingtoggle",(long)&myjumpingtoggle, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PCHAR | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("myonground",(long)&myonground, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PCHAR | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("myhardlanding",(long)&myhardlanding, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PCHAR | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
|
AddGameVar("myreturntocenter",(long)&myreturntocenter, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PCHAR | GAMEVAR_FLAG_SYNCCHECK);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitGameVars(void)
|
void InitGameVars(void)
|
||||||
|
|
Loading…
Reference in a new issue