From c6fabb290d1004c0313588c9b6fddf2d243600c0 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Fri, 5 Aug 2022 09:08:33 -0400 Subject: [PATCH] clean up stat printing a bit --- qbsp/brush.cc | 2 ++ qbsp/brushbsp.cc | 30 +++++++++++++++++++++++------- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/qbsp/brush.cc b/qbsp/brush.cc index 12a61ad2..09a71f06 100644 --- a/qbsp/brush.cc +++ b/qbsp/brush.cc @@ -615,6 +615,8 @@ void Brush_LoadEntity(mapentity_t *entity, const int hullnum) } } + logging::header("CountBrushes"); + qbsp_options.target_game->print_content_stats(*stats, "brushes"); } diff --git a/qbsp/brushbsp.cc b/qbsp/brushbsp.cc index 1573fa25..f4e94a1d 100644 --- a/qbsp/brushbsp.cc +++ b/qbsp/brushbsp.cc @@ -1139,14 +1139,30 @@ static std::unique_ptr BrushBSP(mapentity_t *entity, std::vectorheadnode.get(), std::move(brushlist), forced_quick_tree, stats); logging::print(logging::flag::STAT, " {:8} visible nodes\n", stats.c_nodes - stats.c_nonvis); - logging::print(logging::flag::STAT, " {:8} nonvis nodes\n", stats.c_nonvis); - logging::print(logging::flag::STAT, " {:8} block split nodes\n", stats.c_blocksplit); - logging::print(logging::flag::STAT, " {:8} expensive split nodes\n", stats.c_qbsp3); - logging::print(logging::flag::STAT, " {:8} midsplit nodes\n", stats.c_midsplit); + if (stats.c_nonvis) { + logging::print(logging::flag::STAT, " {:8} nonvis nodes\n", stats.c_nonvis); + } + if (stats.c_blocksplit) { + logging::print(logging::flag::STAT, " {:8} block split nodes\n", stats.c_blocksplit); + } + if (stats.c_qbsp3) { + logging::print(logging::flag::STAT, " {:8} expensive split nodes\n", stats.c_qbsp3); + } + if (stats.c_midsplit) { + logging::print(logging::flag::STAT, " {:8} midsplit nodes\n", stats.c_midsplit); + } logging::print(logging::flag::STAT, " {:8} leafs\n", stats.c_leafs); - logging::print(logging::flag::STAT, " {:8} bogus brushes\n", stats.c_bogus); - logging::print(logging::flag::STAT, " {:8} brushes removed from a split\n", stats.c_brushesremoved); - logging::print(logging::flag::STAT, " {:8} brushes split only on one side\n", stats.c_brushesonesided); + if (stats.c_bogus) { + logging::print(logging::flag::STAT, " {:8} bogus brushes\n", stats.c_bogus); + } + if (stats.c_brushesremoved) { + logging::print(logging::flag::STAT, " {:8} brushes removed from a split\n", stats.c_brushesremoved); + } + if (stats.c_brushesonesided) { + logging::print(logging::flag::STAT, " {:8} brushes split only on one side\n", stats.c_brushesonesided); + } + + logging::header("CountLeafs"); qbsp_options.target_game->print_content_stats(*stats.leafstats, "leafs"); return tree;