@@ -62,7 +62,7 @@ void index_cb(void *user_data, tinyobj::index_t *indices, int num_indices) {
6262 // index).
6363 // Also, the first index starts with 1, not 0.
6464 // See fixIndex() function in tiny_obj_loader.h for details.
65- // Also, -2147483648(0x80000000 = -INT_MAX) is set for the index value which
65+ // Also, 0 is set for the index value which
6666 // does not exist in .obj
6767 MyMesh *mesh = reinterpret_cast <MyMesh *>(user_data);
6868
@@ -71,13 +71,13 @@ void index_cb(void *user_data, tinyobj::index_t *indices, int num_indices) {
7171 printf (" idx[%ld] = %d, %d, %d\n " , mesh->v_indices .size (), idx.vertex_index ,
7272 idx.normal_index , idx.texcoord_index );
7373
74- if (idx.vertex_index != 0x80000000 ) {
74+ if (idx.vertex_index != 0 ) {
7575 mesh->v_indices .push_back (idx.vertex_index );
7676 }
77- if (idx.normal_index != 0x80000000 ) {
77+ if (idx.normal_index != 0 ) {
7878 mesh->vn_indices .push_back (idx.normal_index );
7979 }
80- if (idx.texcoord_index != 0x80000000 ) {
80+ if (idx.texcoord_index != 0 ) {
8181 mesh->vt_indices .push_back (idx.texcoord_index );
8282 }
8383 }
@@ -143,7 +143,7 @@ int main(int argc, char **argv) {
143143
144144 tinyobj::MaterialFileReader mtlReader (" ../../models/" );
145145
146- bool ret = tinyobj::LoadObjWithCallback (&mesh , cb, &err , &ifs , &mtlReader );
146+ bool ret = tinyobj::LoadObjWithCallback (ifs , cb, &mesh , &mtlReader , &err );
147147
148148 if (!err.empty ()) {
149149 std::cerr << err << std::endl;
0 commit comments