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.
This commit is contained in:
Carsten Haitzler 2017-08-02 18:40:25 +09:00
parent 91293d3b25
commit 800b877ed7
1 changed files with 4 additions and 2 deletions

View File

@ -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);