- 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

@ -476,13 +476,13 @@ void P_Recalculate3DFloors(sector_t * sector)
while (oldlist.Size())
{
pick=oldlist[0];
fixed_t height=pick->top.plane->ZatPoint(CenterSpot(sector));
fixed_t height=pick->top.plane->ZatPoint(sector->centerspot);
// find highest starting ffloor - intersections are not supported!
pickindex=0;
for (j=1;j<oldlist.Size();j++)
{
fixed_t h2=oldlist[j]->top.plane->ZatPoint(CenterSpot(sector));
fixed_t h2=oldlist[j]->top.plane->ZatPoint(sector->centerspot);
if (h2>height)
{
@ -493,7 +493,7 @@ void P_Recalculate3DFloors(sector_t * sector)
}
oldlist.Delete(pickindex);
fixed_t pick_bottom=pick->bottom.plane->ZatPoint(CenterSpot(sector));
fixed_t pick_bottom=pick->bottom.plane->ZatPoint(sector->centerspot);
if (pick->flags & FF_THISINSIDE)
{
@ -607,7 +607,7 @@ void P_Recalculate3DFloors(sector_t * sector)
if ( !(rover->flags & FF_EXISTS) || rover->flags & FF_NOSHADE )
continue;
fixed_t ff_top=rover->top.plane->ZatPoint(CenterSpot(sector));
fixed_t ff_top=rover->top.plane->ZatPoint(sector->centerspot);
if (ff_top < minheight) break; // reached the floor
if (ff_top < maxheight)
{
@ -622,7 +622,7 @@ void P_Recalculate3DFloors(sector_t * sector)
}
else
{
fixed_t ff_bottom=rover->bottom.plane->ZatPoint(CenterSpot(sector));
fixed_t ff_bottom=rover->bottom.plane->ZatPoint(sector->centerspot);
if (ff_bottom<maxheight)
{
// this segment begins over the ceiling and extends beyond it
@ -648,7 +648,7 @@ void P_Recalculate3DFloors(sector_t * sector)
if (rover->flags&FF_DOUBLESHADOW)
{
fixed_t ff_bottom=rover->bottom.plane->ZatPoint(CenterSpot(sector));
fixed_t ff_bottom=rover->bottom.plane->ZatPoint(sector->centerspot);
if(ff_bottom < maxheight && ff_bottom>minheight)
{
newlight.caster = rover;
@ -736,11 +736,11 @@ lightlist_t * P_GetPlaneLight(sector_t * sector, secplane_t * plane, bool unders
unsigned i;
TArray<lightlist_t> &lightlist = sector->e->XFloor.lightlist;
fixed_t planeheight=plane->ZatPoint(CenterSpot(sector));
fixed_t planeheight=plane->ZatPoint(sector->centerspot);
if(underside) planeheight--;
for(i = 1; i < lightlist.Size(); i++)
if (lightlist[i].plane.ZatPoint(CenterSpot(sector)) <= planeheight)
if (lightlist[i].plane.ZatPoint(sector->centerspot) <= planeheight)
return &lightlist[i - 1];
return &lightlist[lightlist.Size() - 1];
@ -1000,8 +1000,8 @@ CCMD (dump3df)
for (unsigned int i = 0; i < ffloors.Size(); i++)
{
fixed_t height=ffloors[i]->top.plane->ZatPoint(CenterSpot(sector));
fixed_t bheight=ffloors[i]->bottom.plane->ZatPoint(CenterSpot(sector));
fixed_t height=ffloors[i]->top.plane->ZatPoint(sector->centerspot);
fixed_t bheight=ffloors[i]->bottom.plane->ZatPoint(sector->centerspot);
IGNORE_FORMAT_PRE
Printf("FFloor %d @ top = %f (model = %d), bottom = %f (model = %d), flags = %B, alpha = %d %s %s\n",