From 2a9d39f201cf902ae6a1ba5081f929034b2a0c19 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Sun, 19 Feb 2012 14:38:52 +0100 Subject: [PATCH] Allow (ab)using findDataFile to also search directories again. --- simgear/scene/material/TextureBuilder.cxx | 11 +++++++---- simgear/scene/model/modellib.cxx | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/simgear/scene/material/TextureBuilder.cxx b/simgear/scene/material/TextureBuilder.cxx index 0c141c47..75bd08c5 100644 --- a/simgear/scene/material/TextureBuilder.cxx +++ b/simgear/scene/material/TextureBuilder.cxx @@ -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 image = result.getImage(); + osg::ref_ptr 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; } diff --git a/simgear/scene/model/modellib.cxx b/simgear/scene/model/modellib.cxx index 68872550..5c8a2eb2 100644 --- a/simgear/scene/model/modellib.cxx +++ b/simgear/scene/model/modellib.cxx @@ -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(); } -- 2.39.5