qbsp: move FreeTreePortals to tree.cc
This commit is contained in:
parent
fce258a7b7
commit
ac80d11e69
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
||||
/*
|
||||
=========================================================
|
||||
|
||||
|
|
|
|||
24
qbsp/tree.cc
24
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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue