Show
Ignore:
Timestamp:
06/25/09 15:00:01 (5 years ago)
Author:
robert
Message:

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."

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgDB/DatabasePager.cpp

    r10176 r10407  
    1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield  
     1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 
    22 * 
    33 * This library is open source and may be redistributed and/or modified under   
     
    889889    } 
    890890 
     891    _changeAutoUnRef = true; 
     892    _valueAutoUnRef = false; 
     893  
    891894    _changeAnisotropy = false; 
    892895    _valueAnisotropy = 1.0f; 
    893896 
    894  
    895      
    896897    const char* ptr=0; 
    897898 
     
    12741275    double timestamp = framestamp?framestamp->getReferenceTime():0.0; 
    12751276    int frameNumber = framestamp?framestamp->getFrameNumber():_frameNumber; 
    1276      
     1277  
     1278#ifdef WITH_REQUESTNODEFILE_TIMING 
    12771279    static int previousFrame = -1; 
    12781280    static double totalTime = 0.0; 
    12791281     
    1280  
    12811282    if (previousFrame!=frameNumber) 
    12821283    { 
    1283         // osg::notify(osg::NOTICE)<<"requestNodeFiles for "<<previousFrame<<" time = "<<totalTime<<std::endl; 
     1284        osg::notify(osg::NOTICE)<<"requestNodeFiles for "<<previousFrame<<" time = "<<totalTime<<std::endl; 
    12841285 
    12851286        previousFrame = frameNumber; 
    12861287        totalTime = 0.0; 
    12871288    } 
    1288  
     1289#endif 
    12891290     
    12901291    // search to see if filename already exist in the file loaded list. 
     
    12961297        if (databaseRequest) 
    12971298        { 
    1298             osg::notify(osg::INFO)<<"DatabasePager::fileRequest("<<fileName<<") updating already assigned."<<std::endl; 
     1299            osg::notify(osg::INFO)<<"DatabasePager::requestNodeFile("<<fileName<<") updating already assigned."<<std::endl; 
    12991300 
    13001301            RequestQueue* requestQueue = databaseRequest->_requestQueue; 
     
    13201321            if (databaseRequestRef->referenceCount()==1) 
    13211322            { 
    1322                 osg::notify(osg::INFO)<<"DatabasePager::fileRquest("<<fileName<<") orphaned, resubmitting."<<std::endl; 
     1323                osg::notify(osg::INFO)<<"DatabasePager::requestNodeFile("<<fileName<<") orphaned, resubmitting."<<std::endl; 
    13231324 
    13241325                databaseRequest->_frameNumberFirstRequest = frameNumber; 
     
    13401341    if (!foundEntry) 
    13411342    { 
    1342         osg::notify(osg::INFO)<<"In DatabasePager::fileRquest("<<fileName<<")"<<std::endl; 
     1343        osg::notify(osg::INFO)<<"In DatabasePager::requestNodeFile("<<fileName<<")"<<std::endl; 
    13431344         
    13441345        OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_fileRequestQueue->_requestMutex); 
     
    13941395    } 
    13951396 
     1397#ifdef WITH_REQUESTNODEFILE_TIMING 
    13961398    totalTime += osg::Timer::instance()->delta_m(start_tick, osg::Timer::instance()->tick()); 
     1399#endif 
    13971400} 
    13981401 
     
    15061509    osg::Timer_t last = osg::Timer::instance()->tick(); 
    15071510 
    1508     osg::notify(osg::DEBUG_INFO)<<"Done DatabasePager::addLoadedDataToSceneGraph"<< 
    1509         osg::Timer::instance()->delta_m(before,mid)<<"ms,\t"<< 
    1510         osg::Timer::instance()->delta_m(mid,last)<<"ms"<< 
    1511         "  objects"<<localFileLoadedList.size()<<std::endl<<std::endl; 
    1512      
     1511    if (!localFileLoadedList.empty()) 
     1512    { 
     1513        osg::notify(osg::DEBUG_INFO)<<"Done DatabasePager::addLoadedDataToSceneGraph"<< 
     1514            osg::Timer::instance()->delta_m(before,mid)<<"ms,\t"<< 
     1515            osg::Timer::instance()->delta_m(mid,last)<<"ms"<< 
     1516            "  objects"<<localFileLoadedList.size()<<std::endl<<std::endl; 
     1517    }  
    15131518} 
    15141519