OBJ: fix mac/linux tests and compile warnings in the new obj importer
Related to D13958
This commit is contained in:
parent
277fa2f441
commit
a56f53ad56
|
@ -184,6 +184,10 @@ static void geom_add_polygon(Geometry *geom,
|
|||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "Invalid face syntax '%s', ignoring\n", std::string(str_corner).c_str());
|
||||
face_valid = false;
|
||||
}
|
||||
/* Always keep stored indices non-negative and zero-based. */
|
||||
corner.vert_index += corner.vert_index < 0 ? global_vertices.vertices.size() :
|
||||
-offsets.get_index_offset() - 1;
|
||||
|
@ -191,7 +195,7 @@ static void geom_add_polygon(Geometry *geom,
|
|||
fprintf(stderr,
|
||||
"Invalid vertex index %i (valid range [0, %zi)), ignoring face\n",
|
||||
corner.vert_index,
|
||||
global_vertices.vertices.size());
|
||||
(size_t)global_vertices.vertices.size());
|
||||
face_valid = false;
|
||||
}
|
||||
if (got_uv) {
|
||||
|
@ -200,7 +204,7 @@ static void geom_add_polygon(Geometry *geom,
|
|||
fprintf(stderr,
|
||||
"Invalid UV index %i (valid range [0, %zi)), ignoring face\n",
|
||||
corner.uv_vert_index,
|
||||
global_vertices.uv_vertices.size());
|
||||
(size_t)global_vertices.uv_vertices.size());
|
||||
face_valid = false;
|
||||
}
|
||||
}
|
||||
|
@ -213,7 +217,7 @@ static void geom_add_polygon(Geometry *geom,
|
|||
fprintf(stderr,
|
||||
"Invalid normal index %i (valid range [0, %zi)), ignoring face\n",
|
||||
corner.vertex_normal_index,
|
||||
global_vertices.vertex_normals.size());
|
||||
(size_t)global_vertices.vertex_normals.size());
|
||||
face_valid = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -338,8 +338,8 @@ TEST_F(obj_importer_test, import_invalid_syntax)
|
|||
3,
|
||||
float3(1, 2, 3),
|
||||
float3(10, 11, 12),
|
||||
float3(0.4082f, -0.8165f, 0.4082f),
|
||||
float2(0, 0)},
|
||||
float3(0, 1, 0),
|
||||
float2(0.5f, 0.25f)},
|
||||
};
|
||||
import_and_check("invalid_syntax.obj", expect, std::size(expect), 0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue