From 4fe479453bad2c0053ee0507529f0b4934c59be7 Mon Sep 17 00:00:00 2001 From: tigrazone Date: Sun, 10 Dec 2017 09:34:10 +0200 Subject: [PATCH] smallish optimize --- tiny_obj_loader.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tiny_obj_loader.h b/tiny_obj_loader.h index fa461c2..7f52577 100644 --- a/tiny_obj_loader.h +++ b/tiny_obj_loader.h @@ -1165,7 +1165,11 @@ static bool ParseTextureNameAndOption(std::string *texname, token += strspn(token, " \t"); // skip space a_tok = token2tok(token); - + + + //tigra: minimize checks + if(a_tok>=TOK_blendu && a_tok<=TOK_mm) + { //if ((0 == strncmp(token, "-blendu", 7)) && IS_SPACE((token[7]))) if (a_tok == TOK_blendu) { @@ -1240,6 +1244,8 @@ static bool ParseTextureNameAndOption(std::string *texname, token += 4; parseReal2(&(texopt->brightness), &(texopt->contrast), &token, 0.0, 1.0); } + + } else { // Assume texture filename #if 0