From d972a10152988543d1ea38b261ee2a670bc21ee5 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Tue, 21 Jun 2022 22:05:27 -0600 Subject: [PATCH 1/3] parser: support quark comments --- common/parser.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/parser.cc b/common/parser.cc index 16312072..9bfd29b1 100644 --- a/common/parser.cc +++ b/common/parser.cc @@ -57,7 +57,7 @@ skipspace: } /* comment field */ - if (pos[0] == '/' && pos[1] == '/') { + if ((pos[0] == '/' && pos[1] == '/') || pos[0] == ';') { // quark writes ; comments in q2 maps if (flags & PARSE_COMMENT) { while (*pos && *pos != '\n') { *token_p++ = *pos++; From b77c25dcd430b6fbe61e8751a196382d6ebc82e3 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Tue, 21 Jun 2022 22:05:54 -0600 Subject: [PATCH 2/3] qbsp: fix -keepprt --- qbsp/qbsp.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qbsp/qbsp.cc b/qbsp/qbsp.cc index 06486583..00f1f1fe 100644 --- a/qbsp/qbsp.cc +++ b/qbsp/qbsp.cc @@ -904,7 +904,7 @@ static void ProcessEntity(mapentity_t *entity, const int hullnum) FreeTreePortals_r(tree->headnode); PruneNodes(tree->headnode); - if (hullnum <= 0 && entity == map.world_entity() && !map.leakfile) { + if (hullnum <= 0 && entity == map.world_entity() && (!map.leakfile || options.keepprt.value())) { WritePortalFile(tree); } From c054db0f48c1d3514d185d23bdcc96b51d9807e2 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Tue, 21 Jun 2022 23:46:13 -0600 Subject: [PATCH 3/3] testqbsp: shouldn't use -keepprt as the tests are checking for the .prt files --- qbsp/test_qbsp.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qbsp/test_qbsp.cc b/qbsp/test_qbsp.cc index 92edbf67..6a9102dd 100644 --- a/qbsp/test_qbsp.cc +++ b/qbsp/test_qbsp.cc @@ -169,7 +169,7 @@ static std::tuple> LoadTestmap(c auto bsp_path = map_path; bsp_path.replace_extension(".bsp"); - std::vector args{"", "-nopercent", "-keepprt"}; + std::vector args{"", "-nopercent"}; for (auto &arg : extra_args) { args.push_back(arg); }