]> git.mxchange.org Git - simgear.git/commitdiff
scenery: ModelLoadHelper is no longer needed.
authorMathias Froehlich <Mathias.Froehlich@web.de>
Thu, 15 Mar 2012 19:08:38 +0000 (20:08 +0100)
committerMathias Froehlich <Mathias.Froehlich@web.de>
Thu, 15 Mar 2012 19:08:38 +0000 (20:08 +0100)
simgear/scene/tgdb/TileEntry.cxx
simgear/scene/tgdb/TileEntry.hxx

index fffb7f9adc90c14f177c498c7e2f485f7c698f0f..71a7f57d21d58a08e72971beeb26a1ce4fff8e6d 100644 (file)
@@ -58,8 +58,6 @@
 using std::string;
 using namespace simgear;
 
-static ModelLoadHelper *_modelLoader=0;
-
 static SGBucket getBucketFromFileName(const std::string& fileName)
 {
     std::istringstream ss(osgDB::getNameLessExtension(fileName));
@@ -152,17 +150,13 @@ loadStgFile(const std::string& absoluteFileName, osg::Group& group, const osgDB:
                 /// Hmm, the findDataFile should happen downstream
                 std::string absName = osgDB::findDataFile(name,
                                                           staticOptions.get());
-                if(_modelLoader) {
-                    node = _modelLoader->loadTileModel(absName, false);
-                } else {
-                    osg::ref_ptr<SGReaderWriterOptions> opt;
-                    opt = new SGReaderWriterOptions(*staticOptions);
-                    if (SGPath(absName).lower_extension() == "ac")
-                        opt->setInstantiateEffects(true);
-                    else
-                        opt->setInstantiateEffects(false);
-                    node = osgDB::readRefNodeFile(absName, opt.get());
-                }
+                osg::ref_ptr<SGReaderWriterOptions> opt;
+                opt = new SGReaderWriterOptions(*staticOptions);
+                if (SGPath(absName).lower_extension() == "ac")
+                    opt->setInstantiateEffects(true);
+                else
+                    opt->setInstantiateEffects(false);
+                node = osgDB::readRefNodeFile(absName, opt.get());
                 
                 if (!node.valid()) {
                     SG_LOG( SG_TERRAIN, SG_ALERT, absoluteFileName
@@ -171,25 +165,21 @@ loadStgFile(const std::string& absoluteFileName, osg::Group& group, const osgDB:
                 }
                 
             } else if ( token == "OBJECT_SHARED" ) {
-                if(_modelLoader) {
-                    node = _modelLoader->loadTileModel(name, true);
-                } else {
-                    osg::ref_ptr<SGReaderWriterOptions> opt;
-                    opt = new SGReaderWriterOptions(*sharedOptions);
-
-                    /// Hmm, the findDataFile should happen in the downstream readers
-                    std::string absName = osgDB::findDataFile(name, opt.get());
-
-                    osg::ProxyNode* proxyNode = new osg::ProxyNode;
-                    proxyNode->setLoadingExternalReferenceMode(osg::ProxyNode::DEFER_LOADING_TO_DATABASE_PAGER);
-                    proxyNode->setFileName(0, absName);
-                    if (SGPath(absName).lower_extension() == "ac")
-                        opt->setInstantiateEffects(true);
-                    else
-                        opt->setInstantiateEffects(false);
-                    proxyNode->setDatabaseOptions(opt.get());
-                    node = proxyNode;
-                }
+                osg::ref_ptr<SGReaderWriterOptions> opt;
+                opt = new SGReaderWriterOptions(*sharedOptions);
+                
+                /// Hmm, the findDataFile should happen in the downstream readers
+                std::string absName = osgDB::findDataFile(name, opt.get());
+                
+                osg::ProxyNode* proxyNode = new osg::ProxyNode;
+                proxyNode->setLoadingExternalReferenceMode(osg::ProxyNode::DEFER_LOADING_TO_DATABASE_PAGER);
+                proxyNode->setFileName(0, absName);
+                if (SGPath(absName).lower_extension() == "ac")
+                    opt->setInstantiateEffects(true);
+                else
+                    opt->setInstantiateEffects(false);
+                proxyNode->setDatabaseOptions(opt.get());
+                node = proxyNode;
                 
                 if (!node.valid()) {
                     SG_LOG( SG_TERRAIN, SG_ALERT, absoluteFileName
@@ -231,12 +221,6 @@ loadStgFile(const std::string& absoluteFileName, osg::Group& group, const osgDB:
     return has_base;
 }
     
-void
-TileEntry::setModelLoadHelper(ModelLoadHelper *m)
-{
-    _modelLoader=m;
-}
-
 // Constructor
 TileEntry::TileEntry ( const SGBucket& b )
     : tile_bucket( b ),
index 096caed9faaa458f5ef9a061b7c21551e8a5887a..b05978a76409359306c03c3876cd0c878dc90ba6 100644 (file)
@@ -48,8 +48,6 @@
 
 namespace simgear {
 
-class ModelLoadHelper;
-
 /**
  * A class to encapsulate everything we need to know about a scenery tile.
  */
@@ -89,8 +87,6 @@ public:
     // Destructor
     ~TileEntry();
 
-    static void setModelLoadHelper(ModelLoadHelper *m);
-
     // Update the ssg transform node for this tile so it can be
     // properly drawn relative to our (0,0,0) point
     void prep_ssg_node(float vis);
@@ -157,12 +153,6 @@ public:
     }
 };
 
-class ModelLoadHelper {
-public:
-    virtual osg::Node *loadTileModel(const std::string& modelPath, bool cacheModel)=0;
-
-};
-
 }
 
 #endif // _TILEENTRY_HXX