Fixed caching of archives

This commit is contained in:
Robert Osfield
2004-11-25 15:09:56 +00:00
parent fe482993d5
commit c0c02d6c24
2 changed files with 6 additions and 1 deletions

View File

@@ -35,9 +35,11 @@ osgDB::Archive* osgDB::openArchive(const std::string& filename, Archive::Archive
Archive::Archive()
{
osg::notify(osg::INFO)<<"Archive::Archive() open"<<std::endl;
}
Archive::~Archive()
{
osg::notify(osg::INFO)<<"Archive::~Archive() closed"<<std::endl;
}

View File

@@ -1352,7 +1352,10 @@ ReaderWriter::ReadResult Registry::readImplementation(const ReadFunctor& readFun
ReaderWriter::ReadResult Registry::openArchiveImplementation(const std::string& fileName, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const ReaderWriter::Options* options)
{
if (options && (options->getObjectCacheHint() & ReaderWriter::Options::CACHE_ARCHIVES))
// default to using chaching archive if no options structure provided, but if options are provided use archives
// only if supplied.
if (!options || (options && (options->getObjectCacheHint() & ReaderWriter::Options::CACHE_ARCHIVES)))
{
osgDB::Archive* archive = getFromArchiveCache(fileName);
if (archive) return archive;