From 90e611b071497a168b6fff610f19d776e1287492 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Sat, 21 May 2022 23:22:39 -0600 Subject: [PATCH 1/4] build: fix ERICWTOOLS_ASAN with Catch2 on Windows --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index db8f7e14..b42a391c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,6 +75,11 @@ if (ERICWTOOLS_ASAN) message(STATUS "Enabling ASan on all targets") add_compile_options(-fsanitize=address) add_link_options(-fsanitize=address) + + # https://github.com/catchorg/Catch2/issues/898#issuecomment-841733322 + if (WIN32) + add_compile_definitions(CATCH_CONFIG_NO_WINDOWS_SEH) + endif() endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC") From ba884f6e1aab94e335e826b05dab60099b5798ae Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Sun, 22 May 2022 12:54:47 -0600 Subject: [PATCH 2/4] qbsp: CreateBrushFaces: list -> vector --- qbsp/brush.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qbsp/brush.cc b/qbsp/brush.cc index 1bedf962..7c4b8996 100644 --- a/qbsp/brush.cc +++ b/qbsp/brush.cc @@ -294,7 +294,7 @@ static std::vector CreateBrushFaces(const mapentity_t *src, hullbrush_t vec_t r; std::optional w; qbsp_plane_t plane; - std::list facelist; + std::vector facelist; qvec3d point; vec_t max, min; @@ -404,7 +404,7 @@ static std::vector CreateBrushFaces(const mapentity_t *src, hullbrush_t hullbrush->bounds = {-delta, delta}; } - return {std::make_move_iterator(facelist.begin()), std::make_move_iterator(facelist.end())}; + return facelist; } /* From d3ee17ac59e93ae90bfc57ccd371913225ec46ee Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Sun, 22 May 2022 13:16:27 -0600 Subject: [PATCH 3/4] testqbsp: remove -noprogress as it hinders debugging --- 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 7b950b44..2acc2553 100644 --- a/qbsp/test_qbsp.cc +++ b/qbsp/test_qbsp.cc @@ -99,7 +99,7 @@ static mbsp_t LoadTestmap(const std::filesystem::path &name, std::vector args{"", "-nopercent", "-noprogress", "-keepprt"}; + std::vector args{"", "-nopercent", "-keepprt"}; for (auto &arg : extra_args) { args.push_back(arg); } From e4f6201bbed0f5b5dd1ac376e9edd2000298e710 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Sun, 22 May 2022 13:17:06 -0600 Subject: [PATCH 4/4] testbqsp: add simple_sealed_rotated --- qbsp/test_qbsp.cc | 5 +- testmaps/qbsp_simple_sealed_rotated.map | 70 +++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 testmaps/qbsp_simple_sealed_rotated.map diff --git a/qbsp/test_qbsp.cc b/qbsp/test_qbsp.cc index 2acc2553..53500bf6 100644 --- a/qbsp/test_qbsp.cc +++ b/qbsp/test_qbsp.cc @@ -389,10 +389,11 @@ TEST_CASE("chop_no_change", "[testmaps_q1]") // TODO: ideally we should check we get back the same brush pointers from ChopBrushes } - TEST_CASE("simple_sealed", "[testmaps_q1]") { - mbsp_t result = LoadTestmap("qbsp_simple_sealed.map"); + auto mapname = GENERATE("qbsp_simple_sealed.map", "qbsp_simple_sealed_rotated.map"); + + mbsp_t result = LoadTestmap(mapname); REQUIRE(map.brushes.size() == 6); diff --git a/testmaps/qbsp_simple_sealed_rotated.map b/testmaps/qbsp_simple_sealed_rotated.map new file mode 100644 index 00000000..e53fd237 --- /dev/null +++ b/testmaps/qbsp_simple_sealed_rotated.map @@ -0,0 +1,70 @@ +// Game: Quake +// Format: Valve +// entity 0 +{ +"mapversion" "220" +"classname" "worldspawn" +"wad" "deprecated/free_wad.wad;deprecated/fence.wad;deprecated/origin.wad;deprecated/hintskip.wad" +"_wateralpha" "0.5" +"_tb_def" "builtin:Quake.fgd" +// brush 0 +{ +( 121.17142559585812 -0.8040405071069046 208 ) ( 63.195959492893095 -217.17142559585812 208 ) ( 121.17142559585812 -0.8040405071069046 48 ) orangestuff8 [ 0 -1 0 -16 ] [ 0 0 -1 -16 ] 0 2 2 +( 82.79187743515854 -205.8577170968734 48 ) ( 67.33706421453346 -201.71661237523304 48 ) ( 82.79187743515854 -205.8577170968734 208 ) orangestuff8 [ -1 0 0 -16 ] [ 0 0 -1 -16 ] 180 2 2 +( 136.6262388164832 -4.945145228747261 48 ) ( 121.17142559585812 -0.8040405071069046 48 ) ( 78.65077271351818 -221.31253031749847 48 ) orangestuff8 [ 1 0 0 16 ] [ 0 -1 0 -16 ] 180 2 2 +( 78.65077271351818 -221.31253031749847 208 ) ( 63.195959492893095 -217.17142559585812 208 ) ( 136.6262388164832 -4.945145228747261 208 ) orangestuff8 [ -1 0 0 -16 ] [ 0 -1 0 -16 ] 180 2 2 +( 132.48513409484283 -20.39995844937235 208 ) ( 117.03032087421775 -16.25885372773199 208 ) ( 132.48513409484283 -20.39995844937235 48 ) orangestuff8 [ 1 0 0 16 ] [ 0 0 -1 -16 ] 180 2 2 +( 78.65077271351818 -221.31253031749847 208 ) ( 136.6262388164832 -4.945145228747261 208 ) ( 78.65077271351818 -221.31253031749847 48 ) orangestuff8 [ 0 -1 0 -16 ] [ 0 0 -1 -16 ] 0 2 2 +} +// brush 1 +{ +( -168.6262388164832 -155.05485477125274 48 ) ( -110.6507727135182 61.31253031749847 48 ) ( -168.6262388164832 -155.05485477125274 208 ) orangestuff8 [ 0 1 0 16 ] [ 0 0 -1 -16 ] 0 2 2 +( -164.48513409484286 -139.60004155062765 208 ) ( -149.03032087421775 -143.741146272268 208 ) ( -164.48513409484286 -139.60004155062765 48 ) orangestuff8 [ -1 0 0 -16 ] [ 0 0 -1 -16 ] 180 2 2 +( -168.6262388164832 -155.05485477125274 48 ) ( -153.17142559585812 -159.1959594928931 48 ) ( -110.6507727135182 61.31253031749847 48 ) orangestuff8 [ 1 0 0 16 ] [ 0 -1 0 -16 ] 180 2 2 +( -110.6507727135182 61.31253031749847 208 ) ( -95.19595949289308 57.17142559585811 208 ) ( -168.6262388164832 -155.05485477125274 208 ) orangestuff8 [ -1 0 0 -16 ] [ 0 -1 0 -16 ] 180 2 2 +( -114.79187743515857 45.85771709687339 48 ) ( -99.33706421453346 41.71661237523303 48 ) ( -114.79187743515857 45.85771709687339 208 ) orangestuff8 [ 1 0 0 16 ] [ 0 0 -1 -16 ] 180 2 2 +( -153.17142559585812 -159.1959594928931 48 ) ( -153.17142559585812 -159.1959594928931 208 ) ( -95.19595949289308 57.17142559585811 48 ) orangestuff8 [ 0 1 0 16 ] [ 0 0 -1 -16 ] 0 2 2 +} +// brush 2 +{ +( -95.19595949289308 57.17142559585811 208 ) ( -99.33706421453346 41.71661237523303 208 ) ( -95.19595949289308 57.17142559585811 48 ) orangestuff8 [ 0 1 0 16 ] [ 0 0 -1 -16 ] 0 2 2 +( 117.03032087421775 -16.25885372773199 208 ) ( 117.03032087421775 -16.25885372773199 48 ) ( -99.33706421453346 41.71661237523303 208 ) orangestuff8 [ 1 0 0 16 ] [ 0 0 -1 -16 ] 180 2 2 +( -95.19595949289308 57.17142559585811 48 ) ( -99.33706421453346 41.71661237523303 48 ) ( 121.17142559585812 -0.8040405071069046 48 ) orangestuff8 [ 1 0 0 16 ] [ 0 -1 0 -16 ] 180 2 2 +( 121.17142559585812 -0.8040405071069046 208 ) ( 117.03032087421775 -16.25885372773199 208 ) ( -95.19595949289308 57.17142559585811 208 ) orangestuff8 [ -1 0 0 -16 ] [ 0 -1 0 -16 ] 180 2 2 +( 121.17142559585812 -0.8040405071069046 208 ) ( -95.19595949289308 57.17142559585811 208 ) ( 121.17142559585812 -0.8040405071069046 48 ) orangestuff8 [ 1 0 0 16 ] [ 0 0 -1 -16 ] 180 2 2 +( 121.17142559585812 -0.8040405071069046 48 ) ( 117.03032087421775 -16.25885372773199 48 ) ( 121.17142559585812 -0.8040405071069046 208 ) orangestuff8 [ 0 -1 0 -16 ] [ 0 0 -1 -16 ] 0 2 2 +} +// brush 3 +{ +( -153.17142559585812 -159.1959594928931 48 ) ( -149.03032087421775 -143.741146272268 48 ) ( -153.17142559585812 -159.1959594928931 208 ) orangestuff8 [ 0 1 0 16 ] [ 0 0 -1 -16 ] 0 2 2 +( 63.195959492893095 -217.17142559585812 48 ) ( -153.17142559585812 -159.1959594928931 48 ) ( 63.195959492893095 -217.17142559585812 208 ) orangestuff8 [ -1 0 0 -16 ] [ 0 0 -1 -16 ] 180 2 2 +( 63.195959492893095 -217.17142559585812 48 ) ( 67.33706421453346 -201.71661237523304 48 ) ( -153.17142559585812 -159.1959594928931 48 ) orangestuff8 [ 1 0 0 16 ] [ 0 -1 0 -16 ] 180 2 2 +( -153.17142559585812 -159.1959594928931 208 ) ( -149.03032087421775 -143.741146272268 208 ) ( 63.195959492893095 -217.17142559585812 208 ) orangestuff8 [ -1 0 0 -16 ] [ 0 -1 0 -16 ] 180 2 2 +( -149.03032087421775 -143.741146272268 48 ) ( 67.33706421453346 -201.71661237523304 48 ) ( -149.03032087421775 -143.741146272268 208 ) orangestuff8 [ -1 0 0 -16 ] [ 0 0 -1 -16 ] 180 2 2 +( 63.195959492893095 -217.17142559585812 208 ) ( 67.33706421453346 -201.71661237523304 208 ) ( 63.195959492893095 -217.17142559585812 48 ) orangestuff8 [ 0 -1 0 -16 ] [ 0 0 -1 -16 ] 0 2 2 +} +// brush 4 +{ +( -149.03032087421775 -143.741146272268 224 ) ( -149.03032087421775 -143.741146272268 208 ) ( -99.33706421453346 41.71661237523303 224 ) orangestuff8 [ 0 1 0 16 ] [ 0 0 -1 0 ] 0 2 2 +( 67.33706421453346 -201.71661237523304 224 ) ( 67.33706421453346 -201.71661237523304 208 ) ( -149.03032087421775 -143.741146272268 224 ) orangestuff8 [ -1 0 0 -16 ] [ 0 0 -1 0 ] 180 2 2 +( 117.03032087421775 -16.25885372773199 208 ) ( -99.33706421453346 41.71661237523303 208 ) ( 67.33706421453346 -201.71661237523304 208 ) orangestuff8 [ -1 0 0 -16 ] [ 0 -1 0 -16 ] 180 2 2 +( 117.03032087421775 -16.25885372773199 224 ) ( 67.33706421453346 -201.71661237523304 224 ) ( -99.33706421453346 41.71661237523303 224 ) orangestuff8 [ -1 0 0 -16 ] [ 0 -1 0 -16 ] 180 2 2 +( -99.33706421453346 41.71661237523303 224 ) ( -99.33706421453346 41.71661237523303 208 ) ( 117.03032087421775 -16.25885372773199 224 ) orangestuff8 [ 1 0 0 16 ] [ 0 0 -1 0 ] 180 2 2 +( 117.03032087421775 -16.25885372773199 224 ) ( 117.03032087421775 -16.25885372773199 208 ) ( 67.33706421453346 -201.71661237523304 224 ) orangestuff8 [ 0 -1 0 -16 ] [ 0 0 -1 0 ] 0 2 2 +} +// brush 5 +{ +( -99.33706421453346 41.71661237523303 32 ) ( -99.33706421453346 41.71661237523303 48 ) ( -149.03032087421775 -143.741146272268 32 ) bolt16 [ 0 1 0 16 ] [ 0 0 -1 32 ] 0 2 2 +( -149.03032087421775 -143.741146272268 32 ) ( -149.03032087421775 -143.741146272268 48 ) ( 67.33706421453346 -201.71661237523304 32 ) bolt16 [ -1 0 0 -16 ] [ 0 0 -1 32 ] 180 2 2 +( -99.33706421453346 41.71661237523303 32 ) ( -149.03032087421775 -143.741146272268 32 ) ( 117.03032087421775 -16.25885372773199 32 ) bolt16 [ 1 0 0 16 ] [ 0 -1 0 -16 ] 180 2 2 +( -149.03032087421775 -143.741146272268 48 ) ( -99.33706421453346 41.71661237523303 48 ) ( 67.33706421453346 -201.71661237523304 48 ) bolt16 [ 1 0 0 16 ] [ 0 -1 0 -16 ] 180 2 2 +( 117.03032087421775 -16.25885372773199 32 ) ( 117.03032087421775 -16.25885372773199 48 ) ( -99.33706421453346 41.71661237523303 32 ) bolt16 [ 1 0 0 16 ] [ 0 0 -1 32 ] 180 2 2 +( 67.33706421453346 -201.71661237523304 32 ) ( 67.33706421453346 -201.71661237523304 48 ) ( 117.03032087421775 -16.25885372773199 32 ) bolt16 [ 0 -1 0 -16 ] [ 0 0 -1 32 ] 0 2 2 +} +} +// entity 1 +{ +"classname" "info_player_start" +"origin" "-58.7781 -85.1021 120" +"angle" "345" +}