]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/model/modellib.cxx
Improved tile cache priority scheme.
[simgear.git] / simgear / scene / model / modellib.cxx
index cfa5b5c8d7f2553d8a587ec60bfbbc055f2539a1..ae90f1a46b6d6d4033c636fcacbbdec04c45adf7 100644 (file)
@@ -30,6 +30,7 @@
 #include <simgear/props/props_io.hxx>
 #include <simgear/scene/model/model.hxx>
 #include <simgear/scene/model/ModelRegistry.hxx>
+#include <simgear/misc/ResourceManager.hxx>
 
 #include "SGPagedLOD.hxx"
 #include "SGReaderWriterXML.hxx"
@@ -47,7 +48,6 @@ ModelRegistryCallbackProxy<LoadOnlyCallback> g_xmlCallbackProxy("xml");
 
 \fSGPropertyNode_ptr SGModelLib::static_propRoot;
 SGModelLib::panel_func SGModelLib::static_panelFunc = NULL;
-SGModelLib::resolve_func SGModelLib::static_resolver = NULL;
 
 ////////////////////////////////////////////////////////////////////////
 // Implementation of SGModelLib.
@@ -67,21 +67,16 @@ void SGModelLib::setPanelFunc(panel_func pf)
   static_panelFunc = pf;
 }
 
-void SGModelLib::setResolveFunc(resolve_func rf)
-{
-  static_resolver = rf;
-}
-
 std::string SGModelLib::findDataFile(const std::string& file, 
-  const osgDB::ReaderWriter::Options* opts)
+  const osgDB::ReaderWriter::Options* opts,
+  SGPath currentPath)
 {
-  if (static_resolver) {
-    SGPath p = static_resolver(file);
-    if (p.exists()) {
-      return p.str();
-    }
+  SGPath p = ResourceManager::instance()->findPath(file, currentPath);
+  if (p.exists()) {
+    return p.str();
   }
-  
+      
+  // finally hand on to standard OSG behaviour
   return osgDB::findDataFile(file, opts);
 }