R_ProjectSprite: make sprite clipping work with sloped fake floors/ceilings
from eternity engine
This commit is contained in:
1 parent
3878c2f72a
commit
1849d5aade
2 files changed
+22
-12
No files matched your search
@@ -4924,13 +4924,18 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||
|
||||
if (heightsec != -1 && phs != -1) // only clip things which are in special sectors
|
||||
{
|
||||
if (gl_viewz < FixedToFloat(sectors[phs].floorheight) ?
|
||||
FixedToFloat(interp.z) >= FixedToFloat(sectors[heightsec].floorheight) :
|
||||
gzt < FixedToFloat(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 > FixedToFloat(sectors[phs].ceilingheight) ?
|
||||
gzt < FixedToFloat(sectors[heightsec].ceilingheight) && gl_viewz >= FixedToFloat(sectors[heightsec].ceilingheight) :
|
||||
FixedToFloat(interp.z) >= FixedToFloat(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;
|
||||
}
|
||||
|
||||
|
||||
+11
-6
@@ -1697,13 +1697,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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user