git-svn-id: https://svn.eduke32.com/eduke32@882 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2008-07-21 10:20:41 +00:00
parent 86e70d3012
commit bdd109e2c1
4 changed files with 73 additions and 31 deletions

View file

@ -546,6 +546,7 @@ extern int r_vbocount;
extern int r_animsmoothing;
extern int r_parallaxskyclamping;
extern int r_parallaxskypanning;
extern int r_cullobstructedmodels;
extern int mdtims, omdtims;
#endif

View file

@ -176,6 +176,7 @@ int r_parallaxskypanning = 0;
// line of sight checks before mddraw()
int r_cullobstructedmodels = 0;
#define CULL_DELAY 5
static float fogresult, fogcol[4];
@ -4416,6 +4417,9 @@ void polymost_drawmaskwall(int damaskwallcnt)
drawpoly(dpx,dpy,n,method);
}
int lastcullcheck[MAXSPRITES];
char cullmodel[MAXSPRITES];
void polymost_drawsprite(int snum)
{
double px[6], py[6];
@ -4473,44 +4477,79 @@ void polymost_drawsprite(int snum)
{
if (r_cullobstructedmodels)
{
i = 0;
do // this is so gay
{
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x, tspr->y, tspr->z, tspr->sectnum))
{ i++; break; }
if (cansee(globalposx, globalposy, globalposz+6144, globalcursectnum, tspr->x, tspr->y, tspr->z, tspr->sectnum))
{ i++; break; }
if (cansee(globalposx, globalposy, globalposz-6144, globalcursectnum, tspr->x, tspr->y, tspr->z, tspr->sectnum))
{ i++; break; }
if (cansee(globalposx, globalposy, sector[globalcursectnum].ceilingz, globalcursectnum, tspr->x, tspr->y, tspr->z, tspr->sectnum))
{ i++; break; }
if (cansee(globalposx, globalposy, sector[globalcursectnum].floorz, globalcursectnum, tspr->x, tspr->y, tspr->z, tspr->sectnum))
{ i++; break; }
if (totalclock < lastcullcheck[tspr->owner])
break;
if (cansee(globalposx, globalposy, sector[globalcursectnum].ceilingz,
globalcursectnum, tspr->x, tspr->y, tspr->z, tspr->sectnum))
{ cullmodel[tspr->owner] = 0; break; }
if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
tspr->x, tspr->y, tspr->z, tspr->sectnum))
{ cullmodel[tspr->owner] = 0; break; }
if (cansee(globalposx, globalposy, sector[globalcursectnum].floorz,
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);
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x+384, tspr->y, sector[datempsectnum].ceilingz, datempsectnum))
{ i++; break; }
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x+384, tspr->y, sector[datempsectnum].floorz, datempsectnum))
{ i++; break; }
if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
tspr->x+384, tspr->y, sector[datempsectnum].floorz, datempsectnum))
{ cullmodel[tspr->owner] = 0; 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);
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x-384, tspr->y, sector[datempsectnum].ceilingz, datempsectnum))
{ i++; break; }
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x-384, tspr->y, sector[datempsectnum].floorz, datempsectnum))
{ i++; break; }
if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
tspr->x-384, tspr->y, sector[datempsectnum].floorz, datempsectnum))
{ cullmodel[tspr->owner] = 0; 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);
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x, tspr->y+384, sector[datempsectnum].ceilingz, datempsectnum))
{ i++; break; }
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x, tspr->y+384, sector[datempsectnum].floorz, datempsectnum))
{ i++; break; }
if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
tspr->x, tspr->y+384, sector[datempsectnum].floorz, datempsectnum))
{ cullmodel[tspr->owner] = 0; 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);
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x, tspr->y-384, sector[datempsectnum].ceilingz, datempsectnum))
{ i++; break; }
if (cansee(globalposx, globalposy, globalposz, globalcursectnum, tspr->x, tspr->y-384, sector[datempsectnum].floorz, datempsectnum))
{ i++; break; }
if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
tspr->x, tspr->y-384, sector[datempsectnum].floorz, datempsectnum))
{ cullmodel[tspr->owner] = 0; 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;
} 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
}
if (usevoxels && (tspr->cstat&48)!=48 && tiletovox[tspr->picnum] >= 0 && voxmodels[ tiletovox[tspr->picnum] ])

View file

@ -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", "GLParallaxSkyPanning", &r_parallaxskypanning);
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "GLCullObstructedModels", &r_cullobstructedmodels);
dummy = usemodels;
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "UseModels",&dummy);
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", "GLParallaxSkyPanning",r_parallaxskypanning,false,false);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLCullObstructedModels", r_cullobstructedmodels,false,false);
#endif
#ifdef RENDERTYPEWIN
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "MaxRefreshFreq",maxrefreshfreq,false,false);

View file

@ -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
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);
}
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);
x += OSDCHAR_WIDTH;
}