diff --git a/README.md b/README.md index 8bc365a..9647acc 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Tiny but powerful single file wavefront obj loader written in C++. No dependency What's new ---------- +* Mar 13, 2016 : Introduce `load_flag_t` and flat normal calculation flag! Thanks Vazquinhos! * Jan 29, 2016 : Support n-polygon(no triangulation) and OpenSubdiv crease tag! Thanks dboogert! * Nov 26, 2015 : Now single-header only!. * Nov 08, 2015 : Improved API. @@ -163,8 +164,8 @@ std::vector shapes; std::vector materials; std::string err; -bool triangulate = false; -bool ret = tinyobj::LoadObj(shapes, materials, err, inputfile.c_str(), triangulate); +int flags = 1; // see load_flags_t enum for more information. +bool ret = tinyobj::LoadObj(shapes, materials, err, inputfile.c_str(), flags); if (!err.empty()) { // `err` may contain warning message. std::cerr << err << std::endl; diff --git a/test.cc b/test.cc index 523973f..e13b172 100644 --- a/test.cc +++ b/test.cc @@ -272,7 +272,7 @@ main( //assert(true == TestLoadObj("cornell_box.obj")); //assert(true == TestLoadObj("cube.obj")); assert(true == TestStreamLoadObj()); - assert(true == TestLoadObj("catmark_torus_creases0.obj", NULL, false)); + assert(true == TestLoadObj("catmark_torus_creases0.obj", NULL, 0)); } return 0; diff --git a/tiny_obj_loader.h b/tiny_obj_loader.h index 601dafc..da297b2 100644 --- a/tiny_obj_loader.h +++ b/tiny_obj_loader.h @@ -5,7 +5,7 @@ // // -// version 0.9.21: Flat normal creation flag for .obj files that do not have normals +// version 0.9.22: Introduce `load_flags_t`. // version 0.9.20: Fixes creating per-face material using `usemtl`(#68) // version 0.9.17: Support n-polygon and crease tag(OpenSubdiv extension) // version 0.9.16: Make tinyobjloader header-only