diff --git a/include/qbsp/portals.hh b/include/qbsp/portals.hh index f7eee628..cf1c4c5b 100644 --- a/include/qbsp/portals.hh +++ b/include/qbsp/portals.hh @@ -54,7 +54,6 @@ bool Portal_EntityFlood(const portal_t *p, int32_t s); void MakeNodePortal(tree_t *tree, node_t *node, portalstats_t &stats); void SplitNodePortals(tree_t *tree, node_t *node, portalstats_t &stats); void MakeTreePortals(tree_t *tree); -void FreeTreePortals(tree_t *tree); void AssertNoPortals(tree_t *tree); void MakeHeadnodePortals(tree_t *tree); void EmitAreaPortals(node_t *headnode); diff --git a/include/qbsp/tree.hh b/include/qbsp/tree.hh index e97a9f82..50d58be3 100644 --- a/include/qbsp/tree.hh +++ b/include/qbsp/tree.hh @@ -46,5 +46,6 @@ struct tree_t portal_t *create_portal(); }; +void FreeTreePortals(tree_t *tree); void DetailToSolid(node_t *node); void PruneNodes(node_t *node); diff --git a/qbsp/portals.cc b/qbsp/portals.cc index 7b70daee..39a65663 100644 --- a/qbsp/portals.cc +++ b/qbsp/portals.cc @@ -478,30 +478,6 @@ void AssertNoPortals(tree_t *tree) Q_assert(tree->portals.empty()); } -/* -================== -FreeTreePortals_r - -================== -*/ -static void ClearNodePortals_r(node_t *node) -{ - if (node->planenum != PLANENUM_LEAF) { - ClearNodePortals_r(node->children[0].get()); - ClearNodePortals_r(node->children[1].get()); - } - - node->portals = nullptr; -} - -void FreeTreePortals(tree_t *tree) -{ - ClearNodePortals_r(tree->headnode.get()); - tree->outside_node.portals = nullptr; - - tree->portals.clear(); -} - /* ========================================================= diff --git a/qbsp/tree.cc b/qbsp/tree.cc index fcce4f41..c74031d5 100644 --- a/qbsp/tree.cc +++ b/qbsp/tree.cc @@ -37,6 +37,30 @@ portal_t *tree_t::create_portal() return result; } +/* +================== +FreeTreePortals_r + +================== +*/ +static void ClearNodePortals_r(node_t *node) +{ + if (node->planenum != PLANENUM_LEAF) { + ClearNodePortals_r(node->children[0].get()); + ClearNodePortals_r(node->children[1].get()); + } + + node->portals = nullptr; +} + +void FreeTreePortals(tree_t *tree) +{ + ClearNodePortals_r(tree->headnode.get()); + tree->outside_node.portals = nullptr; + + tree->portals.clear(); +} + //============================================================================ static void ConvertNodeToLeaf(node_t *node, const contentflags_t &contents)