]> git.mxchange.org Git - simgear.git/commitdiff
Allow (ab)using findDataFile to also search directories again.
authorThorstenB <brehmt@gmail.com>
Sun, 19 Feb 2012 13:38:52 +0000 (14:38 +0100)
committerThorstenB <brehmt@gmail.com>
Sun, 19 Feb 2012 13:39:19 +0000 (14:39 +0100)
simgear/scene/material/TextureBuilder.cxx
simgear/scene/model/modellib.cxx

index 0c141c475c3415b627c354ad8cb53b4a1d52eb69..75bd08c553d2faafb5eee28416095834e27e670e 100644 (file)
@@ -243,8 +243,11 @@ void setAttrs(const TexTuple& attrs, Texture* tex,
     } else {
         osgDB::ReaderWriter::ReadResult result;
         result = osgDB::readImageFile(imageName, options);
-        if (result.success()) {
-            osg::ref_ptr<osg::Image> image = result.getImage();
+        osg::ref_ptr<osg::Image> image;
+        if (result.success())
+            image = result.getImage();
+        if (image.valid())
+        {
             image = computeMipmap( image.get(), attrs.get<7>() );
             tex->setImage(GL_FRONT_AND_BACK, image.get());
             int s = image->s();
@@ -360,7 +363,7 @@ osg::Image* make3DNoiseImage(int texSize)
     GLubyte *ptr;
     double amp = 0.5;
 
-    osg::notify(osg::WARN) << "creating 3D noise texture... ";
+    SG_LOG(SG_INPUT, SG_INFO, "creating 3D noise texture... ");
 
     for (f = 0, inc = 0; f < numOctaves; ++f, frequency *= 2, ++inc, amp *= 0.5)
     {
@@ -383,7 +386,7 @@ osg::Image* make3DNoiseImage(int texSize)
         }
     }
 
-    osg::notify(osg::WARN) << "DONE" << std::endl;
+    SG_LOG(SG_INPUT, SG_INFO, "creating 3D noise textures complete!");
     return image;
 }
 
index 68872550b4747bbefc5db53570ee86ccabf84f0b..5c8a2eb2e29f08f881ebc90ee34e6e8e4bd9e686 100644 (file)
@@ -71,7 +71,7 @@ std::string SGModelLib::findDataFile(const std::string& file,
   if (file.empty())
     return file;
   SGPath p = ResourceManager::instance()->findPath(file, currentPath);
-  if (p.exists()&&p.isFile()) {
+  if (p.exists()) {
     return p.str();
   }