------------------------------------------------------------------------------------------------ Import method.
| 172 | // ------------------------------------------------------------------------------------------------ |
| 173 | // Import method. |
| 174 | void Q3BSPFileImporter::InternReadFile(const std::string &rFile, aiScene *scene, IOSystem *ioHandler) { |
| 175 | clear(); |
| 176 | ZipArchiveIOSystem Archive(ioHandler, rFile); |
| 177 | if (!Archive.isOpen()) { |
| 178 | throw DeadlyImportError("Failed to open file ", rFile, "."); |
| 179 | } |
| 180 | |
| 181 | std::string archiveName, mapName; |
| 182 | separateMapName(rFile, archiveName, mapName); |
| 183 | |
| 184 | if (mapName.empty()) { |
| 185 | if (!findFirstMapInArchive(Archive, mapName)) { |
| 186 | return; |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | Q3BSPFileParser fileParser(mapName, &Archive); |
| 191 | Q3BSPModel *pBSPModel = fileParser.getModel(); |
| 192 | if (nullptr != pBSPModel) { |
| 193 | CreateDataFromImport(pBSPModel, scene, &Archive); |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | // ------------------------------------------------------------------------------------------------ |
| 198 | // Separates the map name from the import name. |
nothing calls this directly
no test coverage detected