diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2022-05-24 15:10:48 +0200 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2022-05-24 15:11:39 +0200 |
commit | ce7099a35af9987bc9090aa0f916fbb01a54b137 (patch) | |
tree | c58ea9710ae7cab7ead351302d3f47885a390294 /scene/resources | |
parent | 4dd6f56c82fd87b85ad483e6f95585a83cd88a12 (diff) |
Tweak TextMesh decomposition error message to mention self-intersecting lines
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/primitive_meshes.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp index 64982650e0..36c8a9b435 100644 --- a/scene/resources/primitive_meshes.cpp +++ b/scene/resources/primitive_meshes.cpp @@ -2339,18 +2339,18 @@ void TextMesh::_generate_glyph_mesh_data(uint32_t p_hash, const Glyph &p_gl) con //Decompose and triangulate. List<TPPLPoly> out_poly; if (tpart.ConvexPartition_HM(&in_poly, &out_poly) == 0) { - ERR_FAIL_MSG("Convex decomposing failed!"); + ERR_FAIL_MSG("Convex decomposing failed. Make sure the font doesn't contain self-intersecting lines, as these are not supported in TextMesh."); } List<TPPLPoly> out_tris; for (List<TPPLPoly>::Element *I = out_poly.front(); I; I = I->next()) { if (tpart.Triangulate_OPT(&(I->get()), &out_tris) == 0) { - ERR_FAIL_MSG("Triangulation failed!"); + ERR_FAIL_MSG("Triangulation failed. Make sure the font doesn't contain self-intersecting lines, as these are not supported in TextMesh."); } } for (List<TPPLPoly>::Element *I = out_tris.front(); I; I = I->next()) { TPPLPoly &tp = I->get(); - ERR_FAIL_COND(tp.GetNumPoints() != 3); // Trianges only. + ERR_FAIL_COND(tp.GetNumPoints() != 3); // Triangles only. for (int i = 0; i < 3; i++) { gl_data.triangles.push_back(Vector2(tp.GetPoint(i).x, tp.GetPoint(i).y)); |