aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-08-02 18:40:25 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-08-02 18:48:06 +0900
commit800b877ed71698326e68071c50a511e4ac91bfd0 (patch)
treee9c093a74c6a7bd0d56b5bd702e154fa14960647
parentelm_code: small optimisation for large files (diff)
downloadefl-800b877ed71698326e68071c50a511e4ac91bfd0.tar.gz
evas model loader - restructure code to silence warning
keep our build quiet warnings-wise and change the code to be so... so we see real warnings. not a bug... just a warning.
-rw-r--r--src/modules/evas/model_loaders/obj/evas_model_load_obj.c6
1 files changed, 4 insertions, 2 deletions
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 2b18c61202..bdc246d559 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
@@ -405,6 +405,8 @@ evas_model_load_file_obj(Evas_Canvas3D_Mesh *mesh, Eina_File *file)
{
float *p, *n, *t;
+ n = NULL;
+ t = NULL;
p = (float *)((char *)pos + stride_pos * (j * 3 + k));
if (counts.existence_of_normal)
n = (float *)((char *)nor + stride_nor * (j * 3 + k));
@@ -415,14 +417,14 @@ evas_model_load_file_obj(Evas_Canvas3D_Mesh *mesh, Eina_File *file)
p[1] = ARRAY_2D(_vertices_obj, (ARRAY_2D(_triangles, j, (3 * k), 9) - 1), 1, 3);
p[2] = ARRAY_2D(_vertices_obj, (ARRAY_2D(_triangles, j, (3 * k), 9) - 1), 2, 3);
- if (counts.existence_of_normal)
+ if (n)
{
n[0] = ARRAY_2D(_normales_obj, (ARRAY_2D(_triangles, j, (3 * k + 2), 9) - 1), 0, 3);
n[1] = ARRAY_2D(_normales_obj, (ARRAY_2D(_triangles, j, (3 * k + 2), 9) - 1), 1, 3);
n[2] = ARRAY_2D(_normales_obj, (ARRAY_2D(_triangles, j, (3 * k + 2), 9) - 1), 2, 3);
}
- if (counts.existence_of_tex_point)
+ if (t)
{
t[0] = ARRAY_2D(_tex_coords_obj, (ARRAY_2D(_triangles, j, (3 * k + 1), 9) - 1), 0, 3);
t[1] = ARRAY_2D(_tex_coords_obj, (ARRAY_2D(_triangles, j, (3 * k + 1), 9) - 1), 1, 3);