]> git.mxchange.org Git - simgear.git/commitdiff
More checks/error messages for missing files,
authorThorstenB <brehmt@gmail.com>
Sat, 17 Mar 2012 09:15:31 +0000 (10:15 +0100)
committerThorstenB <brehmt@gmail.com>
Sat, 17 Mar 2012 09:15:31 +0000 (10:15 +0100)
checking return value of findDataFile.

simgear/scene/material/mat.cxx

index 547140ca34347b43b5ca6ebf757d3aebad3dfaa8..582571f3096d734e58558fb077520530c44f32b6 100644 (file)
@@ -138,6 +138,10 @@ SGMaterial::read_properties(const SGReaderWriterOptions* options,
             tpath = SGPath("Textures");
             tpath.append(tname);
             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") {
@@ -171,6 +175,10 @@ SGMaterial::read_properties(const SGReaderWriterOptions* options,
                 tpath = SGPath("Textures");
                 tpath.append(tname);
                 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) {
@@ -214,8 +222,8 @@ SGMaterial::read_properties(const SGReaderWriterOptions* options,
             }
 
             if (fullMaskPath.empty()) {
-                SG_LOG(SG_GENERAL, SG_ALERT, "Cannot find texture file \""
-                        << ompath.str() << "\"");
+                SG_LOG(SG_GENERAL, SG_ALERT, "Cannot find texture \""
+                        << omname << "\" in Textures or Textures.high folders.");
             }
             else
             {