evas-3d: fix incorrect reading of .obj file which had an empty line before data in...
authorBogdan Devichev <b.devichev@samsung.com>
Thu, 26 Feb 2015 19:27:11 +0000 (20:27 +0100)
committerCedric BAIL <cedric@osg.samsung.com>
Thu, 26 Feb 2015 20:06:38 +0000 (21:06 +0100)
Summary:
For example of a bug, part of .obj file:
vn 0.5536 -0.7200 -0.4185\n
vn -0.5536 -0.7200 -0.4185\n
\# 239 vertex normals\n
\n
vt 0.4998 0.2618 0.0000\n(lines like this were ignored)
vt 0.5205 0.2550 0.0000\n
vt 0.5249 0.2618 0.0000\n

@fix

Test Plan: Run colorpick example. Before and after this update. ("M15.obj" has fixed places.)

Reviewers: cedric, Hermet, raster

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2049

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
src/modules/evas/model_loaders/obj/evas_model_load_obj.c

index b88f95b..e1fdf48 100644 (file)
@@ -176,7 +176,7 @@ _count_elements(char *map)//count elements of mesh in .obj
                     }
                }
           }
-        else if (*current == '\n')
+        if (*current == '\n')
           {
              will_check_next_char = EINA_TRUE;
           }
@@ -364,7 +364,7 @@ evas_model_load_file_obj(Evas_3D_Mesh *mesh, Eina_File *file)
                     }
                }
           }
-        else if (*current == '\n')
+        if (*current == '\n')
           {
              will_check_next_char = EINA_TRUE;
           }