mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-14 17:00:39 +00:00
Go through all the polyobjects to find leftover polyobj planes to add to the draw nodes list
I'm convinced there's going to be some stupid side effects from doing this, but it's the quickest way I can fix the polyobj planes not all appearing anyway
This commit is contained in:
parent
1bb53ce5f3
commit
f5f2542849
1 changed files with 31 additions and 5 deletions
|
@ -1760,6 +1760,29 @@ static void R_CreateDrawNodes(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef POLYOBJECTS_PLANES
|
||||||
|
// find all the remaining polyobject planes and add them on the end of the list
|
||||||
|
// probably this is a terrible idea if we wanted them to be sorted properly
|
||||||
|
// but it works getting them in for now
|
||||||
|
for (i = 0; i < numPolyObjects; i++)
|
||||||
|
{
|
||||||
|
if (!PolyObjects[i].visplane)
|
||||||
|
continue;
|
||||||
|
plane = PolyObjects[i].visplane;
|
||||||
|
R_PlaneBounds(plane);
|
||||||
|
|
||||||
|
if (plane->low < con_clipviewtop || plane->high > vid.height || plane->high > plane->low)
|
||||||
|
{
|
||||||
|
PolyObjects[i].visplane = NULL;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
entry = R_CreateDrawNode(&nodehead);
|
||||||
|
entry->plane = plane;
|
||||||
|
// note: no seg is set, for what should be obvious reasons
|
||||||
|
PolyObjects[i].visplane = NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (visspritecount == 0)
|
if (visspritecount == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1816,6 +1839,8 @@ static void R_CreateDrawNodes(void)
|
||||||
if (x1 < r2->plane->minx) x1 = r2->plane->minx;
|
if (x1 < r2->plane->minx) x1 = r2->plane->minx;
|
||||||
if (x2 > r2->plane->maxx) x2 = r2->plane->maxx;
|
if (x2 > r2->plane->maxx) x2 = r2->plane->maxx;
|
||||||
|
|
||||||
|
if (r2->seg) // if no seg set, assume the whole thing is in front or something stupid
|
||||||
|
{
|
||||||
for (i = x1; i <= x2; i++)
|
for (i = x1; i <= x2; i++)
|
||||||
{
|
{
|
||||||
if (r2->seg->frontscale[i] > rover->scale)
|
if (r2->seg->frontscale[i] > rover->scale)
|
||||||
|
@ -1823,6 +1848,7 @@ static void R_CreateDrawNodes(void)
|
||||||
}
|
}
|
||||||
if (i > x2)
|
if (i > x2)
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
entry = R_CreateDrawNode(NULL);
|
entry = R_CreateDrawNode(NULL);
|
||||||
(entry->prev = r2->prev)->next = entry;
|
(entry->prev = r2->prev)->next = entry;
|
||||||
|
|
Loading…
Reference in a new issue