some cleanup of software's seg rendering code, moved Red's polyobject plane hack to R_StoreWallRange since it doesn't actually need to be done every column draw
(I suspect polyobject planes don't actually need the minx/maxx hacks anymore, but I haven't the time to test that tonight nor is this branch really suited for it anyway)
This commit is contained in:
parent
7d150485c9
commit
9e4c985d70
44
src/r_segs.c
44
src/r_segs.c
|
@ -1366,7 +1366,6 @@ static void R_RenderSegLoop (void)
|
||||||
// mark floor / ceiling areas
|
// mark floor / ceiling areas
|
||||||
yl = (topfrac+HEIGHTUNIT-1)>>HEIGHTBITS;
|
yl = (topfrac+HEIGHTUNIT-1)>>HEIGHTBITS;
|
||||||
|
|
||||||
// no space above wall?
|
|
||||||
top = ceilingclip[rw_x]+1;
|
top = ceilingclip[rw_x]+1;
|
||||||
|
|
||||||
// no space above wall?
|
// no space above wall?
|
||||||
|
@ -1375,12 +1374,9 @@ static void R_RenderSegLoop (void)
|
||||||
|
|
||||||
if (markceiling)
|
if (markceiling)
|
||||||
{
|
{
|
||||||
bottom = yl-1;
|
bottom = yl > floorclip[rw_x] ? floorclip[rw_x] : yl;
|
||||||
|
|
||||||
if (bottom >= floorclip[rw_x])
|
if (top <= --bottom)
|
||||||
bottom = floorclip[rw_x]-1;
|
|
||||||
|
|
||||||
if (top <= bottom)
|
|
||||||
{
|
{
|
||||||
ceilingplane->top[rw_x] = (INT16)top;
|
ceilingplane->top[rw_x] = (INT16)top;
|
||||||
ceilingplane->bottom[rw_x] = (INT16)bottom;
|
ceilingplane->bottom[rw_x] = (INT16)bottom;
|
||||||
|
@ -1397,24 +1393,13 @@ static void R_RenderSegLoop (void)
|
||||||
|
|
||||||
if (markfloor)
|
if (markfloor)
|
||||||
{
|
{
|
||||||
#if 0 // Old Doom Legacy code
|
top = yh < ceilingclip[rw_x] ? ceilingclip[rw_x] : yh;
|
||||||
bottom = floorclip[rw_x]-1;
|
|
||||||
if (top <= ceilingclip[rw_x])
|
|
||||||
top = ceilingclip[rw_x]+1;
|
|
||||||
if (top <= bottom && floorplane)
|
|
||||||
{
|
|
||||||
floorplane->top[rw_x] = (INT16)top;
|
|
||||||
floorplane->bottom[rw_x] = (INT16)bottom;
|
|
||||||
}
|
|
||||||
#else // Spiffy new PRBoom code
|
|
||||||
top = yh < ceilingclip[rw_x] ? ceilingclip[rw_x] : yh;
|
|
||||||
|
|
||||||
if (++top <= bottom && floorplane)
|
if (++top <= bottom && floorplane)
|
||||||
{
|
{
|
||||||
floorplane->top[rw_x] = (INT16)top;
|
floorplane->top[rw_x] = (INT16)top;
|
||||||
floorplane->bottom[rw_x] = (INT16)bottom;
|
floorplane->bottom[rw_x] = (INT16)bottom;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (numffloors)
|
if (numffloors)
|
||||||
|
@ -1428,7 +1413,7 @@ static void R_RenderSegLoop (void)
|
||||||
#ifdef POLYOBJECTS_PLANES
|
#ifdef POLYOBJECTS_PLANES
|
||||||
if (ffloor[i].polyobj && (!curline->polyseg || ffloor[i].polyobj != curline->polyseg))
|
if (ffloor[i].polyobj && (!curline->polyseg || ffloor[i].polyobj != curline->polyseg))
|
||||||
continue;
|
continue;
|
||||||
|
/*
|
||||||
// FIXME hack to fix planes disappearing when a seg goes behind the camera. This NEEDS to be changed to be done properly. -Red
|
// FIXME hack to fix planes disappearing when a seg goes behind the camera. This NEEDS to be changed to be done properly. -Red
|
||||||
if (curline->polyseg) {
|
if (curline->polyseg) {
|
||||||
if (ffloor[i].plane->minx > rw_x)
|
if (ffloor[i].plane->minx > rw_x)
|
||||||
|
@ -1436,6 +1421,7 @@ static void R_RenderSegLoop (void)
|
||||||
else if (ffloor[i].plane->maxx < rw_x)
|
else if (ffloor[i].plane->maxx < rw_x)
|
||||||
ffloor[i].plane->maxx = rw_x;
|
ffloor[i].plane->maxx = rw_x;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ffloor[i].height < viewz)
|
if (ffloor[i].height < viewz)
|
||||||
|
@ -1451,7 +1437,7 @@ static void R_RenderSegLoop (void)
|
||||||
|
|
||||||
#ifdef POLYOBJECTS_PLANES
|
#ifdef POLYOBJECTS_PLANES
|
||||||
// Polyobject-specific hack to fix plane leaking -Red
|
// Polyobject-specific hack to fix plane leaking -Red
|
||||||
if (curline->polyseg && ffloor[i].polyobj && ffloor[i].polyobj == curline->polyseg && top_w >= bottom_w) {
|
if (ffloor[i].polyobj && top_w >= bottom_w) {
|
||||||
ffloor[i].plane->top[rw_x] = ffloor[i].plane->bottom[rw_x] = 0xFFFF;
|
ffloor[i].plane->top[rw_x] = ffloor[i].plane->bottom[rw_x] = 0xFFFF;
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
|
@ -1475,7 +1461,7 @@ static void R_RenderSegLoop (void)
|
||||||
|
|
||||||
#ifdef POLYOBJECTS_PLANES
|
#ifdef POLYOBJECTS_PLANES
|
||||||
// Polyobject-specific hack to fix plane leaking -Red
|
// Polyobject-specific hack to fix plane leaking -Red
|
||||||
if (curline->polyseg && ffloor[i].polyobj && ffloor[i].polyobj == curline->polyseg && top_w >= bottom_w) {
|
if (ffloor[i].polyobj && top_w >= bottom_w) {
|
||||||
ffloor[i].plane->top[rw_x] = ffloor[i].plane->bottom[rw_x] = 0xFFFF;
|
ffloor[i].plane->top[rw_x] = ffloor[i].plane->bottom[rw_x] = 0xFFFF;
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
|
@ -3175,6 +3161,22 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
||||||
for (i = 0; i < numffloors; i++)
|
for (i = 0; i < numffloors; i++)
|
||||||
R_ExpandPlane(ffloor[i].plane, rw_x, rw_stopx - 1);
|
R_ExpandPlane(ffloor[i].plane, rw_x, rw_stopx - 1);
|
||||||
}
|
}
|
||||||
|
#ifdef POLYOBJECTS_PLANES
|
||||||
|
// FIXME hack to fix planes disappearing when a seg goes behind the camera. This NEEDS to be changed to be done properly. -Red
|
||||||
|
if (curline->polyseg)
|
||||||
|
{
|
||||||
|
for (i = 0; i < numffloors; i++)
|
||||||
|
{
|
||||||
|
if (!ffloor[i].polyobj || ffloor[i].polyobj != curline->polyseg)
|
||||||
|
continue;
|
||||||
|
if (ffloor[i].plane->minx > rw_x)
|
||||||
|
ffloor[i].plane->minx = rw_x;
|
||||||
|
|
||||||
|
if (ffloor[i].plane->maxx < rw_stopx - 1)
|
||||||
|
ffloor[i].plane->maxx = rw_stopx - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WALLSPLATS
|
#ifdef WALLSPLATS
|
||||||
|
|
Loading…
Reference in New Issue