Skip to content
This repository has been archived by the owner on Feb 22, 2021. It is now read-only.

Commit

Permalink
Remove ERR_EXPLAIN in favor of *_MSG macros
Browse files Browse the repository at this point in the history
Fixes build against Godot 3.2.beta, namely: godotengine/godot#33517.
  • Loading branch information
Xrayez committed Nov 15, 2019
1 parent d359a4b commit 5530ae1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
18 changes: 4 additions & 14 deletions clipper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ void Clipper::add_points(const Vector<Vector2> &points) {

void Clipper::execute(bool build_hierarchy) {

ERR_EXPLAIN("Cannot build hierarchy outside of MODE_CLIP");
ERR_FAIL_COND(build_hierarchy && mode != MODE_CLIP)
ERR_FAIL_COND_MSG(build_hierarchy && mode != MODE_CLIP, "Cannot build hierarchy outside of MODE_CLIP");

switch (mode) {

Expand Down Expand Up @@ -81,20 +80,12 @@ int Clipper::get_solution_count(SolutionType type) const {
Vector<Vector2> Clipper::get_solution(int idx, SolutionType type) {

switch (type) {

case TYPE_CLOSED: {

ERR_EXPLAIN("Closed solution not found");
ERR_FAIL_INDEX_V(idx, solution_closed.size(), Vector<Vector2>());

ERR_FAIL_INDEX_V_MSG(idx, solution_closed.size(), Vector<Vector2>(), "Closed solution not found");
return _scale_down(solution_closed[idx], PRECISION);
} break;

case TYPE_OPEN: {

ERR_EXPLAIN("Open solution not found");
ERR_FAIL_INDEX_V(idx, solution_open.size(), Vector<Vector2>());

ERR_FAIL_INDEX_V_MSG(idx, solution_open.size(), Vector<Vector2>(), "Open solution not found");
return _scale_down(solution_open[idx], PRECISION);
} break;
}
Expand All @@ -103,8 +94,7 @@ Vector<Vector2> Clipper::get_solution(int idx, SolutionType type) {

Rect2 Clipper::get_bounds() {

ERR_EXPLAIN("Cannot get solution bounds in MODE_OFFSET");
ERR_FAIL_COND_V(mode == MODE_OFFSET, Rect2());
ERR_FAIL_COND_V_MSG(mode == MODE_OFFSET, Rect2(), "Cannot get solution bounds in MODE_OFFSET");

cl::Rect64 b(0, 0, 0, 0);

Expand Down
10 changes: 3 additions & 7 deletions thirdparty/clipper2/clipper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,9 +592,7 @@ namespace clipperlib {
void Clipper::AddPath(const Path &path, PathType polytype, bool is_open)
{
if (is_open) {
ERR_EXPLAINC("AddPath: Only subject paths may be open.");
ERR_FAIL_COND(polytype == ptClip)

ERR_FAIL_COND_MSG(polytype == ptClip,"AddPath: Only subject paths may be open.")
has_open_paths_ = true;
}
minima_list_sorted_ = false;
Expand Down Expand Up @@ -968,8 +966,7 @@ namespace clipperlib {

void Clipper::AddLocalMaxPoly(Active &e1, Active &e2, const Point64 pt)
{
ERR_EXPLAINC("Error in AddLocalMaxPoly().");
ERR_FAIL_COND(!IsHotEdge(e2))
ERR_FAIL_COND_MSG(!IsHotEdge(e2), "Error in AddLocalMaxPoly().");

AddOutPt(e1, pt);
if (e1.outrec == e2.outrec) {
Expand All @@ -994,8 +991,7 @@ namespace clipperlib {
SwapSides(*e2.outrec);
}
else if (!FixOrientation(e1) && !FixOrientation(e2)) {
ERR_EXPLAINC("Error in JoinOutrecPaths()");
ERR_FAIL();
ERR_FAIL_MSG("Error in JoinOutrecPaths()");
}

if (e1.outrec->owner == e2.outrec) e1.outrec->owner = e2.outrec->owner;
Expand Down

0 comments on commit 5530ae1

Please sign in to comment.