mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-02-09 17:51:17 +00:00
After looking at the FOF part of P_LineOpening for a while I now realise many of these variables aren't even necessary, so I removed them all.
(Naturally I did the same to the camera equivalent) # Conflicts: # src/p_maputl.c
This commit is contained in:
parent
cda81cc166
commit
bbefc3b7f4
1 changed files with 36 additions and 81 deletions
117
src/p_maputl.c
117
src/p_maputl.c
|
@ -418,10 +418,6 @@ void P_CameraLineOpening(line_t *linedef)
|
||||||
if (front->ffloors || back->ffloors)
|
if (front->ffloors || back->ffloors)
|
||||||
{
|
{
|
||||||
ffloor_t *rover;
|
ffloor_t *rover;
|
||||||
fixed_t highestceiling = highceiling;
|
|
||||||
fixed_t lowestceiling = opentop;
|
|
||||||
fixed_t highestfloor = openbottom;
|
|
||||||
fixed_t lowestfloor = lowfloor;
|
|
||||||
fixed_t delta1, delta2;
|
fixed_t delta1, delta2;
|
||||||
|
|
||||||
// Check for frontsector's fake floors
|
// Check for frontsector's fake floors
|
||||||
|
@ -437,15 +433,15 @@ void P_CameraLineOpening(line_t *linedef)
|
||||||
|
|
||||||
delta1 = abs(mapcampointer->z - (bottomheight + ((topheight - bottomheight)/2)));
|
delta1 = abs(mapcampointer->z - (bottomheight + ((topheight - bottomheight)/2)));
|
||||||
delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2)));
|
delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2)));
|
||||||
if (bottomheight < lowestceiling && delta1 >= delta2)
|
if (bottomheight < opentop && delta1 >= delta2)
|
||||||
lowestceiling = bottomheight;
|
opentop = bottomheight;
|
||||||
else if (bottomheight < highestceiling && delta1 >= delta2)
|
else if (bottomheight < highceiling && delta1 >= delta2)
|
||||||
highestceiling = bottomheight;
|
highceiling = bottomheight;
|
||||||
|
|
||||||
if (topheight > highestfloor && delta1 < delta2)
|
if (topheight > openbottom && delta1 < delta2)
|
||||||
highestfloor = topheight;
|
openbottom = topheight;
|
||||||
else if (topheight > lowestfloor && delta1 < delta2)
|
else if (topheight > lowfloor && delta1 < delta2)
|
||||||
lowestfloor = topheight;
|
lowfloor = topheight;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for backsectors fake floors
|
// Check for backsectors fake floors
|
||||||
|
@ -461,28 +457,16 @@ void P_CameraLineOpening(line_t *linedef)
|
||||||
|
|
||||||
delta1 = abs(mapcampointer->z - (bottomheight + ((topheight - bottomheight)/2)));
|
delta1 = abs(mapcampointer->z - (bottomheight + ((topheight - bottomheight)/2)));
|
||||||
delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2)));
|
delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2)));
|
||||||
if (bottomheight < lowestceiling && delta1 >= delta2)
|
if (bottomheight < opentop && delta1 >= delta2)
|
||||||
lowestceiling = bottomheight;
|
opentop = bottomheight;
|
||||||
else if (bottomheight < highestceiling && delta1 >= delta2)
|
else if (bottomheight < highceiling && delta1 >= delta2)
|
||||||
highestceiling = bottomheight;
|
highceiling = bottomheight;
|
||||||
|
|
||||||
if (topheight > highestfloor && delta1 < delta2)
|
if (topheight > openbottom && delta1 < delta2)
|
||||||
highestfloor = topheight;
|
openbottom = topheight;
|
||||||
else if (topheight > lowestfloor && delta1 < delta2)
|
else if (topheight > lowfloor && delta1 < delta2)
|
||||||
lowestfloor = topheight;
|
lowfloor = topheight;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (highestceiling < highceiling)
|
|
||||||
highceiling = highestceiling;
|
|
||||||
|
|
||||||
if (highestfloor > openbottom)
|
|
||||||
openbottom = highestfloor;
|
|
||||||
|
|
||||||
if (lowestceiling < opentop)
|
|
||||||
opentop = lowestceiling;
|
|
||||||
|
|
||||||
if (lowestfloor > lowfloor)
|
|
||||||
lowfloor = lowestfloor;
|
|
||||||
}
|
}
|
||||||
openrange = opentop - openbottom;
|
openrange = opentop - openbottom;
|
||||||
return;
|
return;
|
||||||
|
@ -667,16 +651,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
||||||
if (front->ffloors || back->ffloors)
|
if (front->ffloors || back->ffloors)
|
||||||
{
|
{
|
||||||
ffloor_t *rover;
|
ffloor_t *rover;
|
||||||
|
|
||||||
fixed_t highestceiling = highceiling;
|
|
||||||
fixed_t lowestceiling = opentop;
|
|
||||||
fixed_t highestfloor = openbottom;
|
|
||||||
fixed_t lowestfloor = lowfloor;
|
|
||||||
fixed_t delta1, delta2;
|
fixed_t delta1, delta2;
|
||||||
#ifdef ESLOPE
|
|
||||||
pslope_t *ceilingslope = opentopslope;
|
|
||||||
pslope_t *floorslope = openbottomslope;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Check for frontsector's fake floors
|
// Check for frontsector's fake floors
|
||||||
for (rover = front->ffloors; rover; rover = rover->next)
|
for (rover = front->ffloors; rover; rover = rover->next)
|
||||||
|
@ -699,26 +674,26 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
||||||
|
|
||||||
if (delta1 >= delta2 && !(rover->flags & FF_PLATFORM)) // thing is below FOF
|
if (delta1 >= delta2 && !(rover->flags & FF_PLATFORM)) // thing is below FOF
|
||||||
{
|
{
|
||||||
if (bottomheight < lowestceiling) {
|
if (bottomheight < opentop) {
|
||||||
lowestceiling = bottomheight;
|
opentop = bottomheight;
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
ceilingslope = *rover->b_slope;
|
opentopslope = *rover->b_slope;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (bottomheight < highestceiling)
|
else if (bottomheight < highceiling)
|
||||||
highestceiling = bottomheight;
|
highceiling = bottomheight;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (delta1 < delta2 && !(rover->flags & FF_REVERSEPLATFORM)) // thing is above FOF
|
if (delta1 < delta2 && !(rover->flags & FF_REVERSEPLATFORM)) // thing is above FOF
|
||||||
{
|
{
|
||||||
if (topheight > highestfloor) {
|
if (topheight > openbottom) {
|
||||||
highestfloor = topheight;
|
openbottom = topheight;
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
floorslope = *rover->t_slope;
|
openbottomslope = *rover->t_slope;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (topheight > lowestfloor)
|
else if (topheight > lowfloor)
|
||||||
lowestfloor = topheight;
|
lowfloor = topheight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -743,48 +718,28 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
||||||
|
|
||||||
if (delta1 >= delta2 && !(rover->flags & FF_PLATFORM)) // thing is below FOF
|
if (delta1 >= delta2 && !(rover->flags & FF_PLATFORM)) // thing is below FOF
|
||||||
{
|
{
|
||||||
if (bottomheight < lowestceiling) {
|
if (bottomheight < opentop) {
|
||||||
lowestceiling = bottomheight;
|
opentop = bottomheight;
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
ceilingslope = *rover->b_slope;
|
opentopslope = *rover->b_slope;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (bottomheight < highestceiling)
|
else if (bottomheight < highceiling)
|
||||||
highestceiling = bottomheight;
|
highceiling = bottomheight;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (delta1 < delta2 && !(rover->flags & FF_REVERSEPLATFORM)) // thing is above FOF
|
if (delta1 < delta2 && !(rover->flags & FF_REVERSEPLATFORM)) // thing is above FOF
|
||||||
{
|
{
|
||||||
if (topheight > highestfloor) {
|
if (topheight > openbottom) {
|
||||||
highestfloor = topheight;
|
openbottom = topheight;
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
floorslope = *rover->t_slope;
|
openbottomslope = *rover->t_slope;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (topheight > lowestfloor)
|
else if (topheight > lowfloor)
|
||||||
lowestfloor = topheight;
|
lowfloor = topheight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (highestceiling < highceiling)
|
|
||||||
highceiling = highestceiling;
|
|
||||||
|
|
||||||
if (highestfloor > openbottom) {
|
|
||||||
openbottom = highestfloor;
|
|
||||||
#ifdef ESLOPE
|
|
||||||
openbottomslope = floorslope;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lowestceiling < opentop) {
|
|
||||||
opentop = lowestceiling;
|
|
||||||
#ifdef ESLOPE
|
|
||||||
opentopslope = ceilingslope;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lowestfloor > lowfloor)
|
|
||||||
lowfloor = lowestfloor;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue