Remove Textures.high logic

This commit is contained in:
Clément de l'Hamaide
2014-08-27 22:08:20 +02:00
parent 3ca7369fb2
commit c30ce67e16
+12 -30
View File
@@ -146,17 +146,12 @@ SGMaterial::read_properties(const SGReaderWriterOptions* options,
tname = "unknown.rgb"; tname = "unknown.rgb";
} }
SGPath tpath("Textures.high"); SGPath tpath("Textures");
tpath.append(tname); tpath.append(tname);
std::string fullTexPath = SGModelLib::findDataFile(tpath.str(), options); std::string fullTexPath = SGModelLib::findDataFile(tpath.str(), options);
if (fullTexPath.empty()) { if (fullTexPath.empty()) {
tpath.set("Textures"); SG_LOG(SG_GENERAL, SG_ALERT, "Cannot find texture \""
tpath.append(tname); << tname << "\" in Textures folders.");
fullTexPath = SGModelLib::findDataFile(tpath.str(), options);
if (fullTexPath.empty()) {
SG_LOG(SG_GENERAL, SG_ALERT, "Cannot find texture \""
<< tname << "\" in Textures or Textures.high folders.");
}
} }
if (tpath.lower_extension() == "dds") { if (tpath.lower_extension() == "dds") {
@@ -183,17 +178,12 @@ SGMaterial::read_properties(const SGReaderWriterOptions* options,
tname = "unknown.rgb"; tname = "unknown.rgb";
} }
SGPath tpath("Textures.high"); SGPath tpath("Textures");
tpath.append(tname); tpath.append(tname);
std::string fullTexPath = SGModelLib::findDataFile(tpath.str(), options); std::string fullTexPath = SGModelLib::findDataFile(tpath.str(), options);
if (fullTexPath.empty()) { if (fullTexPath.empty()) {
tpath.set("Textures"); SG_LOG(SG_GENERAL, SG_ALERT, "Cannot find texture \""
tpath.append(tname); << tname << "\" in Textures folders.");
fullTexPath = SGModelLib::findDataFile(tpath.str(), options);
if (fullTexPath.empty() ) {
SG_LOG(SG_GENERAL, SG_ALERT, "Cannot find texture \""
<< tname << "\" in Textures or Textures.high folders.");
}
} }
if (j == 0) { if (j == 0) {
@@ -226,20 +216,13 @@ SGMaterial::read_properties(const SGReaderWriterOptions* options,
std::string omname = masks[i]->getStringValue(); std::string omname = masks[i]->getStringValue();
if (! omname.empty()) { if (! omname.empty()) {
SGPath ompath("Textures.high"); SGPath ompath("Textures");
ompath.append(omname); ompath.append(omname);
std::string fullMaskPath = std::string fullMaskPath = SGModelLib::findDataFile(ompath.str(), options);
SGModelLib::findDataFile(ompath.str(), options);
if (fullMaskPath.empty()) {
ompath.set("Textures");
ompath.append(omname);
fullMaskPath = SGModelLib::findDataFile(ompath.str(), options);
}
if (fullMaskPath.empty()) { if (fullMaskPath.empty()) {
SG_LOG(SG_GENERAL, SG_ALERT, "Cannot find texture \"" SG_LOG(SG_GENERAL, SG_ALERT, "Cannot find texture \""
<< omname << "\" in Textures or Textures.high folders."); << omname << "\" in Textures folders.");
} }
else else
{ {
@@ -353,14 +336,13 @@ SGMaterial::read_properties(const SGReaderWriterOptions* options,
std::string treeTexPath = props->getStringValue("tree-texture"); std::string treeTexPath = props->getStringValue("tree-texture");
if (! treeTexPath.empty()) { if (! treeTexPath.empty()) {
SGPath treePath("Textures.high"); SGPath treePath("Textures");
treePath.append(treeTexPath); treePath.append(treeTexPath);
tree_texture = SGModelLib::findDataFile(treePath.str(), options); tree_texture = SGModelLib::findDataFile(treePath.str(), options);
if (tree_texture.empty()) { if (tree_texture.empty()) {
treePath.set("Textures"); SG_LOG(SG_GENERAL, SG_ALERT, "Cannot find texture \""
treePath.append(treeTexPath); << treeTexPath << "\" in Textures folders.");
tree_texture = SGModelLib::findDataFile(treePath.str(), options);
} }
} }
} }