Fix parsing of crease tags(t)

Support parsing texture filename containing whitespace.
This commit is contained in:
Syoyo Fujita
2017-10-13 18:13:36 +09:00
parent 1c6dbf9bd8
commit 94fc413466
4 changed files with 98 additions and 15 deletions

View File

@@ -694,6 +694,29 @@ TEST_CASE("zero-face-idx-value", "[Issue140]") {
}
TEST_CASE("texture-name-whitespace", "[Issue145]") {
tinyobj::attrib_t attrib;
std::vector<tinyobj::shape_t> shapes;
std::vector<tinyobj::material_t> materials;
std::string err;
bool ret = tinyobj::LoadObj(&attrib, &shapes, &materials, &err, "../models/texture-filename-with-whitespace.obj", gMtlBasePath);
if (!err.empty()) {
std::cerr << "[Issue145] " << err << std::endl;
}
REQUIRE(true == ret);
REQUIRE(err.empty());
REQUIRE(2 < materials.size());
REQUIRE(0 == materials[0].diffuse_texname.compare("texture 01.png"));
REQUIRE(0 == materials[1].bump_texname.compare("bump 01.png"));
REQUIRE(2 == Approx(materials[1].bump_texopt.bump_multiplier));
}
#if 0
int
main(