mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 20:11:47 +00:00
Merge p_sight.c
This commit is contained in:
parent
372eb72d5b
commit
f0484d87fa
1 changed files with 2 additions and 75 deletions
|
|
@ -212,21 +212,10 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
|
||||||
const vertex_t *v1,*v2;
|
const vertex_t *v1,*v2;
|
||||||
fixed_t frac;
|
fixed_t frac;
|
||||||
fixed_t frontf, backf, frontc, backc;
|
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;
|
fixed_t fracx, fracy;
|
||||||
|
|
||||||
if (seg->glseg)
|
if (seg->glseg)
|
||||||
continue;
|
continue;
|
||||||
>>>>>>> srb2/next
|
|
||||||
|
|
||||||
// already checked other side?
|
// already checked other side?
|
||||||
if (line->validcount == validcount)
|
if (line->validcount == validcount)
|
||||||
|
|
@ -266,31 +255,14 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
|
||||||
|
|
||||||
front = seg->frontsector;
|
front = seg->frontsector;
|
||||||
back = seg->backsector;
|
back = seg->backsector;
|
||||||
<<<<<<< HEAD
|
|
||||||
#ifdef ESLOPE
|
|
||||||
=======
|
|
||||||
>>>>>>> srb2/next
|
|
||||||
// calculate position at intercept
|
// calculate position at intercept
|
||||||
fracx = los->strace.x + FixedMul(los->strace.dx, frac);
|
fracx = los->strace.x + FixedMul(los->strace.dx, frac);
|
||||||
fracy = los->strace.y + FixedMul(los->strace.dy, frac);
|
fracy = los->strace.y + FixedMul(los->strace.dy, frac);
|
||||||
// calculate sector heights
|
// 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);
|
frontf = P_GetSectorFloorZAt (front, fracx, fracy);
|
||||||
frontc = P_GetSectorCeilingZAt(front, fracx, fracy);
|
frontc = P_GetSectorCeilingZAt(front, fracx, fracy);
|
||||||
backf = P_GetSectorFloorZAt (back , fracx, fracy);
|
backf = P_GetSectorFloorZAt (back , fracx, fracy);
|
||||||
backc = P_GetSectorCeilingZAt(back , fracx, fracy);
|
backc = P_GetSectorCeilingZAt(back , fracx, fracy);
|
||||||
>>>>>>> srb2/next
|
|
||||||
// crosses a two sided line
|
// crosses a two sided line
|
||||||
// no wall to block sight with?
|
// no wall to block sight with?
|
||||||
if (frontf == backf && frontc == backc
|
if (frontf == backf && frontc == backc
|
||||||
|
|
@ -340,22 +312,11 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
|
||||||
continue;
|
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);
|
topz = P_GetFFloorTopZAt (rover, fracx, fracy);
|
||||||
bottomz = P_GetFFloorBottomZAt(rover, fracx, fracy);
|
bottomz = P_GetFFloorBottomZAt(rover, fracx, fracy);
|
||||||
topslope = FixedDiv( topz - los->sightzstart, frac);
|
topslope = FixedDiv( topz - los->sightzstart, frac);
|
||||||
bottomslope = FixedDiv(bottomz - los->sightzstart, frac);
|
bottomslope = FixedDiv(bottomz - los->sightzstart, frac);
|
||||||
>>>>>>> srb2/next
|
|
||||||
if (topslope >= los->topslope && bottomslope <= los->bottomslope)
|
if (topslope >= los->topslope && bottomslope <= los->bottomslope)
|
||||||
return false; // view completely blocked
|
return false; // view completely blocked
|
||||||
}
|
}
|
||||||
|
|
@ -368,22 +329,11 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
|
||||||
continue;
|
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);
|
topz = P_GetFFloorTopZAt (rover, fracx, fracy);
|
||||||
bottomz = P_GetFFloorBottomZAt(rover, fracx, fracy);
|
bottomz = P_GetFFloorBottomZAt(rover, fracx, fracy);
|
||||||
topslope = FixedDiv( topz - los->sightzstart, frac);
|
topslope = FixedDiv( topz - los->sightzstart, frac);
|
||||||
bottomslope = FixedDiv(bottomz - los->sightzstart, frac);
|
bottomslope = FixedDiv(bottomz - los->sightzstart, frac);
|
||||||
>>>>>>> srb2/next
|
|
||||||
if (topslope >= los->topslope && bottomslope <= los->bottomslope)
|
if (topslope >= los->topslope && bottomslope <= los->bottomslope)
|
||||||
return false; // view completely blocked
|
return false; // view completely blocked
|
||||||
}
|
}
|
||||||
|
|
@ -509,33 +459,10 @@ boolean P_CheckSight(mobj_t *t1, mobj_t *t2)
|
||||||
continue;
|
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);
|
topz1 = P_GetFFloorTopZAt (rover, t1->x, t1->y);
|
||||||
topz2 = P_GetFFloorTopZAt (rover, t2->x, t2->y);
|
topz2 = P_GetFFloorTopZAt (rover, t2->x, t2->y);
|
||||||
bottomz1 = P_GetFFloorBottomZAt(rover, t1->x, t1->y);
|
bottomz1 = P_GetFFloorBottomZAt(rover, t1->x, t1->y);
|
||||||
bottomz2 = P_GetFFloorBottomZAt(rover, t2->x, t2->y);
|
bottomz2 = P_GetFFloorBottomZAt(rover, t2->x, t2->y);
|
||||||
>>>>>>> srb2/next
|
|
||||||
|
|
||||||
// Check for blocking floors here.
|
// Check for blocking floors here.
|
||||||
if ((los.sightzstart < bottomz1 && t2->z >= topz2)
|
if ((los.sightzstart < bottomz1 && t2->z >= topz2)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue