Show
Ignore:
Timestamp:
11/21/14 21:16:16 (42 hours ago)
Author:
robert
Message:

From Alberto Luaces,"the current code uses the preprocessor for generating the plugin path in
a way that when CMAKE_INSTALL_PREFIX contains something along the lines
of

/usr/x86_64-linux-gnu/

it gets substituted as

/usr/x86_64-1-gnu/

that is, the string is preprocessed again, thereby making changes to
anything that matches any defined symbol, as "linux" in this example
(https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=763816).

Quoting that path directly in CMake scripts solves that problem.
"

Files:
1 modified

Legend:

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

    r13159 r13191  
    8484    // note this will mean that only one ImageSequence can be properly managed at one time, 
    8585    // this hack will be removed once a better system for managing expiry of requests is introduced. 
    86     clear(); 
     86    // clear(); 
    8787 
    8888    OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_requestMutex); 
     
    9191    databaseRequest->_requestQueue = this; 
    9292 
    93     OSG_INFO<<"ImagePager::ReadQueue::add(..), size()="<<_requestList.size()<<std::endl; 
     93    OSG_INFO<<"ImagePager::ReadQueue::add("<<databaseRequest->_fileName<<"), size()="<<_requestList.size()<<std::endl; 
    9494 
    9595    updateBlock(); 
     
    207207        if (imageRequest.valid()) 
    208208        { 
    209             osg::ref_ptr<osg::Image> image = osgDB::readImageFile(imageRequest->_fileName); 
     209            // OSG_NOTICE<<"doing readImageFile("<<imageRequest->_fileName<<") index to assign = "<<imageRequest->_attachmentIndex<<std::endl; 
     210            osg::ref_ptr<osg::Image> image = osgDB::readImageFile(imageRequest->_fileName, imageRequest->_readOptions.get()); 
    210211            if (image.valid()) 
    211212            { 
     213                // OSG_NOTICE<<"   successful readImageFile("<<imageRequest->_fileName<<") index to assign = "<<imageRequest->_attachmentIndex<<std::endl; 
     214                 
    212215                osg::ImageSequence* is = dynamic_cast<osg::ImageSequence*>(imageRequest->_attachmentPoint.get()); 
    213216                if (is) 
     
    267270    _completedQueue = new RequestQueue; 
    268271    _imageThreads.push_back(new ImageThread(this, ImageThread::HANDLE_ALL_REQUESTS, "Image Thread 1")); 
     272#if 1 
    269273    _imageThreads.push_back(new ImageThread(this, ImageThread::HANDLE_ALL_REQUESTS, "Image Thread 2")); 
    270274    _imageThreads.push_back(new ImageThread(this, ImageThread::HANDLE_ALL_REQUESTS, "Image Thread 3")); 
     
    272276    _imageThreads.push_back(new ImageThread(this, ImageThread::HANDLE_ALL_REQUESTS, "Image Thread 5")); 
    273277    _imageThreads.push_back(new ImageThread(this, ImageThread::HANDLE_ALL_REQUESTS, "Image Thread 6")); 
    274  
     278#endif 
    275279    // 1 second 
    276280    _preLoadTime = 1.0; 
     
    315319} 
    316320 
    317 void ImagePager::requestImageFile(const std::string& fileName,osg::Object* attachmentPoint, int attachmentIndex, double timeToMergeBy, const osg::FrameStamp*) 
    318 { 
    319     OSG_INFO<<"ImagePager::requestNodeFile("<<fileName<<")"<<std::endl; 
     321void ImagePager::requestImageFile(const std::string& fileName, osg::Object* attachmentPoint, int attachmentIndex, double timeToMergeBy, const osg::FrameStamp* framestamp, osg::ref_ptr<osg::Referenced>& imageRequest, const osg::Referenced* options) 
     322{ 
     323 
     324    osgDB::Options* readOptions = dynamic_cast<osgDB::Options*>(const_cast<osg::Referenced*>(options)); 
     325    if (!readOptions) 
     326    { 
     327       readOptions = Registry::instance()->getOptions(); 
     328    } 
     329 
     330    bool alreadyAssigned = dynamic_cast<ImageRequest*>(imageRequest.get()) && (imageRequest->referenceCount()>1); 
     331    if (alreadyAssigned) 
     332    { 
     333        // OSG_NOTICE<<"ImagePager::requestImageFile("<<fileName<<") alreadyAssigned"<<std::endl; 
     334        return; 
     335    } 
    320336 
    321337    osg::ref_ptr<ImageRequest> request = new ImageRequest; 
     
    325341    request->_attachmentIndex = attachmentIndex; 
    326342    request->_requestQueue = _readQueue.get(); 
     343    request->_readOptions = readOptions; 
     344 
     345    imageRequest = request; 
     346 
     347    // OSG_NOTICE<<"ImagePager::requestImageFile("<<fileName<<") new request."<<std::endl; 
    327348 
    328349    _readQueue->add(request.get());