diff --git a/include/qbsp/portals.hh b/include/qbsp/portals.hh index 7d3f36aa..81d900c4 100644 --- a/include/qbsp/portals.hh +++ b/include/qbsp/portals.hh @@ -40,16 +40,6 @@ struct tree_t aabb3d bounds; }; -class portal_state_t -{ -public: - int num_visportals; - int num_visleafs; // leafs the player can be in - int num_visclusters; // clusters of leafs - int iNodesDone; - bool uses_detail; -}; - struct portalstats_t { std::atomic c_tinyportals; }; @@ -61,4 +51,4 @@ void MakeTreePortals(tree_t *tree); void FreeTreePortals_r(node_t *node); void AssertNoPortals(node_t *node); void MakeHeadnodePortals(tree_t *tree); -void CutNodePortals_r(node_t *node, portal_state_t *state); +void CutNodePortals_r(node_t *node); diff --git a/qbsp/portals.cc b/qbsp/portals.cc index e5f8253a..1dd06292 100644 --- a/qbsp/portals.cc +++ b/qbsp/portals.cc @@ -473,7 +473,7 @@ void MakeTreePortals_new(tree_t *tree) CutNodePortals_r ================ */ -void CutNodePortals_r(node_t *node, portal_state_t *state) +void CutNodePortals_r(node_t *node) { node_t *front, *back, *other_node; portal_t *portal, *new_portal, *next_portal; @@ -584,11 +584,8 @@ void CutNodePortals_r(node_t *node, portal_state_t *state) } } - /* Display progress */ - logging::percent(state->iNodesDone++, splitnodes); - - CutNodePortals_r(front, state); - CutNodePortals_r(back, state); + CutNodePortals_r(front); + CutNodePortals_r(back); } void AssertNoPortals(node_t *node) @@ -610,15 +607,11 @@ Builds the exact polyhedrons for the nodes and leafs */ void MakeTreePortals(tree_t *tree) { - portal_state_t state{}; - - state.iNodesDone = 0; - FreeTreePortals_r(tree->headnode); AssertNoPortals(tree->headnode); MakeHeadnodePortals(tree); - CutNodePortals_r(tree->headnode, &state); + CutNodePortals_r(tree->headnode); } /* diff --git a/qbsp/prtfile.cc b/qbsp/prtfile.cc index d091c848..ee1afab1 100644 --- a/qbsp/prtfile.cc +++ b/qbsp/prtfile.cc @@ -147,6 +147,14 @@ static int WriteClusters_r(node_t *node, std::ofstream &portalFile, int visclust return viscluster; } +struct portal_state_t +{ + int num_visportals; + int num_visleafs; // leafs the player can be in + int num_visclusters; // clusters of leafs + bool uses_detail; +}; + static void CountPortals(const node_t *node, portal_state_t *state) { const portal_t *portal; @@ -297,14 +305,12 @@ void WritePortalFile(tree_t *tree) portal_state_t state{}; - state.iNodesDone = 0; - FreeTreePortals_r(tree->headnode); AssertNoPortals(tree->headnode); MakeHeadnodePortals(tree); - CutNodePortals_r(tree->headnode, &state); + CutNodePortals_r(tree->headnode); /* save portal file for vis tracing */ WritePortalfile(tree->headnode, &state);