From d917c253c5bea5c9673cbdf20d24fd44396c8d72 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 13 Jun 2022 02:20:34 -0400 Subject: [PATCH] restore inside fill to working status --- qbsp/outside.cc | 16 +++++++++++++++- qbsp/qbsp.cc | 5 ++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/qbsp/outside.cc b/qbsp/outside.cc index e21fcec1..688d7fe5 100644 --- a/qbsp/outside.cc +++ b/qbsp/outside.cc @@ -506,6 +506,16 @@ static int OutLeafsToSolid(node_t *node) //============================================================================= +static void SetOccupied_R(node_t *node, int dist) +{ + if (node->planenum != PLANENUM_LEAF) { + SetOccupied_R(node->children[0], dist); + SetOccupied_R(node->children[1], dist); + } + + node->occupied = dist; +} + /* ================== precondition: all leafs have occupied set to 0 @@ -527,7 +537,11 @@ static void BFSFloodFillFromOccupiedLeafs(const std::vector &occupied_ if (node->occupied == 0) { // we haven't visited this node yet - node->occupied = dist; + if (node->detail_separator) { + SetOccupied_R(node, dist); + } else { + node->occupied = dist; + } // push neighbouring nodes onto the back of the queue int side; diff --git a/qbsp/qbsp.cc b/qbsp/qbsp.cc index a51876ce..ce4e3cba 100644 --- a/qbsp/qbsp.cc +++ b/qbsp/qbsp.cc @@ -171,12 +171,11 @@ void qbsp_settings::postinitialize(int argc, const char **argv) } // side effects from Quake II - // fixme-brushbsp: enable when it's working - /*if (q2bsp.value() || qbism.value()) { + if (q2bsp.value() || qbism.value()) { if (!filltype.isChanged()) { filltype.setValueLocked(filltype_t::INSIDE); } - }*/ + } common_settings::postinitialize(argc, argv); }