- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/osga/ReaderWriterOSGA.cpp
r8578 r13041 19 19 virtual ReadResult openArchive(const std::string& file,ArchiveStatus status, unsigned int indexBlockSize = 4096, const Options* options=NULL) const 20 20 { 21 21 22 22 std::string ext = osgDB::getLowerCaseFileExtension(file); 23 23 if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED; 24 24 25 25 std::string fileName = osgDB::findDataFile( file, options ); 26 if (fileName.empty()) 26 if (fileName.empty()) 27 27 { 28 28 if (status==READ) return ReadResult::FILE_NOT_FOUND; 29 29 fileName = file; 30 30 } 31 31 32 32 osg::ref_ptr<OSGA_Archive> archive = new OSGA_Archive; 33 33 if (!archive->open(fileName, status, indexBlockSize)) … … 39 39 } 40 40 41 /** open an archive for reading.*/ 41 /** open an archive for reading.*/ 42 42 virtual ReadResult openArchive(std::istream& fin,const Options*) const 43 43 { … … 54 54 { 55 55 ReadResult result = openArchive(file,osgDB::Archive::READ); 56 56 57 57 if (!result.validArchive()) return result; 58 58 … … 60 60 // copy the incoming options if possible so that plugin options can be applied to files 61 61 // inside the archive 62 osg::ref_ptr<osgDB::ReaderWriter::Options> local_options = 62 osg::ref_ptr<osgDB::ReaderWriter::Options> local_options = 63 63 options? 64 64 new osgDB::ReaderWriter::Options( *options ) : … … 68 68 69 69 ReadResult result_2 = result.getArchive()->readImage(result.getArchive()->getMasterFileName(),local_options.get()); 70 70 71 71 72 72 if (!options || (options->getObjectCacheHint() & osgDB::ReaderWriter::Options::CACHE_ARCHIVES)) … … 82 82 { 83 83 ReadResult result = openArchive(file,osgDB::Archive::READ); 84 84 85 85 if (!result.validArchive()) return result; 86 86 … … 88 88 // copy the incoming options if possible so that plugin options can be applied to files 89 89 // inside the archive 90 osg::ref_ptr<osgDB::ReaderWriter::Options> local_options = 90 osg::ref_ptr<osgDB::ReaderWriter::Options> local_options = 91 91 options? 92 92 new osgDB::ReaderWriter::Options( *options ) : … … 96 96 97 97 ReadResult result_2 = result.getArchive()->readNode(result.getArchive()->getMasterFileName(),local_options.get()); 98 98 99 99 100 100 if (!options || (options->getObjectCacheHint() & osgDB::ReaderWriter::Options::CACHE_ARCHIVES)) … … 109 109 protected: 110 110 111 111 112 112 }; 113 113
