Merge p_sight.c

This commit is contained in:
Sally Coolatta 2020-08-06 11:12:19 -04:00
parent 372eb72d5b
commit f0484d87fa

View file

@ -212,21 +212,10 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
const vertex_t *v1,*v2;
fixed_t frac;
fixed_t frontf, backf, frontc, backc;
<<<<<<< HEAD
#ifdef ESLOPE
fixed_t fracx, fracy;
#endif
/* SRB2Kart doesn't have this?
if (seg->glseg)
continue;
*/
=======
fixed_t fracx, fracy;
if (seg->glseg)
continue;
>>>>>>> srb2/next
// already checked other side?
if (line->validcount == validcount)
@ -266,31 +255,14 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
front = seg->frontsector;
back = seg->backsector;
<<<<<<< HEAD
#ifdef ESLOPE
=======
>>>>>>> srb2/next
// calculate position at intercept
fracx = los->strace.x + FixedMul(los->strace.dx, frac);
fracy = los->strace.y + FixedMul(los->strace.dy, frac);
// calculate sector heights
<<<<<<< HEAD
frontf = (front->f_slope) ? P_GetZAt(front->f_slope, fracx, fracy) : front->floorheight;
frontc = (front->c_slope) ? P_GetZAt(front->c_slope, fracx, fracy) : front->ceilingheight;
backf = (back->f_slope) ? P_GetZAt(back->f_slope, fracx, fracy) : back->floorheight;
backc = (back->c_slope) ? P_GetZAt(back->c_slope, fracx, fracy) : back->ceilingheight;
#else
frontf = front->floorheight;
frontc = front->ceilingheight;
backf = back->floorheight;
backc = back->ceilingheight;
#endif
=======
frontf = P_GetSectorFloorZAt (front, fracx, fracy);
frontc = P_GetSectorCeilingZAt(front, fracx, fracy);
backf = P_GetSectorFloorZAt (back , fracx, fracy);
backc = P_GetSectorCeilingZAt(back , fracx, fracy);
>>>>>>> srb2/next
// crosses a two sided line
// no wall to block sight with?
if (frontf == backf && frontc == backc
@ -340,22 +312,11 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
continue;
}
<<<<<<< HEAD
#ifdef ESLOPE
topz = (*rover->t_slope) ? P_GetZAt(*rover->t_slope, fracx, fracy) : *rover->topheight;
bottomz = (*rover->b_slope) ? P_GetZAt(*rover->b_slope, fracx, fracy) : *rover->bottomheight;
#else
topz = *rover->topheight;
bottomz = *rover->bottomheight;
#endif
topslope = FixedDiv(topz - los->sightzstart , frac);
bottomslope = FixedDiv(bottomz - los->sightzstart , frac);
=======
topz = P_GetFFloorTopZAt (rover, fracx, fracy);
bottomz = P_GetFFloorBottomZAt(rover, fracx, fracy);
topslope = FixedDiv( topz - los->sightzstart, frac);
bottomslope = FixedDiv(bottomz - los->sightzstart, frac);
>>>>>>> srb2/next
if (topslope >= los->topslope && bottomslope <= los->bottomslope)
return false; // view completely blocked
}
@ -368,22 +329,11 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
continue;
}
<<<<<<< HEAD
#ifdef ESLOPE
topz = (*rover->t_slope) ? P_GetZAt(*rover->t_slope, fracx, fracy) : *rover->topheight;
bottomz = (*rover->b_slope) ? P_GetZAt(*rover->b_slope, fracx, fracy) : *rover->bottomheight;
#else
topz = *rover->topheight;
bottomz = *rover->bottomheight;
#endif
topslope = FixedDiv(topz - los->sightzstart , frac);
bottomslope = FixedDiv(bottomz - los->sightzstart , frac);
=======
topz = P_GetFFloorTopZAt (rover, fracx, fracy);
bottomz = P_GetFFloorBottomZAt(rover, fracx, fracy);
topslope = FixedDiv( topz - los->sightzstart, frac);
bottomslope = FixedDiv(bottomz - los->sightzstart, frac);
>>>>>>> srb2/next
if (topslope >= los->topslope && bottomslope <= los->bottomslope)
return false; // view completely blocked
}
@ -509,33 +459,10 @@ boolean P_CheckSight(mobj_t *t1, mobj_t *t2)
continue;
}
<<<<<<< HEAD
#ifdef ESLOPE
if (*rover->t_slope)
{
topz1 = P_GetZAt(*rover->t_slope, t1->x, t1->y);
topz2 = P_GetZAt(*rover->t_slope, t2->x, t2->y);
}
else
topz1 = topz2 = *rover->topheight;
if (*rover->b_slope)
{
bottomz1 = P_GetZAt(*rover->b_slope, t1->x, t1->y);
bottomz2 = P_GetZAt(*rover->b_slope, t2->x, t2->y);
}
else
bottomz1 = bottomz2 = *rover->bottomheight;
#else
topz1 = topz2 = *rover->topheight;
bottomz1 = bottomz2 = *rover->bottomheight;
#endif
=======
topz1 = P_GetFFloorTopZAt (rover, t1->x, t1->y);
topz2 = P_GetFFloorTopZAt (rover, t2->x, t2->y);
bottomz1 = P_GetFFloorBottomZAt(rover, t1->x, t1->y);
bottomz2 = P_GetFFloorBottomZAt(rover, t2->x, t2->y);
>>>>>>> srb2/next
// Check for blocking floors here.
if ((los.sightzstart < bottomz1 && t2->z >= topz2)