]> git.mxchange.org Git - simgear.git/commitdiff
Current timestamps for forced scenery loading.
authorThorstenB <brehmt@gmail.com>
Fri, 19 Nov 2010 12:39:20 +0000 (13:39 +0100)
committerThorstenB <brehmt@gmail.com>
Fri, 19 Nov 2010 12:39:20 +0000 (13:39 +0100)
Priorities during forced model loads won't work unless using current framestamps...

simgear/scene/model/CheckSceneryVisitor.cxx
simgear/scene/model/CheckSceneryVisitor.hxx
simgear/scene/model/SGPagedLOD.cxx
simgear/scene/model/SGPagedLOD.hxx

index ebcc011e650de3e7964b16e6c29f78650393235f..a21f103b3745c33c423e9a85a92634776cfc4640 100644 (file)
 
 using namespace simgear;
 
-CheckSceneryVisitor::CheckSceneryVisitor(osgDB::DatabasePager* dbp, const osg::Vec3 &position, double range)
+CheckSceneryVisitor::CheckSceneryVisitor(osgDB::DatabasePager* dbp, const osg::Vec3 &position, double range,
+                                         osg::FrameStamp* framestamp)
 :osg::NodeVisitor(osg::NodeVisitor::NODE_VISITOR,
                   osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN),
-_position(position), _range(range), _loaded(true), _dbp(dbp)
+_position(position), _range(range), _loaded(true), _dbp(dbp), _framestamp(framestamp)
 {
     _viewMatrices.push_back(osg::Matrix::identity());
 }
@@ -53,7 +54,7 @@ void CheckSceneryVisitor::apply(osg::PagedLOD& node)
                 // if the DatabasePager would load LODs while the splashscreen
                 // is there, we could just wait for the models to be loaded
                 // by only setting setLoaded(false) here
-                sgplod->forceLoad(_dbp);
+                sgplod->forceLoad(_dbp,_framestamp);
                 setLoaded(false);
             }
         }
index e3e5109f62369b3f40e9b03ee307f547488e504d..4b9a357da6d5b3c75e41e808e0c79ddfe10d24f8 100644 (file)
@@ -38,7 +38,7 @@ class SGPagedLOD;
 class CheckSceneryVisitor : public osg::NodeVisitor
 {
 public:
-    CheckSceneryVisitor(osgDB::DatabasePager* dbp, const osg::Vec3 &position, double range);
+    CheckSceneryVisitor(osgDB::DatabasePager* dbp, const osg::Vec3 &position, double range, osg::FrameStamp* framestamp);
 
     virtual void apply(osg::Node& node);
     virtual void apply(osg::PagedLOD& node);
@@ -59,6 +59,7 @@ private:
     double _range;
     bool _loaded;
     osgDB::DatabasePager* _dbp;
+    osg::FrameStamp* _framestamp;
 
     osg::fast_back_stack<osg::Matrix> _viewMatrices;
 };
index faaf42bb23f3ead4667dc06cf2b2a8800858d1ed..d309feb86dce44ad325dde7fd115ed3e7d3f0e49 100644 (file)
@@ -60,14 +60,14 @@ bool SGPagedLOD::addChild(osg::Node *child)
     return true;
 }
 
-void SGPagedLOD::forceLoad(osgDB::DatabasePager *dbp)
+void SGPagedLOD::forceLoad(osgDB::DatabasePager *dbp, osg::FrameStamp* framestamp)
 {
     //SG_LOG(SG_GENERAL, SG_ALERT, "SGPagedLOD::forceLoad(" <<
     //getFileName(getNumChildren()) << ")");
     unsigned childNum = getNumChildren();
     setTimeStamp(childNum, 0);
     double priority=1.0;
-    dbp->requestNodeFile(getFileName(childNum),this,priority,0,
+    dbp->requestNodeFile(getFileName(childNum),this,priority,framestamp,
                          getDatabaseRequest(childNum),
                          _readerWriterOptions.get());
 }
index 7bf54266ce9b1f50452f7d18a28189f4159b7161..fe256446b7ae6dd4aebc33a3cedbb776df87d065 100644 (file)
@@ -43,7 +43,7 @@ public:
     META_Node(simgear, SGPagedLOD);
 
     // virtual void traverse(osg::NodeVisitor& nv);
-    virtual void forceLoad(osgDB::DatabasePager* dbp);
+    virtual void forceLoad(osgDB::DatabasePager* dbp, osg::FrameStamp* framestamp);
 
     // reimplemented to notify the loading through ModelData
     bool addChild(osg::Node *child);