kill polyobjects ifdef
This commit is contained in:
1 parent
5d2b213f76
commit
0a62fd11a0
8 files changed
+3
-175
No files matched your search
@@ -578,9 +578,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
||||
/// Dumps the contents of a network save game upon consistency failure for debugging.
|
||||
//#define DUMPCONSISTENCY
|
||||
|
||||
/// Polyobject fake flat code
|
||||
#define POLYOBJECTS_PLANES
|
||||
|
||||
/// See name of player in your crosshair
|
||||
#define SEENAMES
|
||||
|
||||
|
||||
@@ -809,12 +809,10 @@ static void AdjustSegs(void)
|
||||
float distv1,distv2,tmp;
|
||||
nearv1 = nearv2 = MYMAX;
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// Don't touch polyobject segs. We'll compensate
|
||||
// for this when we go about drawing them.
|
||||
if (lseg->polyseg)
|
||||
continue;
|
||||
#endif
|
||||
|
||||
if (p) {
|
||||
for (j = 0; j < p->numpts; j++)
|
||||
|
||||
+1
-18
@@ -1756,7 +1756,6 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
// heights of the polygon, and h & l, are the final (clipped)
|
||||
// poly coords.
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// NOTE: With polyobjects, whenever you need to check the properties of the polyobject sector it belongs to,
|
||||
// you must use the linedef's backsector to be correct
|
||||
// From CB
|
||||
@@ -1766,7 +1765,6 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
popenbottom = popenbottomslope = back->floorheight;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
popentop = min(worldtop, worldhigh);
|
||||
popenbottom = max(worldbottom, worldlow);
|
||||
@@ -1809,7 +1807,6 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
}
|
||||
|
||||
// CB
|
||||
#ifdef POLYOBJECTS
|
||||
// NOTE: With polyobjects, whenever you need to check the properties of the polyobject sector it belongs to,
|
||||
// you must use the linedef's backsector to be correct
|
||||
if (gr_curline->polyseg)
|
||||
@@ -1819,7 +1816,6 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
lowcutslope = polybottomslope;
|
||||
highcutslope = polytopslope;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
// The cut-off values of a linedef can always be constant, since every line has an absoulute front and or back sector
|
||||
@@ -1986,7 +1982,6 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
if (gr_curline->polyseg && gr_curline->polyseg->translucency > 0)
|
||||
{
|
||||
if (gr_curline->polyseg->translucency >= NUMTRANSMAPS) // wall not drawn
|
||||
@@ -1997,7 +1992,6 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
else
|
||||
blendmode = HWR_TranstableToAlpha(gr_curline->polyseg->translucency, &Surf);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Render midtextures on two-sided lines with a z-buffer offset.
|
||||
// This will cause the midtexture appear on top, if a FOF overlaps with it.
|
||||
@@ -2625,10 +2619,9 @@ void HWR_AddLine(seg_t *line)
|
||||
fixed_t v1x, v1y, v2x, v2y; // the seg's vertexes as fixed_t
|
||||
|
||||
boolean dont_draw = false;
|
||||
#ifdef POLYOBJECTS
|
||||
|
||||
if (line->polyseg && !(line->polyseg->flags & POF_RENDERSIDES))
|
||||
return;
|
||||
#endif
|
||||
|
||||
gr_curline = line;
|
||||
|
||||
@@ -2872,7 +2865,6 @@ boolean HWR_CheckBBox(fixed_t *bspcoord)
|
||||
return gld_clipper_SafeCheckRange(angle2, angle1);
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
|
||||
//
|
||||
// HWR_AddPolyObjectSegs
|
||||
@@ -2911,7 +2903,6 @@ void HWR_AddPolyObjectSegs(void)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling, fixed_t fixedheight, FBITFIELD blendmode, UINT8 lightlevel, lumpnum_t lumpnum, sector_t *FOFsector, UINT8 alpha, extracolormap_t *planecolormap)
|
||||
{
|
||||
float height; //constant y for all points on the convex flat polygon
|
||||
@@ -3144,8 +3135,6 @@ void HWR_AddPolyObjectPlanes(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
@@ -3440,7 +3429,6 @@ void HWR_Subsector(size_t num)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// Draw all the polyobjects in this subsector
|
||||
if (sub->polyList)
|
||||
{
|
||||
@@ -3464,15 +3452,12 @@ void HWR_Subsector(size_t num)
|
||||
// Draw polyobject lines.
|
||||
HWR_AddPolyObjectSegs();
|
||||
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
if (sub->validcount != validcount) // This validcount situation seems to let us know that the floors have already been drawn.
|
||||
{
|
||||
// Draw polyobject planes
|
||||
HWR_AddPolyObjectPlanes();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
skip_stuff_for_portals:
|
||||
|
||||
@@ -3497,9 +3482,7 @@ skip_stuff_for_portals:
|
||||
|
||||
while (count--)
|
||||
{
|
||||
#ifdef POLYOBJECTS
|
||||
if (!line->polyseg) // ignore segs that belong to polyobjects
|
||||
#endif
|
||||
HWR_AddLine(line);
|
||||
line++;
|
||||
}
|
||||
|
||||
@@ -121,13 +121,9 @@ void HWR_DrawScreenFinalTexture(INT32 width, INT32 height);
|
||||
void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, boolean isceiling, fixed_t fixedheight, FBITFIELD PolyFlags, INT32 lightlevel, lumpnum_t lumpnum, sector_t *FOFsector, UINT8 alpha, extracolormap_t *planecolormap);
|
||||
void HWR_AddTransparentFloor(lumpnum_t lumpnum, extrasubsector_t *xsub, boolean isceiling, fixed_t fixedheight, INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, boolean fogplane, extracolormap_t *planecolormap);
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling, fixed_t fixedheight, FBITFIELD blendmode, UINT8 lightlevel, lumpnum_t lumpnum, sector_t *FOFsector, UINT8 alpha, extracolormap_t *planecolormap);
|
||||
void HWR_AddPolyObjectPlanes(void);
|
||||
void HWR_AddTransparentPolyobjectFloor(lumpnum_t lumpnum, polyobj_t *polysector, boolean isceiling, fixed_t fixedheight, INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, extracolormap_t *planecolormap);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// hw_main.c: Segs
|
||||
void HWR_ProcessSeg(void); // Sort of like GLWall::Process in GZDoom
|
||||
@@ -138,9 +134,7 @@ void HWR_AddTransparentWall(FOutVector *wallVerts, FSurfaceInfo * pSurf, INT32 t
|
||||
void HWR_DrawSkyWall(FOutVector *wallVerts, FSurfaceInfo *Surf);
|
||||
void HWR_DrawSkyBackground(float fpov);
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
void HWR_AddPolyObjectSegs(void);
|
||||
#endif
|
||||
|
||||
// hw_main.c: BSP
|
||||
void HWR_RenderBSPNode(INT32 bspnum);
|
||||
|
||||
@@ -546,22 +546,6 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
||||
texheight = textures[texnum]->height << FRACBITS;
|
||||
|
||||
// Set texbottom and textop to the Z coordinates of the texture's boundaries
|
||||
#if 0 // #ifdef POLYOBJECTS
|
||||
// don't remove this code unless solid midtextures
|
||||
// on non-solid polyobjects should NEVER happen in the future
|
||||
if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT)) {
|
||||
if (linedef->flags & ML_EFFECT5 && !side->repeatcnt) { // "infinite" repeat
|
||||
texbottom = back->floorheight + side->rowoffset;
|
||||
textop = back->ceilingheight + side->rowoffset;
|
||||
} else if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3)) {
|
||||
texbottom = back->floorheight + side->rowoffset;
|
||||
textop = texbottom + texheight*(side->repeatcnt+1);
|
||||
} else {
|
||||
textop = back->ceilingheight + side->rowoffset;
|
||||
texbottom = textop - texheight*(side->repeatcnt+1);
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
if (linedef->flags & ML_EFFECT5 && !side->repeatcnt) { // "infinite" repeat
|
||||
texbottom = openbottom + side->rowoffset;
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
#include "screen.h" // MAXVIDWIDTH, MAXVIDHEIGHT
|
||||
|
||||
#define POLYOBJECTS
|
||||
|
||||
//
|
||||
// ClipWallSegment
|
||||
|
||||
+2
-56
@@ -622,62 +622,8 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
||||
|
||||
// draw the texture
|
||||
col = (column_t *)((UINT8 *)R_GetColumn(texnum, maskedtexturecol[dc_x]) - 3);
|
||||
|
||||
//#ifdef POLYOBJECTS_PLANES
|
||||
#if 0 // Disabling this allows inside edges to render below the planes, for until the clipping is fixed to work right when POs are near the camera. -Red
|
||||
if (curline->dontrenderme && curline->polyseg && (curline->polyseg->flags & POF_RENDERPLANES))
|
||||
{
|
||||
fixed_t my_topscreen;
|
||||
fixed_t my_bottomscreen;
|
||||
fixed_t my_yl, my_yh;
|
||||
|
||||
my_topscreen = sprtopscreen + spryscale*col->topdelta;
|
||||
my_bottomscreen = sprbotscreen == INT32_MAX ? my_topscreen + spryscale*col->length
|
||||
: sprbotscreen + spryscale*col->length;
|
||||
|
||||
my_yl = (my_topscreen+FRACUNIT-1)>>FRACBITS;
|
||||
my_yh = (my_bottomscreen-1)>>FRACBITS;
|
||||
// CONS_Debug(DBG_RENDER, "my_topscreen: %d\nmy_bottomscreen: %d\nmy_yl: %d\nmy_yh: %d\n", my_topscreen, my_bottomscreen, my_yl, my_yh);
|
||||
|
||||
if (numffloors)
|
||||
{
|
||||
INT32 top = my_yl;
|
||||
INT32 bottom = my_yh;
|
||||
|
||||
for (i = 0; i < numffloors; i++)
|
||||
{
|
||||
if (!ffloor[i].polyobj || ffloor[i].polyobj != curline->polyseg)
|
||||
continue;
|
||||
|
||||
if (ffloor[i].height < viewz)
|
||||
{
|
||||
INT32 top_w = ffloor[i].plane->top[dc_x];
|
||||
|
||||
// CONS_Debug(DBG_RENDER, "Leveltime : %d\n", leveltime);
|
||||
// CONS_Debug(DBG_RENDER, "Top is %d, top_w is %d\n", top, top_w);
|
||||
if (top_w < top)
|
||||
{
|
||||
ffloor[i].plane->top[dc_x] = (INT16)top;
|
||||
ffloor[i].plane->picnum = 0;
|
||||
}
|
||||
// CONS_Debug(DBG_RENDER, "top_w is now %d\n", ffloor[i].plane->top[dc_x]);
|
||||
}
|
||||
else if (ffloor[i].height > viewz)
|
||||
{
|
||||
INT32 bottom_w = ffloor[i].plane->bottom[dc_x];
|
||||
|
||||
if (bottom_w > bottom)
|
||||
{
|
||||
ffloor[i].plane->bottom[dc_x] = (INT16)bottom;
|
||||
ffloor[i].plane->picnum = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
colfunc_2s(col);
|
||||
|
||||
colfunc_2s(col);
|
||||
}
|
||||
spryscale += rw_scalestep;
|
||||
}
|
||||
|
||||
@@ -1225,65 +1225,6 @@ fixed_t R_GetShadowZ(mobj_t *thing, pslope_t **shadowslope)
|
||||
groundslope = NULL;
|
||||
}
|
||||
|
||||
#if 0 // Unfortunately, this drops CEZ2 down to sub-17 FPS on my i7.
|
||||
// NOTE: this section was not updated to reflect reverse gravity support
|
||||
// Check polyobjects and see if groundz needs to be altered, for rings only because they don't update floorz
|
||||
if (thing->type == MT_RING)
|
||||
{
|
||||
INT32 xl, xh, yl, yh, bx, by;
|
||||
|
||||
xl = (unsigned)(thing->x - thing->radius - bmaporgx)>>MAPBLOCKSHIFT;
|
||||
xh = (unsigned)(thing->x + thing->radius - bmaporgx)>>MAPBLOCKSHIFT;
|
||||
yl = (unsigned)(thing->y - thing->radius - bmaporgy)>>MAPBLOCKSHIFT;
|
||||
yh = (unsigned)(thing->y + thing->radius - bmaporgy)>>MAPBLOCKSHIFT;
|
||||
|
||||
BMBOUNDFIX(xl, xh, yl, yh);
|
||||
|
||||
validcount++;
|
||||
|
||||
for (by = yl; by <= yh; by++)
|
||||
for (bx = xl; bx <= xh; bx++)
|
||||
{
|
||||
INT32 offset;
|
||||
polymaplink_t *plink; // haleyjd 02/22/06
|
||||
|
||||
if (bx < 0 || by < 0 || bx >= bmapwidth || by >= bmapheight)
|
||||
continue;
|
||||
|
||||
offset = by*bmapwidth + bx;
|
||||
|
||||
// haleyjd 02/22/06: consider polyobject lines
|
||||
plink = polyblocklinks[offset];
|
||||
|
||||
while (plink)
|
||||
{
|
||||
polyobj_t *po = plink->po;
|
||||
|
||||
if (po->validcount != validcount) // if polyobj hasn't been checked
|
||||
{
|
||||
po->validcount = validcount;
|
||||
|
||||
if (!P_MobjInsidePolyobj(po, thing) || !(po->flags & POF_RENDERPLANES))
|
||||
{
|
||||
plink = (polymaplink_t *)(plink->link.next);
|
||||
continue;
|
||||
}
|
||||
|
||||
// We're inside it! Yess...
|
||||
z = po->lines[0]->backsector->ceilingheight;
|
||||
|
||||
if (z < thing->z+thing->height/2 && z > groundz)
|
||||
{
|
||||
groundz = z;
|
||||
groundslope = NULL;
|
||||
}
|
||||
}
|
||||
plink = (polymaplink_t *)(plink->link.next);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (shadowslope != NULL)
|
||||
*shadowslope = groundslope;
|
||||
|
||||
@@ -2495,20 +2436,6 @@ static void R_CreateDrawNodes(void)
|
||||
}
|
||||
else if (r2->seg)
|
||||
{
|
||||
#if 0 //#ifdef POLYOBJECTS_PLANES
|
||||
if (r2->seg->curline->polyseg && rover->mobj && P_MobjInsidePolyobj(r2->seg->curline->polyseg, rover->mobj)) {
|
||||
// Determine if we need to sort in front of the polyobj, based on the planes. This fixes the issue where
|
||||
// polyobject planes render above the object standing on them. (A bit hacky... but it works.) -Red
|
||||
mobj_t *mo = rover->mobj;
|
||||
sector_t *po = r2->seg->curline->backsector;
|
||||
|
||||
if (po->ceilingheight < viewz && mo->z+mo->height > po->ceilingheight)
|
||||
continue;
|
||||
|
||||
if (po->floorheight > viewz && mo->z < po->floorheight)
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if (rover->x1 > r2->seg->x2 || rover->x2 < r2->seg->x1)
|
||||
continue;
|
||||
|
||||
|
||||
Reference in new issue
Block a user