From cba902facd734fe177c46d5b03e6ada1967e3e62 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Thu, 30 May 2024 22:44:19 -0600 Subject: [PATCH 1/3] add test case for portal_can_see_through fix --- tests/test_common.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_common.cc b/tests/test_common.cc index 678e7835..7d31b59a 100644 --- a/tests/test_common.cc +++ b/tests/test_common.cc @@ -328,6 +328,14 @@ TEST_SUITE("common") } } + TEST_CASE("q2 portal_can_see_through") + { + auto *game_q2 = bspver_q2.game; + + CHECK(game_q2->portal_can_see_through(contentflags_t::make(EWT_VISCONTENTS_DETAIL_WALL | EWT_CFLAG_DETAIL), + contentflags_t::make(EWT_INVISCONTENTS_PLAYERCLIP), false)); + } + TEST_CASE("imglib png loader") { auto *game = bspver_q2.game; From d090a8f476a3a4028944002fee7e774eb01aa831 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Fri, 31 May 2024 21:53:47 -0600 Subject: [PATCH 2/3] Changelog for 2.0.0-alpha8 --- docs/changelog.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 18371c6f..a9efe15f 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -2,6 +2,30 @@ Changelog ========= +2.0.0-alpha8 +============ + +Changes +------- + +- light: invalid "delay" settings are now a warning rather than a fatal error +- qbsp: q2: write out true leaf contents even if CONTENTS_SOLID is set. Previous + behaviour (including original qbsp3 compiler) was that CONTENTS_SOLID would + clear any other set contents bits in leafs (but not in brushes.) (#420) + +Features +-------- + +- lightpreview: show leaf contents in status bar +- light: LIGHTING_E5BGR9 + HDR .lit support (from @dsvensson and @Shpoike) + +Bug fixes +--------- + +- light: fix "mangle" on _sun 1 entities (#266) +- light: fix sunlight artifacts (21b3b696) +- qbsp: q2: fix areaportals which were broken in 2.0.0-alpha7 (70a08013) + 2.0.0-alpha7 ============ From e44d73a05bb318eaa5c9f09bc462057de3fb06c9 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Sat, 1 Jun 2024 11:53:56 -0600 Subject: [PATCH 3/3] tests: failing test for noclipfaces choosing to use a nodraw face which ends up defeating the point of _noclipfaces 1 --- testmaps/q2_noclipfaces_nodraw.map | 30 ++++++++++++++++++++++++++++++ tests/test_qbsp_q2.cc | 18 ++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 testmaps/q2_noclipfaces_nodraw.map diff --git a/testmaps/q2_noclipfaces_nodraw.map b/testmaps/q2_noclipfaces_nodraw.map new file mode 100644 index 00000000..64600233 --- /dev/null +++ b/testmaps/q2_noclipfaces_nodraw.map @@ -0,0 +1,30 @@ +// Game: Quake 2 +// Format: Quake2 +// entity 0 +{ +"classname" "worldspawn" +"_tb_textures" "textures/e1u1" +// brush 0 +{ +( -64 -64 -32 ) ( -64 -63 -32 ) ( -64 -64 -31 ) e1u1/water1_8 0 -16 0 1 1 32 0 0 +( -64 -64 -32 ) ( -64 -64 -31 ) ( -63 -64 -32 ) e1u1/water1_8 0 -16 0 1 1 32 0 0 +( -64 -64 -32 ) ( -63 -64 -32 ) ( -64 -63 -32 ) e1u1/water1_8 0 0 0 1 1 32 0 0 +( 64 64 0 ) ( 64 65 0 ) ( 65 64 0 ) e1u1/water1_8 0 0 0 1 1 32 0 0 +( 64 64 0 ) ( 65 64 0 ) ( 64 64 1 ) e1u1/water1_8 0 -16 0 1 1 32 0 0 +( 64 64 0 ) ( 64 64 1 ) ( 64 65 0 ) e1u1/water1_8 0 -16 0 1 1 32 0 0 +} +} +// entity 1 +{ +"classname" "func_group" +"_noclipfaces" "1" +// brush 0 +{ +( -112 -64 0 ) ( -112 -63 0 ) ( -112 -64 1 ) e1u1/water8 0 16 0 1 1 32 152 0 +( -64 -112 0 ) ( -64 -112 1 ) ( -63 -112 0 ) e1u1/water8 0 16 0 1 1 32 152 0 +( -64 -64 0 ) ( -63 -64 0 ) ( -64 -63 0 ) e1u1/water8 0 0 0 1 1 32 152 0 +( 64 64 32 ) ( 64 65 32 ) ( 65 64 32 ) e1u1/water8 0 0 0 1 1 32 152 0 +( 64 128 32 ) ( 65 128 32 ) ( 64 128 33 ) e1u1/water8 0 16 0 1 1 32 152 0 +( 176 64 32 ) ( 176 64 33 ) ( 176 65 32 ) e1u1/water8 0 16 0 1 1 32 152 0 +} +} diff --git a/tests/test_qbsp_q2.cc b/tests/test_qbsp_q2.cc index 80c2dea9..f19192f8 100644 --- a/tests/test_qbsp_q2.cc +++ b/tests/test_qbsp_q2.cc @@ -1093,4 +1093,22 @@ TEST_CASE("q2_unknown_contents" * doctest::test_suite("testmaps_q2")) CHECK(texinfo->flags.native == 1024); } +} + +TEST_CASE("q2_noclipfaces_nodraw" * doctest::test_suite("testmaps_q2") * doctest::may_fail()) +{ + INFO("when _noclipfaces has a choice of faces, don't use the nodraw one"); + + const auto [bsp, bspx, prt] = LoadTestmapQ2("q2_noclipfaces_nodraw.map"); + + const qvec3d top_of_water = {0, 0, 0}; + + auto up_faces = BSP_FindFacesAtPoint(&bsp, &bsp.dmodels[0], top_of_water, {0, 0, 1}); + auto down_faces = BSP_FindFacesAtPoint(&bsp, &bsp.dmodels[0], top_of_water, {0, 0, -1}); + + REQUIRE(1 == up_faces.size()); + REQUIRE(1 == down_faces.size()); + + CHECK(Face_TextureNameView(&bsp, up_faces[0]) == "e1u1/water1_8"); + CHECK(Face_TextureNameView(&bsp, down_faces[0]) == "e1u1/water1_8"); } \ No newline at end of file