parent
b1662cc407
commit
6682f1df69
1 changed files with 32 additions and 28 deletions
|
|
@ -2333,6 +2333,38 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
return;
|
||||
}
|
||||
|
||||
// killough 3/27/98: exclude things totally separated
|
||||
// from the viewer, by either water or fake ceilings
|
||||
// killough 4/11/98: improve sprite clipping for underwater/fake ceilings
|
||||
|
||||
heightsec = thing->subsector->sector->heightsec;
|
||||
if (viewplayer && viewplayer->mo && viewplayer->mo->subsector)
|
||||
phs = viewplayer->mo->subsector->sector->heightsec;
|
||||
else
|
||||
phs = -1;
|
||||
|
||||
if (heightsec != -1 && phs != -1) // only clip things which are in special sectors
|
||||
{
|
||||
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;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
if (thing->terrain != NULL)
|
||||
{
|
||||
floorClip = thing->terrain->floorClip;
|
||||
}
|
||||
|
||||
if (thing->renderflags & RF_ABSOLUTELIGHTLEVEL)
|
||||
{
|
||||
const UINT8 n = R_ThingLightLevel(thing);
|
||||
|
|
@ -2404,34 +2436,6 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
lights_array = scalelight[lightnum];
|
||||
}
|
||||
|
||||
heightsec = thing->subsector->sector->heightsec;
|
||||
if (viewplayer && viewplayer->mo && viewplayer->mo->subsector)
|
||||
phs = viewplayer->mo->subsector->sector->heightsec;
|
||||
else
|
||||
phs = -1;
|
||||
|
||||
if (heightsec != -1 && phs != -1) // only clip things which are in special sectors
|
||||
{
|
||||
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;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
if (thing->terrain != NULL)
|
||||
{
|
||||
floorClip = thing->terrain->floorClip;
|
||||
}
|
||||
|
||||
// store information in a vissprite
|
||||
vis = R_NewVisSprite();
|
||||
vis->renderflags = thing->renderflags;
|
||||
|
|
|
|||
Loading…
Reference in a new issue