mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-28 13:21:10 +00:00
Insert polyobject planes into their proper spot in the draw list; replace related hack with other hacks
This commit is contained in:
parent
83461f49c5
commit
1078be3c30
3 changed files with 21 additions and 4 deletions
|
@ -100,6 +100,8 @@ typedef struct polyobj_s
|
||||||
UINT8 isBad; // a bad polyobject: should not be rendered/manipulated
|
UINT8 isBad; // a bad polyobject: should not be rendered/manipulated
|
||||||
INT32 translucency; // index to translucency tables
|
INT32 translucency; // index to translucency tables
|
||||||
|
|
||||||
|
struct visplane_s *visplane; // polyobject's visplane, for ease of putting into the list later
|
||||||
|
|
||||||
// these are saved for netgames, so do not let Lua touch these!
|
// these are saved for netgames, so do not let Lua touch these!
|
||||||
INT32 spawnflags; // Flags the polyobject originally spawned with
|
INT32 spawnflags; // Flags the polyobject originally spawned with
|
||||||
} polyobj_t;
|
} polyobj_t;
|
||||||
|
|
|
@ -978,11 +978,12 @@ static void R_Subsector(size_t num)
|
||||||
polysec->floorpic_angle-po->angle,
|
polysec->floorpic_angle-po->angle,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
ffloor[numffloors].plane->polyobj = po;
|
//ffloor[numffloors].plane->polyobj = po;
|
||||||
|
|
||||||
ffloor[numffloors].height = polysec->floorheight;
|
ffloor[numffloors].height = polysec->floorheight;
|
||||||
ffloor[numffloors].polyobj = po;
|
ffloor[numffloors].polyobj = po;
|
||||||
// ffloor[numffloors].ffloor = rover;
|
// ffloor[numffloors].ffloor = rover;
|
||||||
|
po->visplane = ffloor[numffloors].plane;
|
||||||
numffloors++;
|
numffloors++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1014,11 +1015,12 @@ static void R_Subsector(size_t num)
|
||||||
ffloor[numffloors].plane = R_FindPlane(polysec->ceilingheight, polysec->ceilingpic,
|
ffloor[numffloors].plane = R_FindPlane(polysec->ceilingheight, polysec->ceilingpic,
|
||||||
polysec->lightlevel, xoff, yoff, polysec->ceilingpic_angle-po->angle,
|
polysec->lightlevel, xoff, yoff, polysec->ceilingpic_angle-po->angle,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
ffloor[numffloors].plane->polyobj = po;
|
//ffloor[numffloors].plane->polyobj = po;
|
||||||
|
|
||||||
ffloor[numffloors].polyobj = po;
|
ffloor[numffloors].polyobj = po;
|
||||||
ffloor[numffloors].height = polysec->ceilingheight;
|
ffloor[numffloors].height = polysec->ceilingheight;
|
||||||
// ffloor[numffloors].ffloor = rover;
|
// ffloor[numffloors].ffloor = rover;
|
||||||
|
po->visplane = ffloor[numffloors].plane;
|
||||||
numffloors++;
|
numffloors++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1682,6 +1682,19 @@ static void R_CreateDrawNodes(void)
|
||||||
}
|
}
|
||||||
if (ds->maskedtexturecol)
|
if (ds->maskedtexturecol)
|
||||||
{
|
{
|
||||||
|
#ifdef POLYOBJECTS_PLANES
|
||||||
|
// Check for a polyobject plane, but only if this is a front line
|
||||||
|
if (ds->curline->polyseg && ds->curline->polyseg->visplane && !ds->curline->side) {
|
||||||
|
// Put it in!
|
||||||
|
|
||||||
|
entry = R_CreateDrawNode(&nodehead);
|
||||||
|
entry->plane = ds->curline->polyseg->visplane;
|
||||||
|
entry->seg = ds;
|
||||||
|
ds->curline->polyseg->visplane->polyobj = ds->curline->polyseg;
|
||||||
|
ds->curline->polyseg->visplane = NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
entry = R_CreateDrawNode(&nodehead);
|
entry = R_CreateDrawNode(&nodehead);
|
||||||
entry->seg = ds;
|
entry->seg = ds;
|
||||||
}
|
}
|
||||||
|
@ -1698,7 +1711,7 @@ static void R_CreateDrawNodes(void)
|
||||||
plane = ds->ffloorplanes[p];
|
plane = ds->ffloorplanes[p];
|
||||||
R_PlaneBounds(plane);
|
R_PlaneBounds(plane);
|
||||||
|
|
||||||
if (plane->low < con_clipviewtop || plane->high > vid.height || plane->high > plane->low)
|
if (plane->low < con_clipviewtop || plane->high > vid.height || plane->high > plane->low || plane->polyobj)
|
||||||
{
|
{
|
||||||
ds->ffloorplanes[p] = NULL;
|
ds->ffloorplanes[p] = NULL;
|
||||||
continue;
|
continue;
|
||||||
|
@ -1809,7 +1822,7 @@ static void R_CreateDrawNodes(void)
|
||||||
}
|
}
|
||||||
else if (r2->seg)
|
else if (r2->seg)
|
||||||
{
|
{
|
||||||
#ifdef POLYOBJECTS_PLANES
|
#if 0 //#ifdef POLYOBJECTS_PLANES
|
||||||
if (r2->seg->curline->polyseg && rover->mobj && P_MobjInsidePolyobj(r2->seg->curline->polyseg, rover->mobj)) {
|
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
|
// 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
|
// polyobject planes render above the object standing on them. (A bit hacky... but it works.) -Red
|
||||||
|
|
Loading…
Reference in a new issue