mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
Add support for cvars of type 'double', fix vid_gamma/brightness/contrast cvars, save cvars to eduke32_binds.cfg at shutdown, better method for drawing the floor textures in Mapster32 2D mode, slightly more yellow/orange lights on fire/rockets/lasers/etc
git-svn-id: https://svn.eduke32.com/eduke32@1358 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
493d621eb0
commit
f3fbf8d9a3
9 changed files with 80 additions and 386 deletions
|
@ -28,11 +28,12 @@ const char *stripcolorcodes(char *out, const char *in);
|
|||
|
||||
enum cvartypes
|
||||
{
|
||||
CVAR_FLOAT,
|
||||
CVAR_INT,
|
||||
CVAR_UNSIGNEDINT,
|
||||
CVAR_BOOL,
|
||||
CVAR_STRING,
|
||||
CVAR_FLOAT = 1,
|
||||
CVAR_INT = 2,
|
||||
CVAR_UINT = 4,
|
||||
CVAR_BOOL = 8,
|
||||
CVAR_STRING = 16,
|
||||
CVAR_DOUBLE = 32,
|
||||
CVAR_NOMULTI = 128,
|
||||
CVAR_MULTI = 256,
|
||||
CVAR_NOSAVE = 512,
|
||||
|
@ -137,7 +138,7 @@ int32_t OSD_RegisterFunction(const char *name, const char *help, int32_t (*func)
|
|||
|
||||
int32_t osdcmd_cvar_set(const osdfuncparm_t *parm);
|
||||
int32_t OSD_RegisterCvar(const cvar_t *cvar);
|
||||
void OSD_WriteCvars(const char *setupfilename);
|
||||
void OSD_WriteCvars(FILE *fp);
|
||||
|
||||
// these correspond to the Duke palettes, so they shouldn't really be here
|
||||
// ...but I don't care
|
||||
|
|
|
@ -1129,318 +1129,6 @@ char changechar(char dachar, int32_t dadir, char smooshyalign, char boundcheck)
|
|||
}
|
||||
return(dachar);
|
||||
}
|
||||
#if 0
|
||||
/*
|
||||
int32_t gettile(int32_t tilenum)
|
||||
{
|
||||
char snotbuf[80], ch;
|
||||
int32_t i, j, k, otilenum, topleft, gap, temp, tempint;
|
||||
int32_t xtiles, ytiles, tottiles;
|
||||
|
||||
if (tilenum < 0) tilenum = 0;
|
||||
|
||||
xtiles = (xdim>>6); ytiles = (ydim>>6); tottiles = xtiles*ytiles;
|
||||
otilenum = tilenum;
|
||||
|
||||
keystatus[0x2f] = 0;
|
||||
for (i=0;i<MAXTILES;i++)
|
||||
{
|
||||
localartfreq[i] = 0;
|
||||
localartlookup[i] = i;
|
||||
}
|
||||
if ((searchstat == 1) || (searchstat == 2))
|
||||
for (i=0;i<numsectors;i++)
|
||||
{
|
||||
localartfreq[sector[i].ceilingpicnum]++;
|
||||
localartfreq[sector[i].floorpicnum]++;
|
||||
}
|
||||
if (searchstat == 0)
|
||||
for (i=0;i<numwalls;i++)
|
||||
localartfreq[wall[i].picnum]++;
|
||||
if (searchstat == 4)
|
||||
for (i=0;i<numwalls;i++)
|
||||
localartfreq[wall[i].overpicnum]++;
|
||||
if (searchstat == 3)
|
||||
for (i=0;i<MAXSPRITES;i++)
|
||||
if (sprite[i].statnum < MAXSTATUS)
|
||||
localartfreq[sprite[i].picnum]++;
|
||||
gap = (MAXTILES>>1);
|
||||
do
|
||||
{
|
||||
for (i=0;i<MAXTILES-gap;i++)
|
||||
{
|
||||
temp = i;
|
||||
while ((localartfreq[temp] < localartfreq[temp+gap]) && (temp >= 0))
|
||||
{
|
||||
tempint = localartfreq[temp];
|
||||
localartfreq[temp] = localartfreq[temp+gap];
|
||||
localartfreq[temp+gap] = tempint;
|
||||
tempint = localartlookup[temp];
|
||||
localartlookup[temp] = localartlookup[temp+gap];
|
||||
localartlookup[temp+gap] = tempint;
|
||||
|
||||
if (tilenum == temp)
|
||||
tilenum = temp+gap;
|
||||
else if (tilenum == temp+gap)
|
||||
tilenum = temp;
|
||||
|
||||
temp -= gap;
|
||||
}
|
||||
}
|
||||
gap >>= 1;
|
||||
}
|
||||
while (gap > 0);
|
||||
localartlookupnum = 0;
|
||||
while (localartfreq[localartlookupnum] > 0)
|
||||
localartlookupnum++;
|
||||
|
||||
if (localartfreq[0] == 0)
|
||||
{
|
||||
tilenum = otilenum;
|
||||
localartlookupnum = MAXTILES;
|
||||
for (i=0;i<MAXTILES;i++)
|
||||
localartlookup[i] = i;
|
||||
}
|
||||
|
||||
topleft = ((tilenum/(xtiles<<gettilezoom))*(xtiles<<gettilezoom))-(xtiles<<gettilezoom);
|
||||
if (topleft < 0) topleft = 0;
|
||||
if (topleft > MAXTILES-(tottiles<<(gettilezoom<<1))) topleft = MAXTILES-(tottiles<<(gettilezoom<<1));
|
||||
while ((keystatus[0x1c]|keystatus[1]) == 0)
|
||||
{
|
||||
drawtilescreen(topleft,tilenum);
|
||||
|
||||
if (handleevents())
|
||||
{
|
||||
if (quitevent) quitevent = 0;
|
||||
}
|
||||
idle();
|
||||
|
||||
synctics = totalclock-lockclock;
|
||||
lockclock += synctics;
|
||||
|
||||
if ((keystatus[0x37] > 0) && (gettilezoom < 2))
|
||||
{
|
||||
gettilezoom++;
|
||||
topleft = ((tilenum/(xtiles<<gettilezoom))*(xtiles<<gettilezoom))-(xtiles<<gettilezoom);
|
||||
if (topleft < 0) topleft = 0;
|
||||
if (topleft > MAXTILES-(tottiles<<(gettilezoom<<1))) topleft = MAXTILES-(tottiles<<(gettilezoom<<1));
|
||||
keystatus[0x37] = 0;
|
||||
}
|
||||
if ((keystatus[0xb5] > 0) && (gettilezoom > 0))
|
||||
{
|
||||
gettilezoom--;
|
||||
topleft = ((tilenum/(xtiles<<gettilezoom))*(xtiles<<gettilezoom))-(xtiles<<gettilezoom);
|
||||
if (topleft < 0) topleft = 0;
|
||||
if (topleft > MAXTILES-(tottiles<<(gettilezoom<<1))) topleft = MAXTILES-(tottiles<<(gettilezoom<<1));
|
||||
keystatus[0xb5] = 0;
|
||||
}
|
||||
if ((keystatus[0xcb] > 0) && (tilenum > 0))
|
||||
tilenum--, keystatus[0xcb] = 0;
|
||||
if ((keystatus[0xcd] > 0) && (tilenum < MAXTILES-1))
|
||||
tilenum++, keystatus[0xcd] = 0;
|
||||
if ((keystatus[0xc8] > 0) && (tilenum >= (xtiles<<gettilezoom)))
|
||||
tilenum-=(xtiles<<gettilezoom), keystatus[0xc8] = 0;
|
||||
if ((keystatus[0xd0] > 0) && (tilenum < MAXTILES-(xtiles<<gettilezoom)))
|
||||
tilenum+=(xtiles<<gettilezoom), keystatus[0xd0] = 0;
|
||||
if ((keystatus[0xc9] > 0) && (tilenum >= (xtiles<<gettilezoom)))
|
||||
{
|
||||
tilenum-=(tottiles<<(gettilezoom<<1));
|
||||
if (tilenum < 0) tilenum = 0;
|
||||
keystatus[0xc9] = 0;
|
||||
}
|
||||
if ((keystatus[0xd1] > 0) && (tilenum < MAXTILES-(xtiles<<gettilezoom)))
|
||||
{
|
||||
tilenum+=(tottiles<<(gettilezoom<<1));
|
||||
if (tilenum >= MAXTILES) tilenum = MAXTILES-1;
|
||||
keystatus[0xd1] = 0;
|
||||
}
|
||||
if (keystatus[0x2f] > 0) //V
|
||||
{
|
||||
keystatus[0x2f] = 0;
|
||||
if (tilenum < localartlookupnum)
|
||||
tilenum = localartlookup[tilenum];
|
||||
else
|
||||
tilenum = 0;
|
||||
localartlookupnum = MAXTILES;
|
||||
for (i=0;i<MAXTILES;i++)
|
||||
localartlookup[i] = i;
|
||||
}
|
||||
if (keystatus[0x22] > 0) //G (goto)
|
||||
{
|
||||
if (tilenum < localartlookupnum) //Automatically press 'V'
|
||||
tilenum = localartlookup[tilenum];
|
||||
else
|
||||
tilenum = 0;
|
||||
localartlookupnum = MAXTILES;
|
||||
for (i=0;i<MAXTILES;i++)
|
||||
localartlookup[i] = i;
|
||||
|
||||
keystatus[0x22] = 0;
|
||||
bflushchars();
|
||||
|
||||
j = tilenum;
|
||||
while (keystatus[1] == 0)
|
||||
{
|
||||
if (handleevents())
|
||||
{
|
||||
if (quitevent) quitevent = 0;
|
||||
}
|
||||
idle();
|
||||
|
||||
ch = bgetchar();
|
||||
|
||||
//drawtilescreen(topleft,tilenum);
|
||||
Bsprintf(snotbuf,"Goto tile: %d_ ",j);
|
||||
printext256(0,0,whitecol,0,snotbuf,0);
|
||||
showframe(1);
|
||||
|
||||
if (ch >= '0' && ch <= '9')
|
||||
{
|
||||
i = (j*10)+(ch-'0');
|
||||
if (i < MAXTILES) j = i;
|
||||
}
|
||||
else if (ch == 8)
|
||||
{
|
||||
j /= 10;
|
||||
}
|
||||
else if (ch == 13)
|
||||
{
|
||||
tilenum = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
clearkeys();
|
||||
}
|
||||
while (tilenum < topleft) topleft -= (xtiles<<gettilezoom);
|
||||
while (tilenum >= topleft+(tottiles<<(gettilezoom<<1))) topleft += (xtiles<<gettilezoom);
|
||||
if (topleft < 0) topleft = 0;
|
||||
if (topleft > MAXTILES-(tottiles<<(gettilezoom<<1))) topleft = MAXTILES-(tottiles<<(gettilezoom<<1));
|
||||
}
|
||||
|
||||
if (keystatus[0x1c] == 0)
|
||||
{
|
||||
tilenum = otilenum;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tilenum < localartlookupnum)
|
||||
{
|
||||
tilenum = localartlookup[tilenum];
|
||||
if ((tilesizx[tilenum] == 0) || (tilesizy[tilenum] == 0))
|
||||
tilenum = otilenum;
|
||||
}
|
||||
else
|
||||
tilenum = otilenum;
|
||||
}
|
||||
keystatus[0x1] = 0;
|
||||
keystatus[0x1c] = 0;
|
||||
return(tilenum);
|
||||
}
|
||||
|
||||
int32_t drawtilescreen(int32_t pictopleft, int32_t picbox)
|
||||
{
|
||||
int32_t i, j, vidpos, vidpos2, dat, wallnum, xdime, ydime, cnt, pinc;
|
||||
int32_t dax, day, scaledown, xtiles, ytiles, tottiles;
|
||||
char *picptr, snotbuf[80];
|
||||
|
||||
xtiles = (xdim>>6); ytiles = (ydim>>6); tottiles = xtiles*ytiles;
|
||||
|
||||
begindrawing(); //{{{
|
||||
|
||||
setpolymost2dview(); // JBF 20040205: set to 2d rendering
|
||||
|
||||
pinc = ylookup[1];
|
||||
clearview(0L);
|
||||
for (cnt=0;cnt<(tottiles<<(gettilezoom<<1));cnt++) //draw the 5*3 grid of tiles
|
||||
{
|
||||
wallnum = cnt+pictopleft;
|
||||
if (wallnum < localartlookupnum)
|
||||
{
|
||||
wallnum = localartlookup[wallnum];
|
||||
if ((tilesizx[wallnum] != 0) && (tilesizy[wallnum] != 0))
|
||||
{
|
||||
if (waloff[wallnum] == 0) loadtile(wallnum);
|
||||
picptr = (char *)(waloff[wallnum]);
|
||||
xdime = tilesizx[wallnum];
|
||||
ydime = tilesizy[wallnum];
|
||||
|
||||
dax = ((cnt%(xtiles<<gettilezoom))<<(6-gettilezoom));
|
||||
day = ((cnt/(xtiles<<gettilezoom))<<(6-gettilezoom));
|
||||
if (polymost_drawtilescreen(dax, day, wallnum, 64>>gettilezoom, 0))
|
||||
{
|
||||
vidpos = ylookup[day]+dax+frameplace;
|
||||
if ((xdime <= (64>>gettilezoom)) && (ydime <= (64>>gettilezoom)))
|
||||
{
|
||||
for (i=0;i<xdime;i++)
|
||||
{
|
||||
vidpos2 = vidpos+i;
|
||||
for (j=0;j<ydime;j++)
|
||||
{
|
||||
*(char *)vidpos2 = *picptr++;
|
||||
vidpos2 += pinc;
|
||||
}
|
||||
}
|
||||
}
|
||||
else //if 1 dimension > 64
|
||||
{
|
||||
if (xdime > ydime)
|
||||
scaledown = ((xdime+(63>>gettilezoom))>>(6-gettilezoom));
|
||||
else
|
||||
scaledown = ((ydime+(63>>gettilezoom))>>(6-gettilezoom));
|
||||
|
||||
for (i=0;i<xdime;i+=scaledown)
|
||||
{
|
||||
if (waloff[wallnum] == 0) loadtile(wallnum);
|
||||
picptr = (char *)(waloff[wallnum]) + ydime*i;
|
||||
vidpos2 = vidpos;
|
||||
for (j=0;j<ydime;j+=scaledown)
|
||||
{
|
||||
*(char *)vidpos2 = *picptr;
|
||||
picptr += scaledown;
|
||||
vidpos2 += pinc;
|
||||
}
|
||||
vidpos++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (localartlookupnum < MAXTILES)
|
||||
{
|
||||
dax = ((cnt%(xtiles<<gettilezoom))<<(6-gettilezoom));
|
||||
day = ((cnt/(xtiles<<gettilezoom))<<(6-gettilezoom));
|
||||
Bsprintf(snotbuf,"%d",localartfreq[cnt+pictopleft]);
|
||||
printext256(dax,day,whitecol,-1,snotbuf,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cnt = picbox-pictopleft; //draw open white box
|
||||
dax = ((cnt%(xtiles<<gettilezoom))<<(6-gettilezoom));
|
||||
day = ((cnt/(xtiles<<gettilezoom))<<(6-gettilezoom));
|
||||
|
||||
for (i=0;i<(64>>gettilezoom);i++)
|
||||
{
|
||||
plotpixel(dax+i,day,whitecol);
|
||||
plotpixel(dax+i,day+(63>>gettilezoom),whitecol);
|
||||
plotpixel(dax,day+i,whitecol);
|
||||
plotpixel(dax+(63>>gettilezoom),day+i,whitecol);
|
||||
}
|
||||
|
||||
i = localartlookup[picbox];
|
||||
Bsprintf(snotbuf,"%d",i);
|
||||
printext256(0L,ydim-8,whitecol,-1,snotbuf,0);
|
||||
printext256(xdim-(Bstrlen(names[i])<<3),ydim-8,whitecol,-1,names[i],0);
|
||||
|
||||
Bsprintf(snotbuf,"%dx%d",tilesizx[i],tilesizy[i]);
|
||||
printext256(xdim>>2,ydim-8,whitecol,-1,snotbuf,0);
|
||||
|
||||
enddrawing(); //}}}
|
||||
showframe(1);
|
||||
|
||||
return(0);
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
|
||||
void overheadeditor(void)
|
||||
{
|
||||
|
@ -1636,15 +1324,12 @@ void overheadeditor(void)
|
|||
Bmemset(show2dsector, 255, sizeof(show2dsector));
|
||||
setview(0, 0, xdim-1, ydim16-1);
|
||||
yxaspect = xyaspect = 65536;
|
||||
j = ydim;
|
||||
ydim -= scale((MAXYDIM/6), ydim, MAXYDIM);
|
||||
|
||||
if (graphicsmode == 2)
|
||||
totalclocklock = totalclock;
|
||||
|
||||
drawmapview(pos.x, pos.y, zoom, 1536);
|
||||
drawmapview(pos.x, pos.y + scale((1048576/zoom), ydim, 768), zoom, 1536);
|
||||
yxaspect = i;
|
||||
ydim = j;
|
||||
xyaspect = ii;
|
||||
}
|
||||
|
||||
|
|
|
@ -620,9 +620,9 @@ void OSD_Init(void)
|
|||
{ "osdeditshade","osdeditshade: sets the shade of the OSD input text",(void *)&osdeditshade, CVAR_INT, 0, 0, 7 },
|
||||
{ "osdtextshade","osdtextshade: sets the shade of the OSD text",(void *)&osdtextshade, CVAR_INT, 0, 0, 7 },
|
||||
{ "osdpromptshade","osdpromptshade: sets the shade of the OSD prompt",(void *)&osdpromptshade, CVAR_INT, 0, -128, 127 },
|
||||
{ "logcutoff","logcutoff: sets the maximal line count of the log file",(void *)&logcutoff, CVAR_INT, 0, 0, 262144 },
|
||||
{ "osdrows","osdrows: sets the number of visible lines of the OSD",(void *)&osdrows, CVAR_INT|CVAR_FUNCPTR, 0, 0, MAXPALOOKUPS-1 },
|
||||
{ "osdtextmode","osdtextmode: set OSD text mode (0:graphical, 1:fast)",(void *)&osdtextmode, CVAR_BOOL|CVAR_FUNCPTR, 0, 0, 1 },
|
||||
{ "logcutoff","logcutoff: sets the maximal line count of the log file",(void *)&logcutoff, CVAR_INT, 0, 0, 262144 },
|
||||
};
|
||||
|
||||
Bmemset(osdtext, 32, TEXTSIZE);
|
||||
|
@ -1872,10 +1872,10 @@ int32_t osdcmd_cvar_set(const osdfuncparm_t *parm)
|
|||
OSD_Printf("Cvar \"%s\" locked in multiplayer.\n",cvars[i].name);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
else
|
||||
switch (cvars[i].type&0x7f)
|
||||
{
|
||||
case CVAR_FLOAT:
|
||||
|
||||
switch (cvars[i].type&(CVAR_FLOAT|CVAR_DOUBLE|CVAR_INT|CVAR_UINT|CVAR_BOOL|CVAR_STRING))
|
||||
{
|
||||
case CVAR_FLOAT:
|
||||
{
|
||||
float val;
|
||||
if (showval)
|
||||
|
@ -1896,9 +1896,30 @@ int32_t osdcmd_cvar_set(const osdfuncparm_t *parm)
|
|||
OSD_Printf("%s %f",cvars[i].name,val);
|
||||
}
|
||||
break;
|
||||
case CVAR_INT:
|
||||
case CVAR_UNSIGNEDINT:
|
||||
case CVAR_BOOL:
|
||||
case CVAR_DOUBLE:
|
||||
{
|
||||
double val;
|
||||
if (showval)
|
||||
{
|
||||
OSD_Printf("\"%s\" is \"%f\"\n%s\n",cvars[i].name,*(double*)cvars[i].var,(char*)cvars[i].helpstr);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
sscanf(parm->parms[0], "%lf", &val);
|
||||
|
||||
if (val < cvars[i].min || val > cvars[i].max)
|
||||
{
|
||||
OSD_Printf("%s value out of range\n",cvars[i].name);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
*(double*)cvars[i].var = val;
|
||||
if (!OSD_ParsingScript())
|
||||
OSD_Printf("%s %f",cvars[i].name,val);
|
||||
}
|
||||
break;
|
||||
case CVAR_INT:
|
||||
case CVAR_UINT:
|
||||
case CVAR_BOOL:
|
||||
{
|
||||
int32_t val;
|
||||
if (showval)
|
||||
|
@ -1908,7 +1929,7 @@ int32_t osdcmd_cvar_set(const osdfuncparm_t *parm)
|
|||
}
|
||||
|
||||
val = atoi(parm->parms[0]);
|
||||
if (cvars[i].type == CVAR_BOOL) val = val != 0;
|
||||
if (cvars[i].type & CVAR_BOOL) val = val != 0;
|
||||
|
||||
if (val < cvars[i].min || val > cvars[i].max)
|
||||
{
|
||||
|
@ -1920,7 +1941,7 @@ int32_t osdcmd_cvar_set(const osdfuncparm_t *parm)
|
|||
OSD_Printf("%s %d",cvars[i].name,val);
|
||||
}
|
||||
break;
|
||||
case CVAR_STRING:
|
||||
case CVAR_STRING:
|
||||
{
|
||||
if (showval)
|
||||
{
|
||||
|
@ -1934,41 +1955,36 @@ int32_t osdcmd_cvar_set(const osdfuncparm_t *parm)
|
|||
OSD_Printf("%s %s",cvars[i].name,(char*)cvars[i].var);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// if (cvars[i].type&CVAR_MULTI)
|
||||
// G_UpdatePlayerFromMenu();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!OSD_ParsingScript())
|
||||
OSD_Printf("\n");
|
||||
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
void OSD_WriteCvars(const char *setupfilename)
|
||||
void OSD_WriteCvars(FILE *fp)
|
||||
{
|
||||
uint32_t i;
|
||||
FILE *fp;
|
||||
char *ptr = Bstrdup(setupfilename);
|
||||
char tempbuf[128];
|
||||
|
||||
Bsprintf(tempbuf, "%s_cvars.cfg", strtok(ptr, "."));
|
||||
fp = fopen(tempbuf, "wt");
|
||||
|
||||
if (fp)
|
||||
{
|
||||
fprintf(fp,"// this file automatically generated by EDuke32\n// do not modify if you lack common sense\n");
|
||||
|
||||
for (i=0; i<osdnumcvars; i++)
|
||||
{
|
||||
if (!(cvars[i].type & CVAR_NOSAVE) && cvars[i].type != CVAR_FUNCPTR)
|
||||
switch (cvars[i].type&0x7f)
|
||||
if (!(cvars[i].type & CVAR_NOSAVE))
|
||||
switch (cvars[i].type&(CVAR_FLOAT|CVAR_DOUBLE|CVAR_INT|CVAR_UINT|CVAR_BOOL|CVAR_STRING))
|
||||
{
|
||||
case CVAR_FLOAT:
|
||||
fprintf(fp,"%s \"%f\"\n",cvars[i].name,*(float*)cvars[i].var);
|
||||
break;
|
||||
case CVAR_DOUBLE:
|
||||
fprintf(fp,"%s \"%f\"\n",cvars[i].name,*(double*)cvars[i].var);
|
||||
break;
|
||||
case CVAR_INT:
|
||||
case CVAR_UNSIGNEDINT:
|
||||
case CVAR_UINT:
|
||||
case CVAR_BOOL:
|
||||
fprintf(fp,"%s \"%d\"\n",cvars[i].name,*(int32_t *)cvars[i].var);
|
||||
break;
|
||||
|
@ -1979,15 +1995,6 @@ void OSD_WriteCvars(const char *setupfilename)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
Bsprintf(tempbuf,"Wrote %s_cvars.cfg\n",ptr);
|
||||
OSD_Printf(tempbuf);
|
||||
Bfree(ptr);
|
||||
return;
|
||||
}
|
||||
Bsprintf(tempbuf,"Error writing %s_cvars.cfg: %s\n",ptr,strerror(errno));
|
||||
OSD_Printf(tempbuf);
|
||||
Bfree(ptr);
|
||||
}
|
||||
|
||||
|
|
|
@ -598,7 +598,7 @@ static void G_MoveZombieActors(void)
|
|||
case FLOORFLAME__STATIC:
|
||||
case FIREBARREL__STATIC:
|
||||
case FIREVASE__STATIC:
|
||||
G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 4096, 255+(80<<8),PR_LIGHT_PRIO_MAX_GAME);
|
||||
G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 4096, 255+(95<<8),PR_LIGHT_PRIO_MAX_GAME);
|
||||
break;
|
||||
case ATOMICHEALTH__STATIC:
|
||||
G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 2048, 128+(128<<8)+(255<<16),PR_LIGHT_PRIO_HIGH_GAME);
|
||||
|
@ -610,7 +610,7 @@ static void G_MoveZombieActors(void)
|
|||
if (ActorExtra[i].floorz - ActorExtra[i].ceilingz < 128) break;
|
||||
if (s->z > ActorExtra[i].floorz+2048) break;
|
||||
*/
|
||||
G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 64 * s->xrepeat, 255+(80<<8),PR_LIGHT_PRIO_MAX_GAME);
|
||||
G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 64 * s->xrepeat, 255+(95<<8),PR_LIGHT_PRIO_MAX_GAME);
|
||||
break;
|
||||
case BURNING__STATIC:
|
||||
case BURNING2__STATIC:
|
||||
|
@ -618,11 +618,11 @@ static void G_MoveZombieActors(void)
|
|||
if (ActorExtra[i].floorz - ActorExtra[i].ceilingz < 128) break;
|
||||
if (s->z > ActorExtra[i].floorz + 2048) break;
|
||||
*/
|
||||
G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 64 * s->xrepeat, 255+(80<<8),PR_LIGHT_PRIO_MAX_GAME);
|
||||
G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 64 * s->xrepeat, 255+(95<<8),PR_LIGHT_PRIO_MAX_GAME);
|
||||
break;
|
||||
|
||||
case EXPLOSION2__STATIC:
|
||||
G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 4096, 255+(80<<8),PR_LIGHT_PRIO_HIGH_GAME);
|
||||
G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 4096, 255+(95<<8),PR_LIGHT_PRIO_HIGH_GAME);
|
||||
break;
|
||||
case FORCERIPPLE__STATIC:
|
||||
// case TRANSPORTERSTAR__STATIC:
|
||||
|
@ -2181,7 +2181,7 @@ CLEAR_THE_BOLT:
|
|||
case FLOORFLAME__STATIC:
|
||||
case FIREBARREL__STATIC:
|
||||
case FIREVASE__STATIC:
|
||||
G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 4096, 255+(80<<8),PR_LIGHT_PRIO_MAX_GAME);
|
||||
G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 4096, 255+(95<<8),PR_LIGHT_PRIO_MAX_GAME);
|
||||
case EXPLODINGBARREL__STATIC:
|
||||
case WOODENHORSE__STATIC:
|
||||
case HORSEONSIDE__STATIC:
|
||||
|
@ -2742,10 +2742,10 @@ static void G_MoveWeapons(void)
|
|||
G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 2048, 128+(255<<8)+(128<<16),PR_LIGHT_PRIO_HIGH_GAME);
|
||||
break;
|
||||
case FIRELASER__STATIC:
|
||||
G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 64 * s->yrepeat, 255+(80<<8),PR_LIGHT_PRIO_LOW_GAME);
|
||||
G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 64 * s->yrepeat, 255+(95<<8),PR_LIGHT_PRIO_LOW_GAME);
|
||||
break;
|
||||
case RPG__STATIC:
|
||||
G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 64 * s->yrepeat, 255+(80<<8),PR_LIGHT_PRIO_LOW_GAME);
|
||||
G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 64 * s->yrepeat, 255+(95<<8),PR_LIGHT_PRIO_LOW_GAME);
|
||||
|
||||
if (DynamicTileMap[s->picnum] == RPG__STATIC && ActorExtra[i].picnum != BOSS2 &&
|
||||
s->xrepeat >= 10 && sector[s->sectnum].lotag != 2)
|
||||
|
@ -3400,7 +3400,7 @@ static void G_MoveActors(void)
|
|||
if (ActorExtra[i].floorz - ActorExtra[i].ceilingz < 128) break;
|
||||
if (s->z > ActorExtra[i].floorz+2048) break;
|
||||
*/
|
||||
G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 64 * s->xrepeat, 255+(80<<8),PR_LIGHT_PRIO_MAX_GAME);
|
||||
G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 64 * s->xrepeat, 255+(95<<8),PR_LIGHT_PRIO_MAX_GAME);
|
||||
break;
|
||||
|
||||
case DUCK__STATIC:
|
||||
|
@ -4900,8 +4900,8 @@ static void G_MoveMisc(void) // STATNUM 5
|
|||
}
|
||||
|
||||
case FIRELASER__STATIC:
|
||||
if (s->extra != 999)
|
||||
s->extra = 999;
|
||||
if (s->extra != 5)
|
||||
s->extra = 5;
|
||||
else KILLIT(i);
|
||||
break;
|
||||
case TONGUE__STATIC:
|
||||
|
@ -5155,12 +5155,12 @@ static void G_MoveMisc(void) // STATNUM 5
|
|||
if (ActorExtra[i].floorz - ActorExtra[i].ceilingz < 128) break;
|
||||
if (s->z > ActorExtra[i].floorz + 2048) break;
|
||||
*/
|
||||
G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 64 * s->yrepeat, 255+(80<<8),PR_LIGHT_PRIO_MAX_GAME);
|
||||
G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 64 * s->yrepeat, 255+(95<<8),PR_LIGHT_PRIO_MAX_GAME);
|
||||
break;
|
||||
|
||||
case EXPLOSION2__STATIC:
|
||||
G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1),
|
||||
(512 * s->yrepeat) / (ActorExtra[i].temp_data[2]+1), 255+(80<<8),PR_LIGHT_PRIO_HIGH_GAME);
|
||||
(512 * s->yrepeat) / (ActorExtra[i].temp_data[2]+1), 255+(95<<8),PR_LIGHT_PRIO_HIGH_GAME);
|
||||
break;
|
||||
case FORCERIPPLE__STATIC:
|
||||
// case TRANSPORTERSTAR__STATIC:
|
||||
|
|
|
@ -982,7 +982,11 @@ void CONFIG_WriteBinds(void) // save binds and aliases to <cfgname>_binds.cfg
|
|||
if (fp)
|
||||
{
|
||||
symbol_t *symb;
|
||||
fprintf(fp,"// this file automatically generated by EDuke32\n// do not modify if you lack common sense\n");
|
||||
|
||||
fprintf(fp,"// this file automatically generated by EDuke32\n");
|
||||
fprintf(fp,"// these settings take precedence over your main cfg file\n");
|
||||
fprintf(fp,"// do not modify if you lack common sense\n");
|
||||
|
||||
for (i=0; i<MAXBOUNDKEYS; i++)
|
||||
if (KeyBindings[i].cmd[0] && KeyBindings[i].key)
|
||||
fprintf(fp,"bind \"%s\"%s \"%s\"\n",KeyBindings[i].key,KeyBindings[i].repeat?"":" norepeat",KeyBindings[i].cmd);
|
||||
|
@ -999,6 +1003,7 @@ void CONFIG_WriteBinds(void) // save binds and aliases to <cfgname>_binds.cfg
|
|||
if (!(cvar[i].type&CVAR_NOSAVE))
|
||||
fprintf(fp,"%s \"%d\"\n",cvar[i].name,*(int32_t*)cvar[i].var);
|
||||
*/
|
||||
OSD_WriteCvars(fp);
|
||||
fclose(fp);
|
||||
Bsprintf(tempbuf,"Wrote %s_binds.cfg\n",ptr);
|
||||
OSD_Printf(tempbuf);
|
||||
|
@ -1263,7 +1268,6 @@ void CONFIG_WriteSetup(void)
|
|||
SCRIPT_Free(ud.config.scripthandle);
|
||||
OSD_Printf("Wrote %s\n",setupfilename);
|
||||
CONFIG_WriteBinds();
|
||||
OSD_WriteCvars(setupfilename);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -5535,7 +5535,7 @@ int32_t A_Spawn(int32_t j, int32_t pn)
|
|||
break;
|
||||
|
||||
case EXPLOSION2__STATIC:
|
||||
G_AddGameLight(0, sp->sectnum, sp->x, sp->y, sp->z-((sp->yrepeat*tilesizy[sp->picnum])<<1), 8192, 255+(80<<8),PR_LIGHT_PRIO_MAX_GAME);
|
||||
G_AddGameLight(0, sp->sectnum, sp->x, sp->y, sp->z-((sp->yrepeat*tilesizy[sp->picnum])<<1), 8192, 255+(95<<8),PR_LIGHT_PRIO_MAX_GAME);
|
||||
case EXPLOSION2BOT__STATIC:
|
||||
case BURNING__STATIC:
|
||||
case BURNING2__STATIC:
|
||||
|
@ -11525,8 +11525,6 @@ CLEAN_DIRECTORY:
|
|||
char *ptr = Bstrdup(setupfilename), *p = strtok(ptr,".");
|
||||
Bsprintf(tempbuf,"%s_binds.cfg",p);
|
||||
OSD_Exec(tempbuf);
|
||||
Bsprintf(tempbuf,"%s_cvars.cfg",p);
|
||||
OSD_Exec(tempbuf);
|
||||
Bfree(ptr);
|
||||
}
|
||||
|
||||
|
|
|
@ -1096,7 +1096,7 @@ static void Gv_AddSystemVars(void)
|
|||
Bsprintf(aszBuf,"WEAPON%d_SELECTSOUND",PISTOL_WEAPON);
|
||||
Gv_NewVar(aszBuf, INSERT_CLIP, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_FLASHCOLOR",PISTOL_WEAPON);
|
||||
Gv_NewVar(aszBuf, 255+(80<<8), GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
|
||||
Gv_NewVar(aszBuf, 255+(95<<8), GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
|
||||
|
||||
/////////////////////////////
|
||||
Bsprintf(aszBuf,"WEAPON%d_WORKSLIKE",SHOTGUN_WEAPON);
|
||||
|
@ -1136,7 +1136,7 @@ static void Gv_AddSystemVars(void)
|
|||
Bsprintf(aszBuf,"WEAPON%d_SELECTSOUND",SHOTGUN_WEAPON);
|
||||
Gv_NewVar(aszBuf, SHOTGUN_COCK, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_FLASHCOLOR",SHOTGUN_WEAPON);
|
||||
Gv_NewVar(aszBuf, 255+(80<<8), GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
|
||||
Gv_NewVar(aszBuf, 255+(95<<8), GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
|
||||
|
||||
/////////////////////////////
|
||||
Bsprintf(aszBuf,"WEAPON%d_WORKSLIKE",CHAINGUN_WEAPON);
|
||||
|
@ -1176,7 +1176,7 @@ static void Gv_AddSystemVars(void)
|
|||
Bsprintf(aszBuf,"WEAPON%d_SELECTSOUND",CHAINGUN_WEAPON);
|
||||
Gv_NewVar(aszBuf, SELECT_WEAPON, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_FLASHCOLOR",CHAINGUN_WEAPON);
|
||||
Gv_NewVar(aszBuf, 255+(80<<8), GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
|
||||
Gv_NewVar(aszBuf, 255+(95<<8), GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
|
||||
|
||||
/////////////////////////////
|
||||
Bsprintf(aszBuf,"WEAPON%d_WORKSLIKE",RPG_WEAPON);
|
||||
|
@ -1216,7 +1216,7 @@ static void Gv_AddSystemVars(void)
|
|||
Bsprintf(aszBuf,"WEAPON%d_SELECTSOUND",RPG_WEAPON);
|
||||
Gv_NewVar(aszBuf, SELECT_WEAPON, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_FLASHCOLOR",RPG_WEAPON);
|
||||
Gv_NewVar(aszBuf, 255+(80<<8), GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
|
||||
Gv_NewVar(aszBuf, 255+(95<<8), GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
|
||||
|
||||
/////////////////////////////
|
||||
Bsprintf(aszBuf,"WEAPON%d_WORKSLIKE",HANDBOMB_WEAPON);
|
||||
|
@ -1336,7 +1336,7 @@ static void Gv_AddSystemVars(void)
|
|||
Bsprintf(aszBuf,"WEAPON%d_SELECTSOUND",DEVISTATOR_WEAPON);
|
||||
Gv_NewVar(aszBuf, SELECT_WEAPON, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_FLASHCOLOR",DEVISTATOR_WEAPON);
|
||||
Gv_NewVar(aszBuf, 255+(80<<8), GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
|
||||
Gv_NewVar(aszBuf, 255+(95<<8), GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
|
||||
|
||||
/////////////////////////////
|
||||
Bsprintf(aszBuf,"WEAPON%d_WORKSLIKE",TRIPBOMB_WEAPON);
|
||||
|
@ -1496,7 +1496,7 @@ static void Gv_AddSystemVars(void)
|
|||
Bsprintf(aszBuf,"WEAPON%d_SELECTSOUND",GROW_WEAPON);
|
||||
Gv_NewVar(aszBuf, SELECT_WEAPON, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
|
||||
Bsprintf(aszBuf,"WEAPON%d_FLASHCOLOR",GROW_WEAPON);
|
||||
Gv_NewVar(aszBuf, 255+(80<<8), GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
|
||||
Gv_NewVar(aszBuf, 255+(95<<8), GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
|
||||
|
||||
Gv_NewVar("GRENADE_LIFETIME", NAM_GRENADE_LIFETIME, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
|
||||
Gv_NewVar("GRENADE_LIFETIME_VAR", NAM_GRENADE_LIFETIME_VAR, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM);
|
||||
|
|
|
@ -1310,9 +1310,9 @@ int32_t registerosdcommands(void)
|
|||
{ "snd_numchannels", "snd_numchannels: the number of sound channels", (void*)&ud.config.NumChannels, CVAR_INT, 0, 0, 2 },
|
||||
{ "snd_numvoices", "snd_numvoices: the number of concurrent sounds", (void*)&ud.config.NumVoices, CVAR_INT, 0, 0, 32 },
|
||||
{ "snd_reversestereo", "snd_reversestereo: reverses the stereo channels", (void*)&ud.config.ReverseStereo, CVAR_BOOL, 0, 0, 16 },
|
||||
{ "vid_gamma","vid_gamma <gamma>: adjusts gamma ramp",(void*)&vid_gamma, CVAR_FLOAT|CVAR_FUNCPTR, 0, 0, 10 },
|
||||
{ "vid_contrast","vid_contrast <gamma>: adjusts gamma ramp",(void*)&vid_contrast, CVAR_FLOAT|CVAR_FUNCPTR, 0, 0, 10 },
|
||||
{ "vid_brightness","vid_brightness <gamma>: adjusts gamma ramp",(void*)&vid_brightness, CVAR_FLOAT|CVAR_FUNCPTR, 0, 0, 10 },
|
||||
{ "vid_gamma","vid_gamma <gamma>: adjusts gamma ramp",(void*)&vid_gamma, CVAR_DOUBLE|CVAR_FUNCPTR, 0, 0, 10 },
|
||||
{ "vid_contrast","vid_contrast <gamma>: adjusts gamma ramp",(void*)&vid_contrast, CVAR_DOUBLE|CVAR_FUNCPTR, 0, 0, 10 },
|
||||
{ "vid_brightness","vid_brightness <gamma>: adjusts gamma ramp",(void*)&vid_brightness, CVAR_DOUBLE|CVAR_FUNCPTR, 0, 0, 10 },
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -70,7 +70,6 @@ static void P_IncurDamage(DukePlayer_t *p)
|
|||
X_OnEvent(EVENT_INCURDAMAGE, p->i, sprite[p->i].yvel, -1);
|
||||
|
||||
if (aGameVars[g_iReturnVarID].val.lValue == 0)
|
||||
|
||||
{
|
||||
sprite[p->i].extra -= p->extra_extra8>>8;
|
||||
|
||||
|
@ -355,7 +354,7 @@ int32_t A_Shoot(int32_t i,int32_t atwith)
|
|||
case RPG__STATIC:
|
||||
case MORTER__STATIC:
|
||||
G_AddGameLight(0, s->sectnum, s->x+((sintable[(s->ang+512)&2047])>>7),
|
||||
s->y+((sintable[(s->ang)&2047])>>7), s->z-PHEIGHT, 8192, 255+(80<<8),PR_LIGHT_PRIO_MAX_GAME);
|
||||
s->y+((sintable[(s->ang)&2047])>>7), s->z-PHEIGHT, 8192, 255+(95<<8),PR_LIGHT_PRIO_MAX_GAME);
|
||||
|
||||
gamelights[gamelightcount&(PR_MAXLIGHTS-1)].sector = s->sectnum;
|
||||
gamelights[gamelightcount&(PR_MAXLIGHTS-1)].x = s->x+((sintable[(s->ang+512)&2047])>>4);
|
||||
|
|
Loading…
Reference in a new issue