diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2021-05-21 17:12:13 +0800 |
---|---|---|
committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2021-05-21 17:24:32 +0800 |
commit | d16bef8b55e6c978da44ea3c4b0822340e15027c (patch) | |
tree | d1be8c9702113ac5aeb3f43bd220ebab884dc6ad /thirdparty | |
parent | 152a08b3142ebf7c59c1b7dc9cb9eb87c0adcd9f (diff) |
Fix STL to Godot type convertion of polypartition
Diffstat (limited to 'thirdparty')
-rw-r--r-- | thirdparty/misc/patches/polypartition-godot-types.patch | 14 | ||||
-rw-r--r-- | thirdparty/misc/polypartition.cpp | 10 |
2 files changed, 12 insertions, 12 deletions
diff --git a/thirdparty/misc/patches/polypartition-godot-types.patch b/thirdparty/misc/patches/polypartition-godot-types.patch index 59fdb2707c..782f02e8dc 100644 --- a/thirdparty/misc/patches/polypartition-godot-types.patch +++ b/thirdparty/misc/patches/polypartition-godot-types.patch @@ -1,5 +1,5 @@ diff --git a/thirdparty/misc/polypartition.cpp b/thirdparty/misc/polypartition.cpp -index 3a8a6efa8319..4f1b6dcb21d8 100644 +index 3a8a6efa83..5e94793b79 100644 --- a/thirdparty/misc/polypartition.cpp +++ b/thirdparty/misc/polypartition.cpp @@ -23,10 +23,7 @@ @@ -510,7 +510,7 @@ index 3a8a6efa8319..4f1b6dcb21d8 100644 - return 0; - } - numvertices += iter->GetNumPoints(); -+ for (iter = inpolys->front(); iter; iter++) { ++ for (iter = inpolys->front(); iter; iter = iter->next()) { + numvertices += iter->get().GetNumPoints(); } @@ -521,7 +521,7 @@ index 3a8a6efa8319..4f1b6dcb21d8 100644 polystartindex = 0; - for (iter = inpolys->begin(); iter != inpolys->end(); iter++) { - poly = &(*iter); -+ for (iter = inpolys->front(); iter; iter++) { ++ for (iter = inpolys->front(); iter; iter = iter->next()) { + poly = &(iter->get()); polyendindex = polystartindex + poly->GetNumPoints() - 1; for (i = 0; i < poly->GetNumPoints(); i++) { @@ -569,7 +569,7 @@ index 3a8a6efa8319..4f1b6dcb21d8 100644 newedge.p2 = v->p; edgeIter = edgeTree.lower_bound(newedge); - if (edgeIter == edgeTree.begin()) { -+ if (edgeIter == edgeTree.front()) { ++ if (edgeIter == nullptr || edgeIter == edgeTree.front()) { error = true; break; } @@ -606,7 +606,7 @@ index 3a8a6efa8319..4f1b6dcb21d8 100644 newedge.p2 = v->p; edgeIter = edgeTree.lower_bound(newedge); - if (edgeIter == edgeTree.begin()) { -+ if (edgeIter == edgeTree.front()) { ++ if (edgeIter == nullptr || edgeIter == edgeTree.front()) { error = true; break; } @@ -648,7 +648,7 @@ index 3a8a6efa8319..4f1b6dcb21d8 100644 newedge.p2 = v->p; edgeIter = edgeTree.lower_bound(newedge); - if (edgeIter == edgeTree.begin()) { -+ if (edgeIter == edgeTree.front()) { ++ if (edgeIter == nullptr || edgeIter == edgeTree.front()) { error = true; break; } @@ -716,7 +716,7 @@ index 3a8a6efa8319..4f1b6dcb21d8 100644 } } diff --git a/thirdparty/misc/polypartition.h b/thirdparty/misc/polypartition.h -index f163f5d2173f..b2d905a3ef76 100644 +index f163f5d217..b2d905a3ef 100644 --- a/thirdparty/misc/polypartition.h +++ b/thirdparty/misc/polypartition.h @@ -24,8 +24,9 @@ diff --git a/thirdparty/misc/polypartition.cpp b/thirdparty/misc/polypartition.cpp index 4f1b6dcb21..5e94793b79 100644 --- a/thirdparty/misc/polypartition.cpp +++ b/thirdparty/misc/polypartition.cpp @@ -1289,7 +1289,7 @@ int TPPLPartition::MonotonePartition(TPPLPolyList *inpolys, TPPLPolyList *monoto bool error = false; numvertices = 0; - for (iter = inpolys->front(); iter; iter++) { + for (iter = inpolys->front(); iter; iter = iter->next()) { numvertices += iter->get().GetNumPoints(); } @@ -1298,7 +1298,7 @@ int TPPLPartition::MonotonePartition(TPPLPolyList *inpolys, TPPLPolyList *monoto newnumvertices = numvertices; polystartindex = 0; - for (iter = inpolys->front(); iter; iter++) { + for (iter = inpolys->front(); iter; iter = iter->next()) { poly = &(iter->get()); polyendindex = polystartindex + poly->GetNumPoints() - 1; for (i = 0; i < poly->GetNumPoints(); i++) { @@ -1408,7 +1408,7 @@ int TPPLPartition::MonotonePartition(TPPLPolyList *inpolys, TPPLPolyList *monoto newedge.p1 = v->p; newedge.p2 = v->p; edgeIter = edgeTree.lower_bound(newedge); - if (edgeIter == edgeTree.front()) { + if (edgeIter == nullptr || edgeIter == edgeTree.front()) { error = true; break; } @@ -1449,7 +1449,7 @@ int TPPLPartition::MonotonePartition(TPPLPolyList *inpolys, TPPLPolyList *monoto newedge.p1 = v->p; newedge.p2 = v->p; edgeIter = edgeTree.lower_bound(newedge); - if (edgeIter == edgeTree.front()) { + if (edgeIter == nullptr || edgeIter == edgeTree.front()) { error = true; break; } @@ -1494,7 +1494,7 @@ int TPPLPartition::MonotonePartition(TPPLPolyList *inpolys, TPPLPolyList *monoto newedge.p1 = v->p; newedge.p2 = v->p; edgeIter = edgeTree.lower_bound(newedge); - if (edgeIter == edgeTree.front()) { + if (edgeIter == nullptr || edgeIter == edgeTree.front()) { error = true; break; } |