qbsp: implement -omitdetail for q2
This commit is contained in:
parent
5d3fab75b6
commit
12d82db8b1
|
|
@ -732,6 +732,8 @@ static void Brush_LoadEntity(mapentity_t &dst, mapentity_t &src, hull_index_t hu
|
||||||
continue;
|
continue;
|
||||||
if ((qbsp_options.omitdetail.value() || qbsp_options.omitdetailwall.value()) && detail_wall)
|
if ((qbsp_options.omitdetail.value() || qbsp_options.omitdetailwall.value()) && detail_wall)
|
||||||
continue;
|
continue;
|
||||||
|
if (qbsp_options.omitdetail.value() && contents.is_any_detail(qbsp_options.target_game))
|
||||||
|
continue;
|
||||||
|
|
||||||
/* turn solid brushes into detail, if we're in hull0 */
|
/* turn solid brushes into detail, if we're in hull0 */
|
||||||
if (hullnum <= 0 && contents.is_solid(qbsp_options.target_game)) {
|
if (hullnum <= 0 && contents.is_solid(qbsp_options.target_game)) {
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,21 @@ TEST_CASE("detail" * doctest::test_suite("testmaps_q2")) {
|
||||||
CHECK(prt->portalleafs == 4);
|
CHECK(prt->portalleafs == 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("q2 detail with -omitdetail" * doctest::test_suite("testmaps_q2")) {
|
||||||
|
const auto [bsp, bspx, prt] = LoadTestmapQ2("qbsp_q2_detail.map", {"-omitdetail"});
|
||||||
|
|
||||||
|
CHECK(GAME_QUAKE_II == bsp.loadversion->game->id);
|
||||||
|
|
||||||
|
const qvec3d inside_button{246, 436, 98};
|
||||||
|
const qvec3d above_button{246, 436, 120};
|
||||||
|
|
||||||
|
auto *inside_button_leaf = BSP_FindLeafAtPoint(&bsp, &bsp.dmodels[0], inside_button);
|
||||||
|
CHECK(Q2_CONTENTS_EMPTY == inside_button_leaf->contents);
|
||||||
|
|
||||||
|
auto *above_button_leaf = BSP_FindLeafAtPoint(&bsp, &bsp.dmodels[0], above_button);
|
||||||
|
CHECK(inside_button_leaf == above_button_leaf);
|
||||||
|
}
|
||||||
|
|
||||||
TEST_CASE("playerclip" * doctest::test_suite("testmaps_q2"))
|
TEST_CASE("playerclip" * doctest::test_suite("testmaps_q2"))
|
||||||
{
|
{
|
||||||
const auto [bsp, bspx, prt] = LoadTestmapQ2("qbsp_q2_playerclip.map");
|
const auto [bsp, bspx, prt] = LoadTestmapQ2("qbsp_q2_playerclip.map");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue