From: ThorstenB Date: Sun, 6 Mar 2011 21:38:44 +0000 (+0100) Subject: Replace occurrences of osgDB::findDataFile with SGModelLib wrapper X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a22dd264cd47d89f73b8be0276032c235db1f444;p=simgear.git Replace occurrences of osgDB::findDataFile with SGModelLib wrapper which considers separate aircraft dirs (--fg-aircraft). --- diff --git a/simgear/scene/material/Effect.cxx b/simgear/scene/material/Effect.cxx index e605f9f6..6517bd23 100644 --- a/simgear/scene/material/Effect.cxx +++ b/simgear/scene/material/Effect.cxx @@ -725,7 +725,7 @@ void reload_shaders() for(ShaderMap::iterator sitr = shaderMap.begin(); sitr != shaderMap.end(); ++sitr) { Shader *shader = sitr->second.get(); - string fileName = osgDB::findDataFile(sitr->first.first); + string fileName = SGModelLib::findDataFile(sitr->first.first); if (!fileName.empty()) { shader->loadShaderSourceFromFile(fileName); } @@ -814,7 +814,7 @@ void ShaderProgramBuilder::buildAttribute(Effect* effect, Pass* pass, { const string& shaderName = shaderKey.first; Shader::Type stype = shaderKey.second; - string fileName = osgDB::findDataFile(shaderName, options); + string fileName = SGModelLib::findDataFile(shaderName, options); if (fileName.empty()) throw BuilderException(string("couldn't find shader ") + shaderName); diff --git a/simgear/scene/material/mat.cxx b/simgear/scene/material/mat.cxx index cc2d178a..fcd95da3 100644 --- a/simgear/scene/material/mat.cxx +++ b/simgear/scene/material/mat.cxx @@ -128,11 +128,11 @@ SGMaterial::read_properties(const SGReaderWriterXMLOptions* options, } SGPath tpath("Textures.high"); tpath.append(tname); - string fullTexPath = osgDB::findDataFile(tpath.str(), options); + string fullTexPath = SGModelLib::findDataFile(tpath.str(), options); if (fullTexPath.empty()) { tpath = SGPath("Textures"); tpath.append(tname); - fullTexPath = osgDB::findDataFile(tpath.str(), options); + fullTexPath = SGModelLib::findDataFile(tpath.str(), options); } if (!fullTexPath.empty() ) { @@ -154,11 +154,11 @@ SGMaterial::read_properties(const SGReaderWriterXMLOptions* options, } SGPath tpath("Textures.high"); tpath.append(tname); - string fullTexPath = osgDB::findDataFile(tpath.str(), options); + string fullTexPath = SGModelLib::findDataFile(tpath.str(), options); if (fullTexPath.empty()) { tpath = SGPath("Textures"); tpath.append(tname); - fullTexPath = osgDB::findDataFile(tpath.str(), options); + fullTexPath = SGModelLib::findDataFile(tpath.str(), options); } st.add_texture(fullTexPath, textures[j]->getIndex()); } @@ -193,7 +193,7 @@ SGMaterial::read_properties(const SGReaderWriterXMLOptions* options, const SGPropertyNode* treeTexNode = props->getChild("tree-texture"); if (treeTexNode) { string treeTexPath = props->getStringValue("tree-texture"); - tree_texture = osgDB::findDataFile(treeTexPath, options); + tree_texture = SGModelLib::findDataFile(treeTexPath, options); } // surface values for use with ground reactions