]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/material/TextureBuilder.cxx
Merge remote branch 'origin/releases/2.2.0' into next
[simgear.git] / simgear / scene / material / TextureBuilder.cxx
index a694ea661601754a90497db0e41cbe08e3a0519c..797dae25c816c54aaeeeb32c2e9d0829f7035ecb 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();
@@ -213,7 +213,7 @@ TexTuple makeTexTuple(Effect* effect, const SGPropertyNode* props,
     string imageName;
     if (pImage)
         imageName = pImage->getStringValue();
-    string absFileName = osgDB::findDataFile(imageName, options);
+    string absFileName = SGModelLib::findDataFile(imageName, options);
 
     const SGPropertyNode* pMipmapControl
         = getEffectPropertyChild(effect, props, "mipmap-control");
@@ -236,8 +236,8 @@ void setAttrs(const TexTuple& attrs, Texture* tex,
             = osgDB::Registry::instance()->readImage(imageName, options);
         if (result.success()) {
             osg::ref_ptr<osg::Image> image = result.getImage();
-            image = computeMipmap( image, attrs.get<7>() );
-            tex->setImage(GL_FRONT_AND_BACK, image);
+            image = computeMipmap( image.get(), attrs.get<7>() );
+            tex->setImage(GL_FRONT_AND_BACK, image.get());
             int s = image->s();
             int t = image->t();
             if (s <= t && 32 <= s) {