From 4dee4cc673c319d5fabc9b87989d7ac53dac3840 Mon Sep 17 00:00:00 2001 From: "Adi Shavit @ MacBookPro" Date: Thu, 28 Jul 2016 10:12:16 +0300 Subject: [PATCH] Changes the value indicating non-existent index to 0. OBJ indices are 1 (or -1) based, so 0 is an invalid value. --- tiny_obj_loader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiny_obj_loader.h b/tiny_obj_loader.h index df42093..0961225 100644 --- a/tiny_obj_loader.h +++ b/tiny_obj_loader.h @@ -535,7 +535,7 @@ static vertex_index parseTriple(const char **token, int vsize, int vnsize, // Parse raw triples: i, i/j/k, i//k, i/j static vertex_index parseRawTriple(const char **token) { vertex_index vi( - static_cast(0x80000000)); // 0x80000000 = -2147483648 = invalid + static_cast(0)); // 0 is an invalid index in OBJ vi.v_idx = atoi((*token)); (*token) += strcspn((*token), "/ \t\r");