From c7da23795d07b054910ee053bdfe7dd89775cf8f Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Fri, 5 Aug 2016 19:16:46 +0900 Subject: [PATCH 1/4] Add static keyword to safeGetline(). --- 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 d0a7886..c77ffc8 100644 --- a/tiny_obj_loader.h +++ b/tiny_obj_loader.h @@ -252,7 +252,7 @@ struct obj_shape { // See // http://stackoverflow.com/questions/6089231/getting-std-ifstream-to-handle-lf-cr-and-crlf -std::istream &safeGetline(std::istream &is, std::string &t) { +static std::istream &safeGetline(std::istream &is, std::string &t) { t.clear(); // The characters in the stream are read one-by-one using a std::streambuf. From d3d6932efdaac3dca798ac295723b7187154e0e7 Mon Sep 17 00:00:00 2001 From: Grayson Lang Date: Wed, 17 Aug 2016 13:30:25 -0700 Subject: [PATCH 2/4] Fix MTL "transmission filter" token The "transmission filter" is currently set to Kt, which is undocumented. Adding support for the specified token of "Tf". --- tiny_obj_loader.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tiny_obj_loader.h b/tiny_obj_loader.h index c77ffc8..02ef7b0 100644 --- a/tiny_obj_loader.h +++ b/tiny_obj_loader.h @@ -802,7 +802,8 @@ void LoadMtl(std::map &material_map, } // transmittance - if (token[0] == 'K' && token[1] == 't' && IS_SPACE((token[2]))) { + if ((token[0] == 'K' && token[1] == 't' && IS_SPACE((token[2]))) + || (token[0] == 'T' && token[1] == 'F' && IS_SPACE((token[2])))) { token += 2; float r, g, b; parseFloat3(r, g, b, token); From 8e53519a2773e29f8e0540f00982660852385568 Mon Sep 17 00:00:00 2001 From: Grayson Lang Date: Wed, 17 Aug 2016 13:34:18 -0700 Subject: [PATCH 3/4] Ooops, meant "Tf" not "TF". --- 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 02ef7b0..dd8f061 100644 --- a/tiny_obj_loader.h +++ b/tiny_obj_loader.h @@ -803,7 +803,7 @@ void LoadMtl(std::map &material_map, // transmittance if ((token[0] == 'K' && token[1] == 't' && IS_SPACE((token[2]))) - || (token[0] == 'T' && token[1] == 'F' && IS_SPACE((token[2])))) { + || (token[0] == 'T' && token[1] == 'f' && IS_SPACE((token[2])))) { token += 2; float r, g, b; parseFloat3(r, g, b, token); From 49988672f417c5d7eebd819f4aeaf48d56c796b4 Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Fri, 19 Aug 2016 20:22:26 +0900 Subject: [PATCH 4/4] Add link to tinyobjloader-c. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index dbf3749..6f0de8e 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ Tiny but powerful single file wavefront obj loader written in C++. No dependency `tinyobjloader` is good for embedding .obj loader to your (global illumination) renderer ;-) +If you are looking for C89 version, please see https://github.com/syoyo/tinyobjloader-c . + Notice! -------