~ubuntu-branches/debian/experimental/openscenegraph/experimental

« back to all changes in this revision

Viewing changes to OpenSceneGraph/src/osgDB/Registry.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alberto Luaces
  • Date: 2010-05-03 21:42:01 UTC
  • mfrom: (1.1.9 upstream) (2.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20100503214201-iy060qxb94vsfv87
Tags: 2.8.3-3
* Added README.source. Thanks Manuel Montecelo.
* Removed FindGDAL.cmake file supplied by upstream since it does not
  detect current libgdal1-1.6.0. The script provided by CMake works
  fine.
* Removed openthreads-doc since OpenThreads documentation is shared with
  OpenSceneGraph's, hence this package was empty.
* Now ccache handling is being done automatically by CMake.
* Drop conflict dependencies with previous versions to let them coexist
  with current ones (Closes: #580079 #580081).

Show diffs side-by-side

added added

removed removed

Lines of Context:
183
183
        else _buildKdTreesHint = ReaderWriter::Options::BUILD_KDTREES;
184
184
    }
185
185
 
 
186
    const char* ptr=0;
 
187
 
 
188
    _expiryDelay = 10.0;
 
189
    if( (ptr = getenv("OSG_EXPIRY_DELAY")) != 0)
 
190
    {
 
191
        _expiryDelay = osg::asciiToDouble(ptr);
 
192
        osg::notify(osg::INFO)<<"Registry : Expiry delay = "<<_expiryDelay<<std::endl;
 
193
    }
 
194
 
186
195
    const char* fileCachePath = getenv("OSG_FILE_CACHE");
187
196
    if (fileCachePath)
188
197
    {
239
248
    addFileExtensionAlias("vert",   "glsl");
240
249
    addFileExtensionAlias("frag",   "glsl");
241
250
 
 
251
 
 
252
#if defined(DARWIN_IMAGEIO)
 
253
    addFileExtensionAlias("jpg",  "imageio");
 
254
    addFileExtensionAlias("jpe",  "imageio");
 
255
    addFileExtensionAlias("jpeg", "imageio");
 
256
    addFileExtensionAlias("tif",  "imageio");
 
257
    addFileExtensionAlias("tiff", "imageio");
 
258
    addFileExtensionAlias("gif",  "imageio");
 
259
    addFileExtensionAlias("png",  "imageio");
 
260
    addFileExtensionAlias("psd",  "imageio");
 
261
    addFileExtensionAlias("tga",  "imageio");
 
262
#endif
 
263
 
242
264
#if defined(DARWIN_QUICKTIME)
243
265
    addFileExtensionAlias("jpg",  "qt");
244
266
    addFileExtensionAlias("jpe",  "qt");
1968
1990
    else return 0;
1969
1991
}
1970
1992
 
1971
 
void Registry::updateTimeStampOfObjectsInCacheWithExternalReferences(double currentTime)
 
1993
void Registry::updateTimeStampOfObjectsInCacheWithExternalReferences(const osg::FrameStamp& frameStamp)
1972
1994
{
1973
1995
    OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_objectCacheMutex);
1974
1996
 
1981
2003
        if (itr->second.first->referenceCount()>1)
1982
2004
        {
1983
2005
            // so update it time stamp.
1984
 
            itr->second.second = currentTime;
 
2006
            itr->second.second = frameStamp.getReferenceTime();
1985
2007
        }
1986
2008
    }
1987
2009
}
1988
2010
 
1989
 
void Registry::removeExpiredObjectsInCache(double expiryTime)
 
2011
void Registry::removeExpiredObjectsInCache(const osg::FrameStamp& frameStamp)
1990
2012
{
 
2013
    double expiryTime = frameStamp.getReferenceTime() - _expiryDelay;
 
2014
 
1991
2015
    OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_objectCacheMutex);
1992
2016
 
1993
2017
    typedef std::vector<std::string> ObjectsToRemove;