From 768f46636555cca70a38c8560b9aa2a883190bc7 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 3 Jun 2010 16:24:25 +0000 Subject: [PATCH] Fixed double registeration bug. --- include/osgDB/DatabasePager | 1 + src/osgDB/DatabasePager.cpp | 21 +++++---------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/include/osgDB/DatabasePager b/include/osgDB/DatabasePager index f48d26f03..6eefbc20c 100644 --- a/include/osgDB/DatabasePager +++ b/include/osgDB/DatabasePager @@ -347,6 +347,7 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl virtual void moveActivePagedLODTo(PagedLODList& activePagedLODList, const osg::FrameStamp& framestamp) = 0; virtual void removeExpiredChildren(int& numberChildrenToRemove, double expiryTime, int expiryFrame, osg::NodeList& childrenRemoved) = 0; virtual void insertPagedLOD(osg::PagedLOD* plod) = 0; + virtual bool containsPagedLOD(osg::PagedLOD* plod) = 0; }; protected: diff --git a/src/osgDB/DatabasePager.cpp b/src/osgDB/DatabasePager.cpp index 0ea806cfa..673dc8386 100644 --- a/src/osgDB/DatabasePager.cpp +++ b/src/osgDB/DatabasePager.cpp @@ -264,6 +264,8 @@ public: return; } + // OSG_NOTICE<<"OK: SetBasedPagedLODList::insertPagedLOD("<_frameNumberLastRequest<_groupForAddingLoadedSubgraph; +#if 0 if (osgDB::Registry::instance()->getSharedStateManager()) osgDB::Registry::instance()->getSharedStateManager()->share(databaseRequest->_loadedModel.get()); - +#endif osg::PagedLOD* plod = dynamic_cast(group); if (plod) @@ -1699,7 +1702,7 @@ void DatabasePager::addLoadedDataToSceneGraph(const osg::FrameStamp &frameStamp) group->addChild(databaseRequest->_loadedModel.get()); - registerPagedLODs(group, frameStamp.getFrameNumber()); + registerPagedLODs(databaseRequest->_loadedModel.get(), frameStamp.getFrameNumber()); // OSG_NOTICE<<"merged subgraph"<_fileName<<" after "<_numOfRequests<<" requests and time="<<(timeStamp-databaseRequest->_timestampFirstRequest)*1000.0< s_registedSet; - - OSG_NOTICE<<"DatabasePager::registerPagedLODs("<accept(fplv); - } bool DatabasePager::requiresCompileGLObjects() const