summaryrefslogtreecommitdiff
path: root/src/modules/evas/model_loaders
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2016-03-03 12:58:24 +0000
committerTom Hacohen <tom@stosb.com>2016-03-03 12:58:26 +0000
commitb60db90ddc45001db2128f96aa0f5196f844b8c5 (patch)
treedd15edc1ad426e9604138385b6b9e6f5557da7e5 /src/modules/evas/model_loaders
parent12d8654f147ba2e93411840dbb17a3285435f4c5 (diff)
Fix more wrong migration to Eo4.
The if wasn't using {} so one of the statements was out of the scope of the condition. There was some misindented code.
Diffstat (limited to 'src/modules/evas/model_loaders')
-rw-r--r--src/modules/evas/model_loaders/md2/evas_model_load_md2.c9
-rw-r--r--src/modules/evas/model_loaders/obj/evas_model_load_obj.c16
2 files changed, 16 insertions, 9 deletions
diff --git a/src/modules/evas/model_loaders/md2/evas_model_load_md2.c b/src/modules/evas/model_loaders/md2/evas_model_load_md2.c
index 40a2aa6..02842ad 100644
--- a/src/modules/evas/model_loaders/md2/evas_model_load_md2.c
+++ b/src/modules/evas/model_loaders/md2/evas_model_load_md2.c
@@ -347,15 +347,18 @@ evas_model_load_file_md2(Evas_Canvas3D_Mesh *mesh, Eina_File *file)
347 int f = i * MD2_FRAME_SCALE; 347 int f = i * MD2_FRAME_SCALE;
348 348
349 /* Add a mesh frame. */ 349 /* Add a mesh frame. */
350 evas_canvas3d_mesh_frame_add(mesh, f); 350 evas_canvas3d_mesh_frame_add(mesh, f);
351
351 /* Allocate vertex buffer for the frame. */ 352 /* Allocate vertex buffer for the frame. */
352 evas_canvas3d_mesh_frame_vertex_data_copy_set(mesh, f, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, 0, NULL); 353 evas_canvas3d_mesh_frame_vertex_data_copy_set(mesh, f, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, 0, NULL);
353 evas_canvas3d_mesh_frame_vertex_data_copy_set(mesh, f, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL, 0, NULL); 354 evas_canvas3d_mesh_frame_vertex_data_copy_set(mesh, f, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL, 0, NULL);
354 evas_canvas3d_mesh_frame_vertex_data_copy_set(mesh, f, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD, 0, NULL); 355 evas_canvas3d_mesh_frame_vertex_data_copy_set(mesh, f, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD, 0, NULL);
356
355 /* Map vertex buffer. */ 357 /* Map vertex buffer. */
356 pos = (float *)evas_canvas3d_mesh_frame_vertex_data_map(mesh, f, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION); 358 pos = (float *)evas_canvas3d_mesh_frame_vertex_data_map(mesh, f, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION);
357 nor = (float *)evas_canvas3d_mesh_frame_vertex_data_map(mesh, f, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL); 359 nor = (float *)evas_canvas3d_mesh_frame_vertex_data_map(mesh, f, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL);
358 tex = (float *)evas_canvas3d_mesh_frame_vertex_data_map(mesh, f, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD); 360 tex = (float *)evas_canvas3d_mesh_frame_vertex_data_map(mesh, f, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD);
361
359 stride_pos = evas_canvas3d_mesh_frame_vertex_stride_get(mesh, f, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION); 362 stride_pos = evas_canvas3d_mesh_frame_vertex_stride_get(mesh, f, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION);
360 stride_nor = evas_canvas3d_mesh_frame_vertex_stride_get(mesh, f, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL); 363 stride_nor = evas_canvas3d_mesh_frame_vertex_stride_get(mesh, f, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL);
361 stride_tex = evas_canvas3d_mesh_frame_vertex_stride_get(mesh, f, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD); 364 stride_tex = evas_canvas3d_mesh_frame_vertex_stride_get(mesh, f, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD);
diff --git a/src/modules/evas/model_loaders/obj/evas_model_load_obj.c b/src/modules/evas/model_loaders/obj/evas_model_load_obj.c
index 718b8c9..4f1c8f6 100644
--- a/src/modules/evas/model_loaders/obj/evas_model_load_obj.c
+++ b/src/modules/evas/model_loaders/obj/evas_model_load_obj.c
@@ -380,14 +380,18 @@ evas_model_load_file_obj(Evas_Canvas3D_Mesh *mesh, Eina_File *file)
380 stride_pos = evas_canvas3d_mesh_frame_vertex_stride_get(mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION); 380 stride_pos = evas_canvas3d_mesh_frame_vertex_stride_get(mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION);
381 381
382 if (counts.existence_of_normal) 382 if (counts.existence_of_normal)
383 evas_canvas3d_mesh_frame_vertex_data_copy_set(mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL, 0, NULL); 383 {
384 nor = (float *)evas_canvas3d_mesh_frame_vertex_data_map(mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL); 384 evas_canvas3d_mesh_frame_vertex_data_copy_set(mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL, 0, NULL);
385 stride_nor = evas_canvas3d_mesh_frame_vertex_stride_get(mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL); 385 nor = (float *)evas_canvas3d_mesh_frame_vertex_data_map(mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL);
386 stride_nor = evas_canvas3d_mesh_frame_vertex_stride_get(mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL);
387 }
386 388
387 if (counts.existence_of_tex_point) 389 if (counts.existence_of_tex_point)
388 evas_canvas3d_mesh_frame_vertex_data_copy_set(mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD, 0, NULL); 390 {
389 tex = (float *)evas_canvas3d_mesh_frame_vertex_data_map(mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD); 391 evas_canvas3d_mesh_frame_vertex_data_copy_set(mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD, 0, NULL);
390 stride_tex = evas_canvas3d_mesh_frame_vertex_stride_get(mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD); 392 tex = (float *)evas_canvas3d_mesh_frame_vertex_data_map(mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD);
393 stride_tex = evas_canvas3d_mesh_frame_vertex_stride_get(mesh, 0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD);
394 }
391 395
392 if (stride_pos == 0) stride_pos = sizeof(float) * 3; 396 if (stride_pos == 0) stride_pos = sizeof(float) * 3;
393 if ((counts.existence_of_normal) && (stride_nor == 0)) 397 if ((counts.existence_of_normal) && (stride_nor == 0))