]> git.mxchange.org Git - simgear.git/commitdiff
Replace occurrences of osgDB::findDataFile with SGModelLib wrapper
authorThorstenB <brehmt@gmail.com>
Sun, 6 Mar 2011 21:38:44 +0000 (22:38 +0100)
committerThorstenB <brehmt@gmail.com>
Sun, 6 Mar 2011 21:38:44 +0000 (22:38 +0100)
which considers separate aircraft dirs (--fg-aircraft).

simgear/scene/material/Effect.cxx
simgear/scene/material/mat.cxx

index e605f9f696e2b4a396fd135be6264bad55b87aed..6517bd2390171be9de11901dbfefcdaa0ddb643c 100644 (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);
index cc2d178ab7316b36525ff2f96847812e750b5d5b..fcd95da3d37eeee52e19d688e5cbeb95709eb47e 100644 (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