- fixed some places in p_pillar.cpp where sector plane z's were calculated at (0, 0) which could cause overflows if the actual plane is too far away from the origin.

- renamed sector_t::soundorg in centerspot, changed the type to a fixedvec2 and removed the CenterSpot #define.

Since this thing was used in lots of places that have nothing to do with sound the name made no sense. Having it as a fixed_t array also made it clumsy to use and the CenterSpot #define used a potentially dangerous type cast.
This commit is contained in:
Christoph Oelckers 2016-02-24 14:49:59 +01:00
commit 58d3b04590
11 changed files with 63 additions and 61 deletions

View file

@ -709,8 +709,8 @@ static void CalcPosVel(int type, const AActor *actor, const sector_t *sector,
}
else
{
x = sector->soundorg[0];
z = sector->soundorg[1];
x = sector->centerspot.x;
z = sector->centerspot.y;
chanflags |= CHAN_LISTENERZ;
}
}
@ -776,8 +776,8 @@ static void CalcSectorSoundOrg(const sector_t *sec, int channum, fixed_t *x, fix
}
else
{
*x = sec->soundorg[0];
*y = sec->soundorg[1];
*x = sec->centerspot.x;
*y = sec->centerspot.y;
}
// Set sound vertical position based on channel.