From 5ea786702b709ff3e426c3386220a8cb9faa3d4d Mon Sep 17 00:00:00 2001 From: Jonathan Date: Sun, 30 Oct 2022 15:29:42 -0400 Subject: [PATCH] always include NODRAW + LIGHT --- qbsp/faces.cc | 7 +++++++ qbsp/writebsp.cc | 13 +++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/qbsp/faces.cc b/qbsp/faces.cc index 5db4e7f1..e661d95b 100644 --- a/qbsp/faces.cc +++ b/qbsp/faces.cc @@ -43,7 +43,14 @@ struct makefaces_stats_t : logging::stat_tracker_t static bool ShouldOmitFace(face_t *f) { if (!qbsp_options.includeskip.value() && f->get_texinfo().flags.is_nodraw) + { + // TODO: move to game specific + // always include LIGHT + if (qbsp_options.target_game->id == GAME_QUAKE_II && (f->get_texinfo().flags.native & Q2_SURF_LIGHT)) + return false; + return true; + } if (map.mtexinfos.at(f->texinfo).flags.is_hint) return true; diff --git a/qbsp/writebsp.cc b/qbsp/writebsp.cc index 805dad6f..8574b339 100644 --- a/qbsp/writebsp.cc +++ b/qbsp/writebsp.cc @@ -60,7 +60,12 @@ size_t ExportMapTexinfo(size_t texinfonum) if (src.outputnum.has_value()) return src.outputnum.value(); else if (!qbsp_options.includeskip.value() && src.flags.is_nodraw) - return -1; + { + // TODO: move to game specific + // always include LIGHT + if (qbsp_options.target_game->id != GAME_QUAKE_II || !(src.flags.native & Q2_SURF_LIGHT)) + return -1; + } // this will be the index of the exported texinfo in the BSP lump const size_t i = map.bsp.texinfo.size(); @@ -172,7 +177,11 @@ static void ExportLeaf(node_t *node) for (auto &face : node->markfaces) { if (!qbsp_options.includeskip.value() && face->get_texinfo().flags.is_nodraw) { - continue; + + // TODO: move to game specific + // always include LIGHT + if (qbsp_options.target_game->id != GAME_QUAKE_II || !(face->get_texinfo().flags.native & Q2_SURF_LIGHT)) + continue; } /* grab final output faces */