MCPcopy Create free account
hub / github.com/assimp/assimp / InternReadFile

Method InternReadFile

code/AssetLib/Q3BSP/Q3BSPFileImporter.cpp:174–195  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------ Import method.

Source from the content-addressed store, hash-verified

172// ------------------------------------------------------------------------------------------------
173// Import method.
174void 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.

Callers

nothing calls this directly

Calls 5

clearFunction · 0.85
DeadlyImportErrorFunction · 0.85
getModelMethod · 0.80
isOpenMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected