]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/material/TextureBuilder.cxx
Remove using std:: from the metar header, remove HTTP support, add very basic unit...
[simgear.git] / simgear / scene / material / TextureBuilder.cxx
index 0e487a99bd7c84b39c173d7001abf6d4bebe96f8..f53fe5265910acdae34eef9b29e57c1317793904 100644 (file)
@@ -132,8 +132,8 @@ void TextureUnitBuilder::buildAttribute(Effect* effect, Pass* pass,
         texture = TextureBuilder::buildFromType(effect, type, prop,
                                                 options);
     }
-    catch (BuilderException& ) {
-        SG_LOG(SG_INPUT, SG_ALERT, "No image file, "
+    catch (BuilderException& e) {
+        SG_LOG(SG_INPUT, SG_ALERT, e.getFormattedMessage() << ", "
             << "maybe the reader did not set the filename attribute, "
             << "using white for type '" << type << "' on '" << pass->getName() << "', in " << prop->getPath() );
         texture = StateAttributeFactory::instance()->getWhiteTexture();
@@ -211,9 +211,17 @@ TexTuple makeTexTuple(Effect* effect, const SGPropertyNode* props,
     const SGPropertyNode* pImage
         = getEffectPropertyChild(effect, props, "image");
     string imageName;
+    string absFileName;
     if (pImage)
+    {
         imageName = pImage->getStringValue();
-    string absFileName = osgDB::findDataFile(imageName, options);
+        absFileName = SGModelLib::findDataFile(imageName, options);
+        if (absFileName.empty())
+        {
+            SG_LOG(SG_INPUT, SG_ALERT, "Texture file not found: '"
+                   << imageName << "'");
+        }
+    }
 
     const SGPropertyNode* pMipmapControl
         = getEffectPropertyChild(effect, props, "mipmap-control");