summaryrefslogtreecommitdiff
path: root/src/lib/evas/common3d/primitives/primitive_common.h
diff options
context:
space:
mode:
authorperepelits.m <perepelits.m@samsung.com>2015-10-04 16:37:17 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-10-04 16:37:28 +0200
commit0dd60ced443f087a142a8fd0f5664af732a9b029 (patch)
treec12eb4db15b2e56866abc0f7e27a8a49d8422103 /src/lib/evas/common3d/primitives/primitive_common.h
parent4290567fd67cee39a3e36fddf0dc526190250724 (diff)
evas-3d: fix primitives
Summary: There were warnings after adding primitive in the same frame more then once, the check was added to avoid it @fix Reviewers: cedric, raster, Hermet Subscribers: cedric, artem.popov Differential Revision: https://phab.enlightenment.org/D3090 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/evas/common3d/primitives/primitive_common.h')
-rw-r--r--src/lib/evas/common3d/primitives/primitive_common.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/lib/evas/common3d/primitives/primitive_common.h b/src/lib/evas/common3d/primitives/primitive_common.h
index 7f4e39d..50092d7 100644
--- a/src/lib/evas/common3d/primitives/primitive_common.h
+++ b/src/lib/evas/common3d/primitives/primitive_common.h
@@ -17,9 +17,14 @@
17 unsigned short *indices = malloc(sizeof(short) * icount); 17 unsigned short *indices = malloc(sizeof(short) * icount);
18 18
19#define SET_VERTEX_DATA(frame) \ 19#define SET_VERTEX_DATA(frame) \
20 Eina_Bool frame_exist; \
21 eo_do(mesh, \
22 frame_exist = evas_canvas3d_mesh_frame_exist(frame)); \
23 if (!frame_exist) \
24 eo_do(mesh, \
25 evas_canvas3d_mesh_frame_add(frame)); \
20 eo_do(mesh, \ 26 eo_do(mesh, \
21 evas_canvas3d_mesh_vertex_count_set(vcount), \ 27 evas_canvas3d_mesh_vertex_count_set(vcount), \
22 evas_canvas3d_mesh_frame_add(frame), \
23 evas_canvas3d_mesh_index_data_copy_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT, \ 28 evas_canvas3d_mesh_index_data_copy_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT, \
24 icount, &indices[0])); \ 29 icount, &indices[0])); \
25 _set_vec3_vertex_data(mesh, frame, vcount, vertices, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION); \ 30 _set_vec3_vertex_data(mesh, frame, vcount, vertices, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION); \
@@ -29,9 +34,14 @@
29 free(indices); 34 free(indices);
30 35
31#define SET_VERTEX_DATA_FROM_ARRAY(mesh, frame, varray, vcount, indices, icount) \ 36#define SET_VERTEX_DATA_FROM_ARRAY(mesh, frame, varray, vcount, indices, icount) \
37 Eina_Bool frame_exist; \
38 eo_do(mesh, \
39 frame_exist = evas_canvas3d_mesh_frame_exist(frame)); \
40 if (!frame_exist) \
41 eo_do(mesh, \
42 evas_canvas3d_mesh_frame_add(frame)); \
32 eo_do(mesh, \ 43 eo_do(mesh, \
33 evas_canvas3d_mesh_vertex_count_set(vcount), \ 44 evas_canvas3d_mesh_vertex_count_set(vcount), \
34 evas_canvas3d_mesh_frame_add(frame), \
35 evas_canvas3d_mesh_index_data_copy_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT, \ 45 evas_canvas3d_mesh_index_data_copy_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT, \
36 icount, &indices[0])); \ 46 icount, &indices[0])); \
37 _set_vertex_data_from_array(mesh, frame, varray, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, \ 47 _set_vertex_data_from_array(mesh, frame, varray, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, \