diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-05-21 15:00:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-21 15:00:27 +0200 |
commit | 8c2beeea907cb39baac20df198392ae4fdf64029 (patch) | |
tree | a3488c4bacd835e83a7b6a64ea3b7eda72de9199 | |
parent | e773bf56edef87de70c48515cdbe01340ef80b13 (diff) | |
parent | d16bef8b55e6c978da44ea3c4b0822340e15027c (diff) |
Merge pull request #48921 from timothyqiu/polypartition-stl
Fix STL to Godot type convertion of polypartition
-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; } |