summaryrefslogtreecommitdiff
path: root/src/lib/evas
diff options
context:
space:
mode:
authorperepelits.m <perepelits.m@samsung.com>2016-01-09 00:32:47 +0100
committerCedric BAIL <cedric@osg.samsung.com>2016-01-09 00:33:51 +0100
commit687df102d67d118b92e43504be48f88fd1e96ea8 (patch)
treeac6ec85e135ea5bbb18015c30842b16e59473791 /src/lib/evas
parent26ffe0d55c48b56a82e50684ea21458f40112405 (diff)
evas: fix optimization of vertex count in convex hull
Summary: FLT_COMPARISON should be used everywhere in evas_3d_utils.h Reviewers: cedric, raster, Hermet Subscribers: jpeg, artem.popov Differential Revision: https://phab.enlightenment.org/D3551 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/evas')
-rw-r--r--src/lib/evas/include/evas_3d_utils.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/evas/include/evas_3d_utils.h b/src/lib/evas/include/evas_3d_utils.h
index cc557c6889..9b901b4130 100644
--- a/src/lib/evas/include/evas_3d_utils.h
+++ b/src/lib/evas/include/evas_3d_utils.h
@@ -1339,6 +1339,7 @@ convex_hull_vertex_set(Evas_Triangle3 *el, unsigned short int *vertex_count, flo
1339 vect = el->p2; 1339 vect = el->p2;
1340 break; 1340 break;
1341 } 1341 }
1342
1342 (*vertex_count)++; 1343 (*vertex_count)++;
1343 *vertex = (float*) realloc(*vertex, (10 * (*vertex_count)) * sizeof(float)); 1344 *vertex = (float*) realloc(*vertex, (10 * (*vertex_count)) * sizeof(float));
1344 1345
@@ -1805,11 +1806,11 @@ evas_convex_hull_get(float *data, int count, int stride, Eina_Inarray *vertex,
1805 1806
1806#define CHECK_AND_SET_VERTEX(coord) \ 1807#define CHECK_AND_SET_VERTEX(coord) \
1807 exist1 = EINA_FALSE; \ 1808 exist1 = EINA_FALSE; \
1808 for (i = 0, new_stride = 0; (i < vertex_count) && !exist1; i++, new_stride += 10) \ 1809 for (i = 0, new_stride = 0; (i < vertex_count) && !exist1; i++, new_stride += 10) \
1809 { \ 1810 { \
1810 if ((k > 0) && (el->p##coord.x == found_vertex[new_stride]) && \ 1811 if ((k > 0) && !FLT_COMPARISON(el->p##coord.x, found_vertex[new_stride]) && \
1811 (el->p##coord.y == found_vertex[new_stride + 1]) && \ 1812 !FLT_COMPARISON(el->p##coord.y, found_vertex[new_stride + 1]) && \
1812 (el->p##coord.z == found_vertex[new_stride + 2])) \ 1813 !FLT_COMPARISON(el->p##coord.z, found_vertex[new_stride + 2])) \
1813 { \ 1814 { \
1814 exist1 = EINA_TRUE; \ 1815 exist1 = EINA_TRUE; \
1815 found_index[3 * k + coord] = i; \ 1816 found_index[3 * k + coord] = i; \