| 2063 | } |
| 2064 | |
| 2065 | static std::string JoinPath(const std::string &dir, |
| 2066 | const std::string &filename) { |
| 2067 | if (dir.empty()) { |
| 2068 | return filename; |
| 2069 | } else { |
| 2070 | // check '/' |
| 2071 | char lastChar = *dir.rbegin(); |
| 2072 | if (lastChar != '/') { |
| 2073 | return dir + std::string("/") + filename; |
| 2074 | } else { |
| 2075 | return dir + filename; |
| 2076 | } |
| 2077 | } |
| 2078 | } |
| 2079 | |
| 2080 | void LoadMtl(std::map<std::string, int> *material_map, |
| 2081 | std::vector<material_t> *materials, std::istream *inStream, |