mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Check that top of sprite is above plane or bottom is below
This fixes slightly raised fofs drawing on top of sprites that should be in front of them. Previously would check that the bottom of the object was above the plane. Now also uses sprite offsets like the fof seg sorting does.
This commit is contained in:
parent
998a10e8ad
commit
81cbf35560
1 changed files with 5 additions and 9 deletions
|
@ -2387,19 +2387,15 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps
|
||||||
planeobjectz = P_GetZAt(r2->plane->slope, rover->gx, rover->gy, r2->plane->height);
|
planeobjectz = P_GetZAt(r2->plane->slope, rover->gx, rover->gy, r2->plane->height);
|
||||||
planecameraz = P_GetZAt(r2->plane->slope, viewx, viewy, r2->plane->height);
|
planecameraz = P_GetZAt(r2->plane->slope, viewx, viewy, r2->plane->height);
|
||||||
|
|
||||||
if (rover->mobjflags & MF_NOCLIPHEIGHT)
|
// bird: if any part of the sprite peeks in front the plane
|
||||||
|
if (planecameraz < viewz)
|
||||||
{
|
{
|
||||||
//Objects with NOCLIPHEIGHT can appear halfway in.
|
if (rover->gzt >= planeobjectz)
|
||||||
if (planecameraz < viewz && rover->pz+(rover->thingheight/2) >= planeobjectz)
|
|
||||||
continue;
|
|
||||||
if (planecameraz > viewz && rover->pzt-(rover->thingheight/2) <= planeobjectz)
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else if (planecameraz > viewz)
|
||||||
{
|
{
|
||||||
if (planecameraz < viewz && rover->pz >= planeobjectz)
|
if (rover->gz <= planeobjectz)
|
||||||
continue;
|
|
||||||
if (planecameraz > viewz && rover->pzt <= planeobjectz)
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue