From 7e7d851fdbc55b46044b8270a76b5a21ce0298fd Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Sat, 12 Sep 2015 23:22:43 -0600 Subject: [PATCH] qbsp: DividePlane: add missing recalculation of surface bbox for the parallel case. Thanks to rebb for the idea, txqbsp has the workaround in SelectPartition that recomputes the surface bbox; I think this fixes the underlying bug though. Note: this makes telefragged.map (from the RRP devkit) leak in hull 2. However, the point file starts at a func_detail staircase that, if turned into func_wall, fixes the leak. --- qbsp/solidbsp.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/qbsp/solidbsp.c b/qbsp/solidbsp.c index 3016f150..e5d6ae1e 100644 --- a/qbsp/solidbsp.c +++ b/qbsp/solidbsp.c @@ -524,6 +524,17 @@ DividePlane(surface_t *in, plane_t *split, surface_t **front, } } + // ericw -- added these CalcSurfaceInfo to recalculate the surf bbox. + // pretty sure their omission here was a bug. + // It's tied to options.maxNodeSize because that change needs + // valid bboxes to work well (txqbsp-xt calculated the node bbox from + // faces in SelectPartition) + if (options.maxNodeSize >= 64) { + // recalc bboxes and flags + CalcSurfaceInfo(newsurf); + CalcSurfaceInfo(in); + } + if (in->faces) *front = in; else