Replace occurrences of osgDB::findDataFile with SGModelLib wrapper

which considers separate aircraft dirs (--fg-aircraft).
This commit is contained in:
ThorstenB
2011-03-06 22:38:44 +01:00
parent baf5116841
commit a22dd264cd
2 changed files with 7 additions and 7 deletions

View File

@@ -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);

View File

@@ -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