summaryrefslogtreecommitdiff
path: root/src/examples
diff options
context:
space:
mode:
authorDmytro Dadyka <d.dadyka@samsung.com>2015-02-26 20:25:43 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-02-26 21:06:38 +0100
commit179acbdd9b592b62a00a726ecea7d95db5995e97 (patch)
treefb1828cb78e2a5caa422991cda85295c41b468ae /src/examples
parent72b26fd49bb34f2468f80728476143e67f5b6477 (diff)
evas: Evas_3D - fix coding style
Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2050 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/evas/evas-3d-primitives.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/examples/evas/evas-3d-primitives.c b/src/examples/evas/evas-3d-primitives.c
index ab96cd8..4fefb5a 100644
--- a/src/examples/evas/evas-3d-primitives.c
+++ b/src/examples/evas/evas-3d-primitives.c
@@ -120,7 +120,7 @@ const unsigned short square_indices[] = {0, 1, 2, 2, 1, 3};
120 evas_3d_mesh_frame_vertex_data_copy_set(frame, EVAS_3D_VERTEX_TANGENT, \ 120 evas_3d_mesh_frame_vertex_data_copy_set(frame, EVAS_3D_VERTEX_TANGENT, \
121 sizeof(vec3), &tangents[0]), \ 121 sizeof(vec3), &tangents[0]), \
122 evas_3d_mesh_index_data_copy_set(EVAS_3D_INDEX_FORMAT_UNSIGNED_SHORT, \ 122 evas_3d_mesh_index_data_copy_set(EVAS_3D_INDEX_FORMAT_UNSIGNED_SHORT, \
123 icount , &indices[0])); \ 123 icount, &indices[0])); \
124 free(vertices); \ 124 free(vertices); \
125 free(normals); \ 125 free(normals); \
126 free(tangents); \ 126 free(tangents); \
@@ -132,11 +132,11 @@ const unsigned short square_indices[] = {0, 1, 2, 2, 1, 3};
132 evas_3d_mesh_vertex_count_set(v_count), \ 132 evas_3d_mesh_vertex_count_set(v_count), \
133 evas_3d_mesh_frame_add(frame), \ 133 evas_3d_mesh_frame_add(frame), \
134 evas_3d_mesh_frame_vertex_data_set(frame, EVAS_3D_VERTEX_POSITION, \ 134 evas_3d_mesh_frame_vertex_data_set(frame, EVAS_3D_VERTEX_POSITION, \
135 15 * sizeof(float), &v_array[ 0]), \ 135 15 * sizeof(float), &v_array[0]), \
136 evas_3d_mesh_frame_vertex_data_set(frame, EVAS_3D_VERTEX_NORMAL, \ 136 evas_3d_mesh_frame_vertex_data_set(frame, EVAS_3D_VERTEX_NORMAL, \
137 15 * sizeof(float), &v_array[ 3]), \ 137 15 * sizeof(float), &v_array[3]), \
138 evas_3d_mesh_frame_vertex_data_set(frame, EVAS_3D_VERTEX_COLOR, \ 138 evas_3d_mesh_frame_vertex_data_set(frame, EVAS_3D_VERTEX_COLOR, \
139 15 * sizeof(float), &v_array[ 6]), \ 139 15 * sizeof(float), &v_array[6]), \
140 evas_3d_mesh_frame_vertex_data_set(frame, EVAS_3D_VERTEX_TEXCOORD, \ 140 evas_3d_mesh_frame_vertex_data_set(frame, EVAS_3D_VERTEX_TEXCOORD, \
141 15 * sizeof(float), &v_array[10]), \ 141 15 * sizeof(float), &v_array[10]), \
142 evas_3d_mesh_frame_vertex_data_set(frame, EVAS_3D_VERTEX_TANGENT, \ 142 evas_3d_mesh_frame_vertex_data_set(frame, EVAS_3D_VERTEX_TANGENT, \
@@ -169,8 +169,8 @@ _generate_grid_indices(unsigned short *indices, int count)
169 unsigned short *index = &indices[0]; 169 unsigned short *index = &indices[0];
170 int vccount = count + 1; 170 int vccount = count + 1;
171 171
172 for(j = 0; j < count; j++) 172 for (j = 0; j < count; j++)
173 for(i = 0; i < count; i++) 173 for (i = 0; i < count; i++)
174 { 174 {
175 *index++ = (unsigned short)(i + vccount * j); 175 *index++ = (unsigned short)(i + vccount * j);
176 *index++ = i + vccount * (j + 1); 176 *index++ = i + vccount * (j + 1);
@@ -188,7 +188,7 @@ _generate_tape_indices(unsigned short *indices, int count)
188 int i, vccount = count + 1; 188 int i, vccount = count + 1;
189 unsigned short *index = &indices[0]; 189 unsigned short *index = &indices[0];
190 190
191 for(i = 0; i < count; i++) 191 for (i = 0; i < count; i++)
192 { 192 {
193 *index++ = i; 193 *index++ = i;
194 *index++ = i + 1; 194 *index++ = i + 1;
@@ -234,8 +234,8 @@ evas_3d_add_sphere_frame(Eo *mesh, int frame, int p, vec2 tex_scale)
234 tangents[i + j * vccount].y = vertices[i + j * vccount].y; 234 tangents[i + j * vccount].y = vertices[i + j * vccount].y;
235 tangents[i + j * vccount].z = -vertices[i + j * vccount].x; 235 tangents[i + j * vccount].z = -vertices[i + j * vccount].x;
236 236
237 tex_coord[i+ j * vccount].x = i / (float)(vccount-1) * tex_scale.x; 237 tex_coord[i + j * vccount].x = i / (float)(vccount - 1) * tex_scale.x;
238 tex_coord[i+ j *vccount].y = tex_scale.y - j / (float)(vccount-1) * tex_scale.y; 238 tex_coord[i + j *vccount].y = tex_scale.y - j / (float)(vccount - 1) * tex_scale.y;
239 } 239 }
240 } 240 }
241 241
@@ -265,8 +265,8 @@ evas_3d_add_func_surface_frame(Eo *mesh, int frame, Surface func, int p, vec2 te
265 vertices[i + j * vccount] = func(v, u); 265 vertices[i + j * vccount] = func(v, u);
266 normals[i + j * vccount] = _get_func_normal(func, v, u); 266 normals[i + j * vccount] = _get_func_normal(func, v, u);
267 267
268 tex_coord[i+ j * vccount].x = i / (float)(vccount-1) * tex_scale.x; 268 tex_coord[i + j * vccount].x = i / (float)(vccount - 1) * tex_scale.x;
269 tex_coord[i+ j *vccount].y = tex_scale.y - j / (float)(vccount-1) * tex_scale.y; 269 tex_coord[i + j *vccount].y = tex_scale.y - j / (float)(vccount - 1) * tex_scale.y;
270 } 270 }
271 } 271 }
272 272
@@ -312,8 +312,8 @@ evas_3d_add_torus_frame(Eo *mesh, int frame, float rratio, int p, vec2 tex_scale
312 312
313 _vec3_normalize(&normals[i + j * vccount]); 313 _vec3_normalize(&normals[i + j * vccount]);
314 314
315 tex_coord[i+ j * vccount].x = i / (float)(vccount-1) * tex_scale.x; 315 tex_coord[i + j * vccount].x = i / (float)(vccount - 1) * tex_scale.x;
316 tex_coord[i+ j *vccount].y = tex_scale.y - j / (float)(vccount-1) * tex_scale.y; 316 tex_coord[i + j *vccount].y = tex_scale.y - j / (float)(vccount - 1) * tex_scale.y;
317 } 317 }
318 } 318 }
319 319
@@ -353,10 +353,10 @@ evas_3d_add_cylinder_frame(Eo *mesh, int frame, int p, vec2 tex_scale)
353 tangents[i + vccount].y = tangents[i].y = 0; 353 tangents[i + vccount].y = tangents[i].y = 0;
354 tangents[i + vccount].z = tangents[i].z = -sinfi; 354 tangents[i + vccount].z = tangents[i].z = -sinfi;
355 355
356 tex_coord[i].x = i / (float)(vccount-1) * tex_scale.x; 356 tex_coord[i].x = i / (float)(vccount - 1) * tex_scale.x;
357 tex_coord[i].y = 0; 357 tex_coord[i].y = 0;
358 tex_coord[i+ vccount].x = i / (float)(vccount-1) * tex_scale.x; 358 tex_coord[i + vccount].x = i / (float)(vccount - 1) * tex_scale.x;
359 tex_coord[i+ vccount].y = tex_scale.y; 359 tex_coord[i + vccount].y = tex_scale.y;
360 } 360 }
361 361
362 _generate_tape_indices(indices, p); 362 _generate_tape_indices(indices, p);
@@ -398,10 +398,10 @@ evas_3d_add_cone_frame(Eo *mesh, int frame, int p, vec2 tex_scale)
398 tangents[i + vccount].y = tangents[i].y = 0; 398 tangents[i + vccount].y = tangents[i].y = 0;
399 tangents[i + vccount].z = tangents[i].z = -sinfi; 399 tangents[i + vccount].z = tangents[i].z = -sinfi;
400 400
401 tex_coord[i].x = i / (float)(vccount-1) * tex_scale.x; 401 tex_coord[i].x = i / (float)(vccount - 1) * tex_scale.x;
402 tex_coord[i].y = 0; 402 tex_coord[i].y = 0;
403 tex_coord[i+ vccount].x = tex_coord[i].x; 403 tex_coord[i + vccount].x = tex_coord[i].x;
404 tex_coord[i+ vccount].y = tex_scale.y; 404 tex_coord[i + vccount].y = tex_scale.y;
405 } 405 }
406 406
407 _generate_tape_indices(indices, p); 407 _generate_tape_indices(indices, p);