Replace occurrences of osgDB::findDataFile with SGModelLib wrapper
which considers separate aircraft dirs (--fg-aircraft).
This commit is contained in:
@@ -725,7 +725,7 @@ void reload_shaders()
|
|||||||
for(ShaderMap::iterator sitr = shaderMap.begin(); sitr != shaderMap.end(); ++sitr)
|
for(ShaderMap::iterator sitr = shaderMap.begin(); sitr != shaderMap.end(); ++sitr)
|
||||||
{
|
{
|
||||||
Shader *shader = sitr->second.get();
|
Shader *shader = sitr->second.get();
|
||||||
string fileName = osgDB::findDataFile(sitr->first.first);
|
string fileName = SGModelLib::findDataFile(sitr->first.first);
|
||||||
if (!fileName.empty()) {
|
if (!fileName.empty()) {
|
||||||
shader->loadShaderSourceFromFile(fileName);
|
shader->loadShaderSourceFromFile(fileName);
|
||||||
}
|
}
|
||||||
@@ -814,7 +814,7 @@ void ShaderProgramBuilder::buildAttribute(Effect* effect, Pass* pass,
|
|||||||
{
|
{
|
||||||
const string& shaderName = shaderKey.first;
|
const string& shaderName = shaderKey.first;
|
||||||
Shader::Type stype = shaderKey.second;
|
Shader::Type stype = shaderKey.second;
|
||||||
string fileName = osgDB::findDataFile(shaderName, options);
|
string fileName = SGModelLib::findDataFile(shaderName, options);
|
||||||
if (fileName.empty())
|
if (fileName.empty())
|
||||||
throw BuilderException(string("couldn't find shader ") +
|
throw BuilderException(string("couldn't find shader ") +
|
||||||
shaderName);
|
shaderName);
|
||||||
|
|||||||
@@ -128,11 +128,11 @@ SGMaterial::read_properties(const SGReaderWriterXMLOptions* options,
|
|||||||
}
|
}
|
||||||
SGPath tpath("Textures.high");
|
SGPath tpath("Textures.high");
|
||||||
tpath.append(tname);
|
tpath.append(tname);
|
||||||
string fullTexPath = osgDB::findDataFile(tpath.str(), options);
|
string fullTexPath = SGModelLib::findDataFile(tpath.str(), options);
|
||||||
if (fullTexPath.empty()) {
|
if (fullTexPath.empty()) {
|
||||||
tpath = SGPath("Textures");
|
tpath = SGPath("Textures");
|
||||||
tpath.append(tname);
|
tpath.append(tname);
|
||||||
fullTexPath = osgDB::findDataFile(tpath.str(), options);
|
fullTexPath = SGModelLib::findDataFile(tpath.str(), options);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fullTexPath.empty() ) {
|
if (!fullTexPath.empty() ) {
|
||||||
@@ -154,11 +154,11 @@ SGMaterial::read_properties(const SGReaderWriterXMLOptions* options,
|
|||||||
}
|
}
|
||||||
SGPath tpath("Textures.high");
|
SGPath tpath("Textures.high");
|
||||||
tpath.append(tname);
|
tpath.append(tname);
|
||||||
string fullTexPath = osgDB::findDataFile(tpath.str(), options);
|
string fullTexPath = SGModelLib::findDataFile(tpath.str(), options);
|
||||||
if (fullTexPath.empty()) {
|
if (fullTexPath.empty()) {
|
||||||
tpath = SGPath("Textures");
|
tpath = SGPath("Textures");
|
||||||
tpath.append(tname);
|
tpath.append(tname);
|
||||||
fullTexPath = osgDB::findDataFile(tpath.str(), options);
|
fullTexPath = SGModelLib::findDataFile(tpath.str(), options);
|
||||||
}
|
}
|
||||||
st.add_texture(fullTexPath, textures[j]->getIndex());
|
st.add_texture(fullTexPath, textures[j]->getIndex());
|
||||||
}
|
}
|
||||||
@@ -193,7 +193,7 @@ SGMaterial::read_properties(const SGReaderWriterXMLOptions* options,
|
|||||||
const SGPropertyNode* treeTexNode = props->getChild("tree-texture");
|
const SGPropertyNode* treeTexNode = props->getChild("tree-texture");
|
||||||
if (treeTexNode) {
|
if (treeTexNode) {
|
||||||
string treeTexPath = props->getStringValue("tree-texture");
|
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
|
// surface values for use with ground reactions
|
||||||
|
|||||||
Reference in New Issue
Block a user