From 5298e16e80e032a7ff0c6a661b826859e5aeccd0 Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Sun, 6 Feb 2022 11:14:58 +0000 Subject: Float literals - fix main primitives to use .f Converts float literals from double format (e.g. 0.0) to float format (e.g. 0.0f) where appropriate for 32 bit calculations. --- core/math/triangulate.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/math/triangulate.cpp') diff --git a/core/math/triangulate.cpp b/core/math/triangulate.cpp index f3e3de5fc2..0a9872ae08 100644 --- a/core/math/triangulate.cpp +++ b/core/math/triangulate.cpp @@ -39,7 +39,7 @@ real_t Triangulate::get_area(const Vector &contour) { for (int p = n - 1, q = 0; q < n; p = q++) { A += c[p].cross(c[q]); } - return A * 0.5; + return A * 0.5f; } /* `is_inside_triangle` decides if a point P is inside the triangle @@ -70,9 +70,9 @@ bool Triangulate::is_inside_triangle(real_t Ax, real_t Ay, bCROSScp = bx * cpy - by * cpx; if (include_edges) { - return ((aCROSSbp > 0.0) && (bCROSScp > 0.0) && (cCROSSap > 0.0)); + return ((aCROSSbp > 0.0f) && (bCROSScp > 0.0f) && (cCROSSap > 0.0f)); } else { - return ((aCROSSbp >= 0.0) && (bCROSScp >= 0.0) && (cCROSSap >= 0.0)); + return ((aCROSSbp >= 0.0f) && (bCROSScp >= 0.0f) && (cCROSSap >= 0.0f)); } } @@ -128,7 +128,7 @@ bool Triangulate::triangulate(const Vector &contour, Vector &resul /* we want a counter-clockwise polygon in V */ - if (0.0 < get_area(contour)) { + if (0.0f < get_area(contour)) { for (int v = 0; v < n; v++) { V.write[v] = v; } -- cgit v1.2.3