|
@@ -113,7 +113,7 @@ static void extractIds(const std::string &key, int &id1, int &id2) {
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
// Local helper function to normalize filenames.
|
|
|
static void normalizePathName(const std::string &rPath, std::string &normalizedPath) {
|
|
|
- normalizedPath = "";
|
|
|
+ normalizedPath = std::string();
|
|
|
if (rPath.empty()) {
|
|
|
return;
|
|
|
}
|
|
@@ -183,7 +183,7 @@ void Q3BSPFileImporter::InternReadFile(const std::string &rFile, aiScene *scene,
|
|
|
throw DeadlyImportError("Failed to open file ", rFile, ".");
|
|
|
}
|
|
|
|
|
|
- std::string archiveName(""), mapName("");
|
|
|
+ std::string archiveName, mapName;
|
|
|
separateMapName(rFile, archiveName, mapName);
|
|
|
|
|
|
if (mapName.empty()) {
|
|
@@ -202,8 +202,8 @@ void Q3BSPFileImporter::InternReadFile(const std::string &rFile, aiScene *scene,
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
// Separates the map name from the import name.
|
|
|
void Q3BSPFileImporter::separateMapName(const std::string &importName, std::string &archiveName, std::string &mapName) {
|
|
|
- archiveName = "";
|
|
|
- mapName = "";
|
|
|
+ archiveName = std::string();
|
|
|
+ mapName = std::string();
|
|
|
if (importName.empty()) {
|
|
|
return;
|
|
|
}
|
|
@@ -221,7 +221,7 @@ void Q3BSPFileImporter::separateMapName(const std::string &importName, std::stri
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
// Returns the first map in the map archive.
|
|
|
bool Q3BSPFileImporter::findFirstMapInArchive(ZipArchiveIOSystem &bspArchive, std::string &mapName) {
|
|
|
- mapName = "";
|
|
|
+ mapName = std::string();
|
|
|
std::vector<std::string> fileList;
|
|
|
bspArchive.getFileListExtension(fileList, "bsp");
|
|
|
if (fileList.empty()) {
|
|
@@ -440,7 +440,7 @@ void Q3BSPFileImporter::createMaterials(const Q3BSP::Q3BSPModel *pModel, aiScene
|
|
|
if (-1 != textureId) {
|
|
|
sQ3BSPTexture *pTexture = pModel->m_Textures[textureId];
|
|
|
if (nullptr != pTexture) {
|
|
|
- std::string tmp("*"), texName("");
|
|
|
+ std::string tmp("*"), texName;
|
|
|
tmp += pTexture->strName;
|
|
|
tmp += ".jpg";
|
|
|
normalizePathName(tmp, texName);
|
|
@@ -512,7 +512,7 @@ size_t Q3BSPFileImporter::countTriangles(const std::vector<Q3BSP::sQ3BSPFace *>
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
// Creates the faces-to-material map.
|
|
|
void Q3BSPFileImporter::createMaterialMap(const Q3BSP::Q3BSPModel *pModel) {
|
|
|
- std::string key("");
|
|
|
+ std::string key;
|
|
|
std::vector<sQ3BSPFace *> *pCurFaceArray = nullptr;
|
|
|
for (size_t idx = 0; idx < pModel->m_Faces.size(); idx++) {
|
|
|
Q3BSP::sQ3BSPFace *pQ3BSPFace = pModel->m_Faces[idx];
|
|
@@ -660,7 +660,7 @@ bool Q3BSPFileImporter::expandFile(ZipArchiveIOSystem *pArchive, const std::stri
|
|
|
|
|
|
if (rExtList.empty()) {
|
|
|
rFile = rFilename;
|
|
|
- rExt = "";
|
|
|
+ rExt = std::string();
|
|
|
return true;
|
|
|
}
|
|
|
|