mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
git-svn-id: https://svn.eduke32.com/eduke32@882 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
86e70d3012
commit
bdd109e2c1
4 changed files with 73 additions and 31 deletions
|
@ -546,6 +546,7 @@ extern int r_vbocount;
|
||||||
extern int r_animsmoothing;
|
extern int r_animsmoothing;
|
||||||
extern int r_parallaxskyclamping;
|
extern int r_parallaxskyclamping;
|
||||||
extern int r_parallaxskypanning;
|
extern int r_parallaxskypanning;
|
||||||
|
extern int r_cullobstructedmodels;
|
||||||
extern int mdtims, omdtims;
|
extern int mdtims, omdtims;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -176,6 +176,7 @@ int r_parallaxskypanning = 0;
|
||||||
|
|
||||||
// line of sight checks before mddraw()
|
// line of sight checks before mddraw()
|
||||||
int r_cullobstructedmodels = 0;
|
int r_cullobstructedmodels = 0;
|
||||||
|
#define CULL_DELAY 5
|
||||||
|
|
||||||
static float fogresult, fogcol[4];
|
static float fogresult, fogcol[4];
|
||||||
|
|
||||||
|
@ -4416,6 +4417,9 @@ void polymost_drawmaskwall(int damaskwallcnt)
|
||||||
drawpoly(dpx,dpy,n,method);
|
drawpoly(dpx,dpy,n,method);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int lastcullcheck[MAXSPRITES];
|
||||||
|
char cullmodel[MAXSPRITES];
|
||||||
|
|
||||||
void polymost_drawsprite(int snum)
|
void polymost_drawsprite(int snum)
|
||||||
{
|
{
|
||||||
double px[6], py[6];
|
double px[6], py[6];
|
||||||
|
@ -4473,44 +4477,79 @@ void polymost_drawsprite(int snum)
|
||||||
{
|
{
|
||||||
if (r_cullobstructedmodels)
|
if (r_cullobstructedmodels)
|
||||||
{
|
{
|
||||||
i = 0;
|
|
||||||
do // this is so gay
|
do // this is so gay
|
||||||
{
|
{
|
||||||
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x, tspr->y, tspr->z, tspr->sectnum))
|
if (totalclock < lastcullcheck[tspr->owner])
|
||||||
{ i++; break; }
|
break;
|
||||||
if (cansee(globalposx, globalposy, globalposz+6144, globalcursectnum, tspr->x, tspr->y, tspr->z, tspr->sectnum))
|
if (cansee(globalposx, globalposy, sector[globalcursectnum].ceilingz,
|
||||||
{ i++; break; }
|
globalcursectnum, tspr->x, tspr->y, tspr->z, tspr->sectnum))
|
||||||
if (cansee(globalposx, globalposy, globalposz-6144, globalcursectnum, tspr->x, tspr->y, tspr->z, tspr->sectnum))
|
{ cullmodel[tspr->owner] = 0; break; }
|
||||||
{ i++; break; }
|
if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
|
||||||
if (cansee(globalposx, globalposy, sector[globalcursectnum].ceilingz, globalcursectnum, tspr->x, tspr->y, tspr->z, tspr->sectnum))
|
tspr->x, tspr->y, tspr->z, tspr->sectnum))
|
||||||
{ i++; break; }
|
{ cullmodel[tspr->owner] = 0; break; }
|
||||||
if (cansee(globalposx, globalposy, sector[globalcursectnum].floorz, globalcursectnum, tspr->x, tspr->y, tspr->z, tspr->sectnum))
|
if (cansee(globalposx, globalposy, sector[globalcursectnum].floorz,
|
||||||
{ i++; break; }
|
globalcursectnum, tspr->x, tspr->y, tspr->z, tspr->sectnum))
|
||||||
|
{ cullmodel[tspr->owner] = 0; break; }
|
||||||
|
|
||||||
|
if (cansee(globalposx, globalposy, globalposz+6144, globalcursectnum,
|
||||||
|
tspr->x, tspr->y, tspr->z, tspr->sectnum))
|
||||||
|
{ cullmodel[tspr->owner] = 0; break; }
|
||||||
|
if (cansee(globalposx, globalposy, globalposz-6144, globalcursectnum,
|
||||||
|
tspr->x, tspr->y, tspr->z, tspr->sectnum))
|
||||||
|
{ cullmodel[tspr->owner] = 0; break; }
|
||||||
|
|
||||||
updatesector(tspr->x+384,tspr->y,&datempsectnum);
|
updatesector(tspr->x+384,tspr->y,&datempsectnum);
|
||||||
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x+384, tspr->y, sector[datempsectnum].ceilingz, datempsectnum))
|
if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
|
||||||
{ i++; break; }
|
tspr->x+384, tspr->y, sector[datempsectnum].floorz, datempsectnum))
|
||||||
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x+384, tspr->y, sector[datempsectnum].floorz, datempsectnum))
|
{ cullmodel[tspr->owner] = 0; break; }
|
||||||
{ i++; break; }
|
if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
|
||||||
|
tspr->x+384, tspr->y, sector[datempsectnum].ceilingz, datempsectnum))
|
||||||
|
{ cullmodel[tspr->owner] = 0; break; }
|
||||||
|
if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
|
||||||
|
tspr->x+384, tspr->y, tspr->z, datempsectnum))
|
||||||
|
{ cullmodel[tspr->owner] = 0; break; }
|
||||||
|
|
||||||
updatesector(tspr->x-384,tspr->y,&datempsectnum);
|
updatesector(tspr->x-384,tspr->y,&datempsectnum);
|
||||||
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x-384, tspr->y, sector[datempsectnum].ceilingz, datempsectnum))
|
if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
|
||||||
{ i++; break; }
|
tspr->x-384, tspr->y, sector[datempsectnum].floorz, datempsectnum))
|
||||||
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x-384, tspr->y, sector[datempsectnum].floorz, datempsectnum))
|
{ cullmodel[tspr->owner] = 0; break; }
|
||||||
{ i++; break; }
|
if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
|
||||||
|
tspr->x-384, tspr->y, sector[datempsectnum].ceilingz, datempsectnum))
|
||||||
|
{ cullmodel[tspr->owner] = 0; break; }
|
||||||
|
if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
|
||||||
|
tspr->x-384, tspr->y, tspr->z, datempsectnum))
|
||||||
|
{ cullmodel[tspr->owner] = 0; break; }
|
||||||
|
|
||||||
updatesector(tspr->x,tspr->y+384,&datempsectnum);
|
updatesector(tspr->x,tspr->y+384,&datempsectnum);
|
||||||
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x, tspr->y+384, sector[datempsectnum].ceilingz, datempsectnum))
|
if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
|
||||||
{ i++; break; }
|
tspr->x, tspr->y+384, sector[datempsectnum].floorz, datempsectnum))
|
||||||
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x, tspr->y+384, sector[datempsectnum].floorz, datempsectnum))
|
{ cullmodel[tspr->owner] = 0; break; }
|
||||||
{ i++; break; }
|
if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
|
||||||
|
tspr->x, tspr->y+384, sector[datempsectnum].ceilingz, datempsectnum))
|
||||||
|
{ cullmodel[tspr->owner] = 0; break; }
|
||||||
|
if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
|
||||||
|
tspr->x, tspr->y+384, tspr->z, datempsectnum))
|
||||||
|
{ cullmodel[tspr->owner] = 0; break; }
|
||||||
|
|
||||||
updatesector(tspr->x,tspr->y-384,&datempsectnum);
|
updatesector(tspr->x,tspr->y-384,&datempsectnum);
|
||||||
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x, tspr->y-384, sector[datempsectnum].ceilingz, datempsectnum))
|
if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
|
||||||
{ i++; break; }
|
tspr->x, tspr->y-384, sector[datempsectnum].floorz, datempsectnum))
|
||||||
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x, tspr->y-384, sector[datempsectnum].floorz, datempsectnum))
|
{ cullmodel[tspr->owner] = 0; break; }
|
||||||
{ i++; break; }
|
if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
|
||||||
|
tspr->x, tspr->y-384, sector[datempsectnum].ceilingz, datempsectnum))
|
||||||
|
{ cullmodel[tspr->owner] = 0; break; }
|
||||||
|
if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
|
||||||
|
tspr->x, tspr->y-384, tspr->z, datempsectnum))
|
||||||
|
{ cullmodel[tspr->owner] = 0; break; }
|
||||||
|
cullmodel[tspr->owner] = 1;
|
||||||
break;
|
break;
|
||||||
} while (1);
|
} while (1);
|
||||||
} else i = 1;
|
if (totalclock > lastcullcheck[tspr->owner])
|
||||||
|
lastcullcheck[tspr->owner] = totalclock + CULL_DELAY;
|
||||||
|
}
|
||||||
|
else cullmodel[tspr->owner] = 0;
|
||||||
|
|
||||||
if (i && mddraw(tspr)) return;
|
if (!cullmodel[tspr->owner] && mddraw(tspr)) return;
|
||||||
break; // else, render as flat sprite
|
break; // else, render as flat sprite
|
||||||
}
|
}
|
||||||
if (usevoxels && (tspr->cstat&48)!=48 && tiletovox[tspr->picnum] >= 0 && voxmodels[ tiletovox[tspr->picnum] ])
|
if (usevoxels && (tspr->cstat&48)!=48 && tiletovox[tspr->picnum] >= 0 && voxmodels[ tiletovox[tspr->picnum] ])
|
||||||
|
|
|
@ -695,6 +695,7 @@ int32 CONFIG_ReadSetup(void)
|
||||||
|
|
||||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyClamping", &r_parallaxskyclamping);
|
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyClamping", &r_parallaxskyclamping);
|
||||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyPanning", &r_parallaxskypanning);
|
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyPanning", &r_parallaxskypanning);
|
||||||
|
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLCullObstructedModels", &r_cullobstructedmodels);
|
||||||
dummy = usemodels;
|
dummy = usemodels;
|
||||||
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "UseModels",&dummy);
|
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "UseModels",&dummy);
|
||||||
usemodels = dummy != 0;
|
usemodels = dummy != 0;
|
||||||
|
@ -903,6 +904,7 @@ void CONFIG_WriteSetup(void)
|
||||||
|
|
||||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyClamping",r_parallaxskyclamping,false,false);
|
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyClamping",r_parallaxskyclamping,false,false);
|
||||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyPanning",r_parallaxskypanning,false,false);
|
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyPanning",r_parallaxskypanning,false,false);
|
||||||
|
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLCullObstructedModels", r_cullobstructedmodels,false,false);
|
||||||
#endif
|
#endif
|
||||||
#ifdef RENDERTYPEWIN
|
#ifdef RENDERTYPEWIN
|
||||||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "MaxRefreshFreq",maxrefreshfreq,false,false);
|
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "MaxRefreshFreq",maxrefreshfreq,false,false);
|
||||||
|
|
|
@ -33,11 +33,11 @@ void GAME_drawosdstr(int x, int y, char *ch, int len, int shade, int pal)
|
||||||
// use the format byte if the text falls within the bounds of the console buffer
|
// use the format byte if the text falls within the bounds of the console buffer
|
||||||
if (ch > ptr && ch < (ptr + TEXTSIZE))
|
if (ch > ptr && ch < (ptr + TEXTSIZE))
|
||||||
{
|
{
|
||||||
rotatesprite(x<<16, (y<<3)<<16, 65536l, 0, ac, (*(ch-ptr+fmt)&~0x1F)>>4,
|
rotatesprite(x<<16, (y<<3)<<16, 65536, 0, ac, (*(ch-ptr+fmt)&~0x1F)>>4,
|
||||||
*(ch-ptr+fmt)&~0xE0, 8|16, 0, 0, xdim-1, ydim-1);
|
*(ch-ptr+fmt)&~0xE0, 8|16, 0, 0, xdim-1, ydim-1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
rotatesprite(x<<16, (y<<3)<<16, 65536l, 0, ac, shade,
|
rotatesprite(x<<16, (y<<3)<<16, 65536, 0, ac, shade,
|
||||||
pal, 8|16, 0, 0, xdim-1, ydim-1);
|
pal, 8|16, 0, 0, xdim-1, ydim-1);
|
||||||
x += OSDCHAR_WIDTH;
|
x += OSDCHAR_WIDTH;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue