From fc60eaccb88f13bd7e9419d98ea293184506bf40 Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Tue, 10 Aug 2021 09:14:32 +0100 Subject: [PATCH] Quickhull - reduce warning spam and make hideable Added one more warning to the hideable warnings. These seem to be benign warnings and are hidden during use in rooms and portals. When used from other areas, only one warning is displayed per run, instead of for every occurrence. --- core/math/quick_hull.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/math/quick_hull.cpp b/core/math/quick_hull.cpp index 42a5ffbc410..cb90463b908 100644 --- a/core/math/quick_hull.cpp +++ b/core/math/quick_hull.cpp @@ -364,6 +364,7 @@ Error QuickHull::build(const Vector &p_points, Geometry::MeshData &r_me bool warning_f = false; bool warning_o_equal_e = false; bool warning_o = false; + bool warning_not_f2 = false; for (List::Element *E = ret_faces.front(); E; E = E->next()) { Geometry::MeshData::Face &f = E->get(); @@ -413,7 +414,12 @@ Error QuickHull::build(const Vector &p_points, Geometry::MeshData &r_me Edge e2(idx, idxn); Map::Element *F2 = ret_edges.find(e2); - ERR_CONTINUE(!F2); + + if (unlikely(!F2)) { + warning_not_f2 = true; + continue; + } + //change faceconnect, point to this face instead if (F2->get().left == O) { F2->get().left = E; @@ -453,6 +459,9 @@ Error QuickHull::build(const Vector &p_points, Geometry::MeshData &r_me if (warning_o) { WARN_PRINT("QuickHull : O == nullptr"); } + if (warning_not_f2) { + WARN_PRINT("QuickHull : !F2"); + } } //fill mesh