Use doubles for intermediates in the nodebuilder's FindMapBounds()

This commit is contained in:
Randy Heit 2016-04-30 21:28:41 -05:00
parent f387199442
commit 265783e1f6

View file

@ -609,25 +609,25 @@ void FNodeBuilder::AddSegToBBox (fixed_t bbox[4], const FPrivSeg *seg)
if (v2->y > bbox[BOXTOP]) bbox[BOXTOP] = v2->y; if (v2->y > bbox[BOXTOP]) bbox[BOXTOP] = v2->y;
} }
void FNodeBuilder::FLevel::FindMapBounds () void FNodeBuilder::FLevel::FindMapBounds()
{ {
fixed_t minx, maxx, miny, maxy; double minx, maxx, miny, maxy;
minx = maxx = Vertices[0].fixX(); minx = maxx = Vertices[0].fX();
miny = maxy = Vertices[0].fixY(); miny = maxy = Vertices[0].fY();
for (int i = 1; i < NumVertices; ++i) for (int i = 1; i < NumVertices; ++i)
{ {
if (Vertices[i].fixX() < minx) minx = Vertices[i].fixX(); if (Vertices[i].fX() < minx) minx = Vertices[i].fX();
else if (Vertices[i].fixX() > maxx) maxx = Vertices[i].fixX(); else if (Vertices[i].fX() > maxx) maxx = Vertices[i].fX();
if (Vertices[i].fixY() < miny) miny = Vertices[i].fixY(); if (Vertices[i].fY() < miny) miny = Vertices[i].fY();
else if (Vertices[i].fixY() > maxy) maxy = Vertices[i].fixY(); else if (Vertices[i].fY() > maxy) maxy = Vertices[i].fY();
} }
MinX = minx; MinX = FLOAT2FIXED(minx);
MinY = miny; MinY = FLOAT2FIXED(miny);
MaxX = maxx; MaxX = FLOAT2FIXED(maxx);
MaxY = maxy; MaxY = FLOAT2FIXED(maxy);
} }
FNodeBuilder::IVertexMap::~IVertexMap() FNodeBuilder::IVertexMap::~IVertexMap()