From 0ad020bf16aa01169a484b165b96f73083457928 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 25 Jun 2009 13:00:01 +0000 Subject: [PATCH] From Ulrich Hertlein, "please find attached some typo fixes in DatabasePager and a tweak to only print the addLoadedDataToSceneGraph stats when some work was actually done." --- src/osgDB/DatabasePager.cpp | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/osgDB/DatabasePager.cpp b/src/osgDB/DatabasePager.cpp index ed61f711c..e7245fe3b 100644 --- a/src/osgDB/DatabasePager.cpp +++ b/src/osgDB/DatabasePager.cpp @@ -1,4 +1,4 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or @@ -888,11 +888,12 @@ DatabasePager::DatabasePager() } } + _changeAutoUnRef = true; + _valueAutoUnRef = false; + _changeAnisotropy = false; _valueAnisotropy = 1.0f; - - const char* ptr=0; _deleteRemovedSubgraphsInDatabaseThread = true; @@ -1273,19 +1274,19 @@ void DatabasePager::requestNodeFile(const std::string& fileName,osg::Group* grou double timestamp = framestamp?framestamp->getReferenceTime():0.0; int frameNumber = framestamp?framestamp->getFrameNumber():_frameNumber; - + +#ifdef WITH_REQUESTNODEFILE_TIMING static int previousFrame = -1; static double totalTime = 0.0; - if (previousFrame!=frameNumber) { - // osg::notify(osg::NOTICE)<<"requestNodeFiles for "<_requestQueue; if (requestQueue) @@ -1319,7 +1320,7 @@ void DatabasePager::requestNodeFile(const std::string& fileName,osg::Group* grou if (databaseRequestRef->referenceCount()==1) { - osg::notify(osg::INFO)<<"DatabasePager::fileRquest("<_frameNumberFirstRequest = frameNumber; databaseRequest->_timestampFirstRequest = timestamp; @@ -1339,7 +1340,7 @@ void DatabasePager::requestNodeFile(const std::string& fileName,osg::Group* grou if (!foundEntry) { - osg::notify(osg::INFO)<<"In DatabasePager::fileRquest("< lock(_fileRequestQueue->_requestMutex); @@ -1393,7 +1394,9 @@ void DatabasePager::requestNodeFile(const std::string& fileName,osg::Group* grou } } +#ifdef WITH_REQUESTNODEFILE_TIMING totalTime += osg::Timer::instance()->delta_m(start_tick, osg::Timer::instance()->tick()); +#endif } void DatabasePager::signalBeginFrame(const osg::FrameStamp* framestamp) @@ -1505,11 +1508,13 @@ void DatabasePager::addLoadedDataToSceneGraph(const osg::FrameStamp &frameStamp) osg::Timer_t last = osg::Timer::instance()->tick(); - osg::notify(osg::DEBUG_INFO)<<"Done DatabasePager::addLoadedDataToSceneGraph"<< - osg::Timer::instance()->delta_m(before,mid)<<"ms,\t"<< - osg::Timer::instance()->delta_m(mid,last)<<"ms"<< - " objects"<delta_m(before,mid)<<"ms,\t"<< + osg::Timer::instance()->delta_m(mid,last)<<"ms"<< + " objects"<