From e55017bbfce20a999bc9173260f402b2ec3819d0 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Fri, 4 Mar 2011 22:50:32 +0100 Subject: [PATCH] Fix TextureBuilder to work with --fg-aircraft dirs. Avoid direct use of osgDB to search for files. Using SGModelLib instead to also search fg-aircraft dirs. --- simgear/scene/material/TextureBuilder.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/simgear/scene/material/TextureBuilder.cxx b/simgear/scene/material/TextureBuilder.cxx index 0e487a99..797dae25 100644 --- a/simgear/scene/material/TextureBuilder.cxx +++ b/simgear/scene/material/TextureBuilder.cxx @@ -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"); -- 2.39.5