R_ProjectSprite: make sprite clipping work with sloped fake floors/ceilings
1849d5aade
This commit is contained in:
parent
116407f68a
commit
9b99d2fd91
2 changed files with 22 additions and 12 deletions
|
|
@ -5072,13 +5072,18 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
|
||||
if (heightsec != -1 && phs != -1) // only clip things which are in special sectors
|
||||
{
|
||||
if (gl_viewz < FIXED_TO_FLOAT(sectors[phs].floorheight) ?
|
||||
FIXED_TO_FLOAT(interp.z) >= FIXED_TO_FLOAT(sectors[heightsec].floorheight) :
|
||||
gzt < FIXED_TO_FLOAT(sectors[heightsec].floorheight))
|
||||
fixed_t secheight;
|
||||
|
||||
secheight = P_GetSectorFloorZAt(§ors[heightsec], viewx, viewy);
|
||||
if (viewz < P_GetSectorFloorZAt(§ors[phs], interp.x, interp.y) ?
|
||||
interp.z >= secheight :
|
||||
gzt < secheight)
|
||||
return;
|
||||
if (gl_viewz > FIXED_TO_FLOAT(sectors[phs].ceilingheight) ?
|
||||
gzt < FIXED_TO_FLOAT(sectors[heightsec].ceilingheight) && gl_viewz >= FIXED_TO_FLOAT(sectors[heightsec].ceilingheight) :
|
||||
FIXED_TO_FLOAT(interp.z) >= FIXED_TO_FLOAT(sectors[heightsec].ceilingheight))
|
||||
|
||||
secheight = P_GetSectorCeilingZAt(§ors[heightsec], viewx, viewy);
|
||||
if (viewz > P_GetSectorCeilingZAt(§ors[phs], interp.x, interp.y) ?
|
||||
gzt < secheight && viewz >= secheight :
|
||||
interp.z >= secheight)
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2412,13 +2412,18 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
|
||||
if (heightsec != -1 && phs != -1) // only clip things which are in special sectors
|
||||
{
|
||||
if (viewz < sectors[phs].floorheight ?
|
||||
interp.z >= sectors[heightsec].floorheight :
|
||||
gzt < sectors[heightsec].floorheight)
|
||||
fixed_t secheight;
|
||||
|
||||
secheight = P_GetSectorFloorZAt(§ors[heightsec], viewx, viewy);
|
||||
if (viewz < P_GetSectorFloorZAt(§ors[phs], interp.x, interp.y) ?
|
||||
interp.z >= secheight :
|
||||
gzt < secheight)
|
||||
return;
|
||||
if (viewz > sectors[phs].ceilingheight ?
|
||||
gzt < sectors[heightsec].ceilingheight && viewz >= sectors[heightsec].ceilingheight :
|
||||
interp.z >= sectors[heightsec].ceilingheight)
|
||||
|
||||
secheight = P_GetSectorCeilingZAt(§ors[heightsec], viewx, viewy);
|
||||
if (viewz > P_GetSectorCeilingZAt(§ors[phs], interp.x, interp.y) ?
|
||||
gzt < secheight && viewz >= secheight :
|
||||
interp.z >= secheight)
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue