return pd->vertex_count;
}
+EOLIAN static Eina_Bool
+_evas_canvas3d_mesh_frame_exist(Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *pd, int frame)
+{
+ Evas_Canvas3D_Mesh_Frame *f = evas_canvas3d_mesh_frame_find(pd, frame);
+
+ if (f)
+ return EINA_TRUE;
+
+ return EINA_FALSE;
+}
+
EOLIAN static void
_evas_canvas3d_mesh_frame_add(Eo *obj, Evas_Canvas3D_Mesh_Data *pd, int frame)
{
unsigned short *indices = malloc(sizeof(short) * icount);
#define SET_VERTEX_DATA(frame) \
+ Eina_Bool frame_exist; \
+ eo_do(mesh, \
+ frame_exist = evas_canvas3d_mesh_frame_exist(frame)); \
+ if (!frame_exist) \
+ eo_do(mesh, \
+ evas_canvas3d_mesh_frame_add(frame)); \
eo_do(mesh, \
evas_canvas3d_mesh_vertex_count_set(vcount), \
- evas_canvas3d_mesh_frame_add(frame), \
evas_canvas3d_mesh_index_data_copy_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT, \
icount, &indices[0])); \
_set_vec3_vertex_data(mesh, frame, vcount, vertices, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION); \
free(indices);
#define SET_VERTEX_DATA_FROM_ARRAY(mesh, frame, varray, vcount, indices, icount) \
+ Eina_Bool frame_exist; \
+ eo_do(mesh, \
+ frame_exist = evas_canvas3d_mesh_frame_exist(frame)); \
+ if (!frame_exist) \
+ eo_do(mesh, \
+ evas_canvas3d_mesh_frame_add(frame)); \
eo_do(mesh, \
evas_canvas3d_mesh_vertex_count_set(vcount), \
- evas_canvas3d_mesh_frame_add(frame), \
evas_canvas3d_mesh_index_data_copy_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT, \
icount, &indices[0])); \
_set_vertex_data_from_array(mesh, frame, varray, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, \