]> git.mxchange.org Git - flightgear.git/commitdiff
Load BTG files through the osgDB::Registry
authortimoore <timoore>
Sun, 29 Jul 2007 22:34:15 +0000 (22:34 +0000)
committertimoore <timoore>
Sun, 29 Jul 2007 22:34:15 +0000 (22:34 +0000)
This is part of changes leading towards using the OSG database pager thread.

src/Scenery/tileentry.cxx

index 2d7e44f2e29c37e1d9e05fd7698f03576754b95f..1b19ba680f61e57a41a3626b87849bd26c42f3ad 100644 (file)
@@ -40,6 +40,8 @@
 #include <osg/NodeCallback>
 #include <osg/Switch>
 
+#include <osgDB/ReadFile>
+
 #include <simgear/bucket/newbucket.hxx>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/math/polar3d.hxx>
@@ -50,6 +52,7 @@
 #include <simgear/scene/material/matlib.hxx>
 #include <simgear/scene/tgdb/apt_signs.hxx>
 #include <simgear/scene/tgdb/obj.hxx>
+#include <simgear/scene/tgdb/SGReaderWriterBTGOptions.hxx>
 #include <simgear/scene/model/placementtrans.hxx>
 #include <simgear/scene/util/SGUpdateVisitor.hxx>
 
@@ -215,7 +218,12 @@ bool FGTileEntry::obj_load( const string& path,
         fgGetBool("/sim/rendering/random-objects", true);
 
     // try loading binary format
-    osg::Node* node = SGLoadBTG(path, globals->get_matlib(), is_base, use_random_objects);
+    osg::ref_ptr<SGReaderWriterBTGOptions> options
+        = new SGReaderWriterBTGOptions();
+    options->setMatlib(globals->get_matlib());
+    options->setCalcLights(is_base);
+    options->setUseRandomObjects(use_random_objects);
+    osg::Node* node = osgDB::readNodeFile(path, options.get());
     if (node)
       geometry->addChild(node);