- Merged in recent ZDBSP fixes:

- Added code to explicitly handle outputting overlapping segs when
   building GL nodes with ZDBSP, removing the check that discarded
   them early on.
 - AddIntersection() should convert to doubles before subtracting the vertex
   from the node, not after, to avoid integer overflow. (See cah.wad, MAP12
   and MAP13.) A simpler dot product will also suffice for distance calculation.
 - Splitters that come too close to a vertex should be avoided. (See cata.wad.)
 - Red-Black Tree implementation was broken and colored every node red.
 - Moved most of the code for outputting degenerate GL subsectors into another
   function.


SVN r160 (trunk)
This commit is contained in:
Randy Heit 2006-06-01 01:43:16 +00:00
commit 4325fb8993
7 changed files with 202 additions and 280 deletions

View file

@ -63,24 +63,7 @@ double FNodeBuilder::AddIntersection (const node_t &node, int vertex)
// Calculate signed distance of intersection vertex from start of splitter.
// Only ordering is important, so we don't need a sqrt.
FPrivVert *v = &Vertices[vertex];
double dx = double(v->x - node.x);
double dy = double(v->y - node.y);
double dist = dx*dx + dy*dy;
if (node.dx != 0)
{
if ((node.dx > 0 && dx < 0.0) || (node.dx < 0 && dx > 0.0))
{
dist = -dist;
}
}
else
{
if ((node.dy > 0 && dy < 0.0) || (node.dy < 0 && dy > 0.0))
{
dist = -dist;
}
}
double dist = (double(v->x) - node.x)*(node.dx) + (double(v->y) - node.y)*(node.dy);
FEvent *event = Events.FindEvent (dist);
if (event == NULL)