summaryrefslogtreecommitdiff
path: root/src/lib/evas/common3d/primitives/primitive_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/evas/common3d/primitives/primitive_common.c')
-rw-r--r--src/lib/evas/common3d/primitives/primitive_common.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/src/lib/evas/common3d/primitives/primitive_common.c b/src/lib/evas/common3d/primitives/primitive_common.c
index b80d1dc..1bea068 100644
--- a/src/lib/evas/common3d/primitives/primitive_common.c
+++ b/src/lib/evas/common3d/primitives/primitive_common.c
@@ -11,10 +11,9 @@ void _set_vertex_data_from_array(Evas_Canvas3D_Mesh *mesh,
11{ 11{
12 float *address, *out; 12 float *address, *out;
13 int stride, i, j; 13 int stride, i, j;
14 eo_do(mesh, 14 evas_canvas3d_mesh_frame_vertex_data_copy_set(mesh, frame, attr, 0, NULL);
15 evas_canvas3d_mesh_frame_vertex_data_copy_set(frame, attr, 0, NULL), 15 address = (float *)evas_canvas3d_mesh_frame_vertex_data_map(mesh, frame, attr);
16 address = (float *)evas_canvas3d_mesh_frame_vertex_data_map(frame, attr), 16 stride = evas_canvas3d_mesh_frame_vertex_stride_get(mesh, frame, attr);
17 stride = evas_canvas3d_mesh_frame_vertex_stride_get(frame, attr));
18 if (stride == 0) stride = sizeof(float) * attr_count; 17 if (stride == 0) stride = sizeof(float) * attr_count;
19 for (i = 0; i < vcount; i++) 18 for (i = 0; i < vcount; i++)
20 { 19 {
@@ -22,8 +21,7 @@ void _set_vertex_data_from_array(Evas_Canvas3D_Mesh *mesh,
22 for (j = 0; j < attr_count; j++) 21 for (j = 0; j < attr_count; j++)
23 out[j] = data[start + (line * i) + j]; 22 out[j] = data[start + (line * i) + j];
24 } 23 }
25 eo_do(mesh, 24 evas_canvas3d_mesh_frame_vertex_data_unmap(mesh, frame, attr);
26 evas_canvas3d_mesh_frame_vertex_data_unmap(frame, attr));
27} 25}
28 26
29void 27void
@@ -35,10 +33,9 @@ _set_vec3_vertex_data(Evas_Canvas3D_Mesh *mesh,
35{ 33{
36 float *address, *out; 34 float *address, *out;
37 int stride, i; 35 int stride, i;
38 eo_do(mesh, 36 evas_canvas3d_mesh_frame_vertex_data_copy_set(mesh, frame, attr, 0, NULL);
39 evas_canvas3d_mesh_frame_vertex_data_copy_set(frame, attr, 0, NULL), 37 address = (float *)evas_canvas3d_mesh_frame_vertex_data_map(mesh, frame, attr);
40 address = (float *)evas_canvas3d_mesh_frame_vertex_data_map(frame, attr), 38 stride = evas_canvas3d_mesh_frame_vertex_stride_get(mesh, frame, attr);
41 stride = evas_canvas3d_mesh_frame_vertex_stride_get(frame, attr));
42 if (stride == 0) stride = sizeof(float) * 3; 39 if (stride == 0) stride = sizeof(float) * 3;
43 for (i = 0; i < vcount; i++) 40 for (i = 0; i < vcount; i++)
44 { 41 {
@@ -48,8 +45,7 @@ _set_vec3_vertex_data(Evas_Canvas3D_Mesh *mesh,
48 out[2] = data[i].z; 45 out[2] = data[i].z;
49 } 46 }
50 free(data); 47 free(data);
51 eo_do(mesh, 48 evas_canvas3d_mesh_frame_vertex_data_unmap(mesh, frame, attr);
52 evas_canvas3d_mesh_frame_vertex_data_unmap(frame, attr));
53} 49}
54 50
55void 51void
@@ -61,10 +57,9 @@ _set_vec2_vertex_data(Evas_Canvas3D_Mesh *mesh,
61{ 57{
62 float *address, *out; 58 float *address, *out;
63 int stride, i; 59 int stride, i;
64 eo_do(mesh, 60 evas_canvas3d_mesh_frame_vertex_data_copy_set(mesh, frame, attr, 0, NULL);
65 evas_canvas3d_mesh_frame_vertex_data_copy_set(frame, attr, 0, NULL), 61 address = (float *)evas_canvas3d_mesh_frame_vertex_data_map(mesh, frame, attr);
66 address = (float *)evas_canvas3d_mesh_frame_vertex_data_map(frame, attr), 62 stride = evas_canvas3d_mesh_frame_vertex_stride_get(mesh, frame, attr);
67 stride = evas_canvas3d_mesh_frame_vertex_stride_get(frame, attr));
68 if (stride == 0) stride = sizeof(float) * 2; 63 if (stride == 0) stride = sizeof(float) * 2;
69 for (i = 0; i < vcount; i++) 64 for (i = 0; i < vcount; i++)
70 { 65 {
@@ -73,8 +68,7 @@ _set_vec2_vertex_data(Evas_Canvas3D_Mesh *mesh,
73 out[1] = data[i].y; 68 out[1] = data[i].y;
74 } 69 }
75 free(data); 70 free(data);
76 eo_do(mesh, 71 evas_canvas3d_mesh_frame_vertex_data_unmap(mesh, frame, attr);
77 evas_canvas3d_mesh_frame_vertex_data_unmap(frame, attr));
78} 72}
79 73
80void 74void