diff --git a/src/nodebuild.cpp b/src/nodebuild.cpp index 580f2fbf22..aa663e2e1e 100644 --- a/src/nodebuild.cpp +++ b/src/nodebuild.cpp @@ -94,7 +94,7 @@ void FNodeBuilder::BuildMini(bool makeGLNodes, bool enableSSE2) { GLNodes = makeGLNodes; EnableSSE2 = enableSSE2; - GroupSegPlanes(); + GroupSegPlanesSimple(); BuildTree(); } diff --git a/src/nodebuild.h b/src/nodebuild.h index bfcdb4f403..fa72e6d526 100644 --- a/src/nodebuild.h +++ b/src/nodebuild.h @@ -230,6 +230,7 @@ private: void MakeSegsFromSides (); int CreateSeg (int linenum, int sidenum); void GroupSegPlanes (); + void GroupSegPlanesSimple (); void FindPolyContainers (TArray &spots, TArray &anchors); bool GetPolyExtents (int polynum, fixed_t bbox[4]); int MarkLoop (DWORD firstseg, int loopnum); diff --git a/src/nodebuild_utility.cpp b/src/nodebuild_utility.cpp index 5c05073bd1..ef79ac4d95 100644 --- a/src/nodebuild_utility.cpp +++ b/src/nodebuild_utility.cpp @@ -350,6 +350,27 @@ void FNodeBuilder::GroupSegPlanes () PlaneChecked.Reserve ((planenum + 7) / 8); } +// Just create one plane per seg. Should be good enough for mini BSPs. +void FNodeBuilder::GroupSegPlanesSimple() +{ + Planes.Resize(Segs.Size()); + for (int i = 0; i < (int)Segs.Size(); ++i) + { + FPrivSeg *seg = &Segs[i]; + FSimpleLine *pline = &Planes[i]; + seg->next = i+1; + seg->hashnext = NULL; + seg->planenum = i; + seg->planefront = true; + pline->x = Vertices[seg->v1].x; + pline->y = Vertices[seg->v1].y; + pline->dx = Vertices[seg->v2].x - Vertices[seg->v1].x; + pline->dy = Vertices[seg->v2].y - Vertices[seg->v1].y; + } + Segs.Last().next = DWORD_MAX; + PlaneChecked.Reserve((Segs.Size() + 7) / 8); +} + // Find "loops" of segs surrounding polyobject's origin. Note that a polyobject's origin // is not solely defined by the polyobject's anchor, but also by the polyobject itself. // For the split avoidance to work properly, you must have a convex, complete loop of