From fb35a684e5e7711dee1c03da6c64c2179563444b Mon Sep 17 00:00:00 2001 From: YarmUI Date: Tue, 21 Aug 2012 18:46:10 +0900 Subject: [PATCH] bugfix --- cornell_box.obj | 2 +- test.cc | 2 +- tiny_obj_loader.cc | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cornell_box.obj b/cornell_box.obj index a97672d..43e021f 100644 --- a/cornell_box.obj +++ b/cornell_box.obj @@ -34,7 +34,7 @@ v 343.0 548.0 227.0 v 343.0 548.0 332.0 v 213.0 548.0 332.0 v 213.0 548.0 227.0 -#f -4 -3 -2 -1 +f -4 -3 -2 -1 o ceiling usemtl white diff --git a/test.cc b/test.cc index 7a8c3dd..0515d99 100644 --- a/test.cc +++ b/test.cc @@ -8,7 +8,7 @@ main( int argc, char **argv) { - std::string inputfile = "test.obj"; + std::string inputfile = "cornell_box.obj"; std::vector shapes; if (argc > 1) { diff --git a/tiny_obj_loader.cc b/tiny_obj_loader.cc index e601ce3..e43c1c4 100644 --- a/tiny_obj_loader.cc +++ b/tiny_obj_loader.cc @@ -414,6 +414,8 @@ std::string LoadMtl ( material.unknown_parameter.insert(std::pair(key, value)); } } + // flush last material. + material_map.insert(std::pair(material.name, material)); return err.str(); }