diff --git a/include/light/light.hh b/include/light/light.hh index 279301fb..4f4fa30d 100644 --- a/include/light/light.hh +++ b/include/light/light.hh @@ -415,6 +415,7 @@ public: setting_func debugoccluded; setting_func debugneighbours; setting_func debugmottle; + setting_bool debug_lightgrid_octree; light_settings(); diff --git a/include/qbsp/qbsp.hh b/include/qbsp/qbsp.hh index 296919cc..4e8c8ddd 100644 --- a/include/qbsp/qbsp.hh +++ b/include/qbsp/qbsp.hh @@ -232,6 +232,7 @@ public: setting_scalar scale; setting_bool loghulls; setting_bool logbmodels; + setting_bool debug_missing_portal_sides; void set_parameters(int argc, const char **argv) override; void initialize(int argc, const char **argv) override; diff --git a/light/light.cc b/light/light.cc index d0a0780f..ac4c0713 100644 --- a/light/light.cc +++ b/light/light.cc @@ -426,7 +426,9 @@ light_settings::light_settings() debugmode = debugmodes::mottle; return true; }, - &debug_group, "save mottle pattern to lightmap"} + &debug_group, "save mottle pattern to lightmap"}, + + debug_lightgrid_octree{this, "debug_lightgrid_octree", false, &debug_group, "write .octree.prt file for light grid"} { } diff --git a/light/lightgrid.cc b/light/lightgrid.cc index fc07839a..143226f8 100644 --- a/light/lightgrid.cc +++ b/light/lightgrid.cc @@ -235,7 +235,7 @@ static std::vector MakeOctreeLump(const mbsp_t &bsp, const lightgrid_ra const uint32_t root_node = build_octree(qvec3i{0, 0, 0}, data.grid_size, 0); // visualize the leafs - { + if (light_options.debug_lightgrid_octree.value()) { std::vector windings; for (auto &leaf : octree_leafs) { diff --git a/qbsp/portals.cc b/qbsp/portals.cc index 99e4fa76..d7bf0d33 100644 --- a/qbsp/portals.cc +++ b/qbsp/portals.cc @@ -1179,7 +1179,7 @@ void MarkVisibleSides(tree_t &tree, bspbrush_t::container &brushes) // set visible flags on the sides that are used by portals MarkVisibleSides_r(tree.headnode, stats); - if (!stats.missing_portal_sides.empty()) { + if (!stats.missing_portal_sides.empty() && qbsp_options.debug_missing_portal_sides.value()) { fs::path name = qbsp_options.bsp_path; name.replace_extension("missing_portal_sides.prt"); WriteDebugPortals(stats.missing_portal_sides, name); diff --git a/qbsp/qbsp.cc b/qbsp/qbsp.cc index 75cddee1..4ec0949d 100644 --- a/qbsp/qbsp.cc +++ b/qbsp/qbsp.cc @@ -562,7 +562,8 @@ qbsp_settings::qbsp_settings() scale{this, "scale", 1.0, &map_development_group, "scales the map brushes and point entity origins by a give factor"}, loghulls{this, {"loghulls"}, false, &logging_group, "print log output for collision hulls"}, - logbmodels{this, {"logbmodels"}, false, &logging_group, "print log output for bmodels"} + logbmodels{this, {"logbmodels"}, false, &logging_group, "print log output for bmodels"}, + debug_missing_portal_sides{this, {"debug_missing_portal_sides"}, false, &logging_group, "output debug .prt files for missing portal sides"} { }