Moved plugins across to using ReaderWriter::Options* for search paths in addition
to standard osgDB::DataFilePaths
This commit is contained in:
@@ -32,18 +32,14 @@ class OSGReaderWriter : public ReaderWriter
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName = osgDB::findDataFile( file );
|
||||
std::string fileName = osgDB::findDataFile( file, opt );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
// code for setting up the database path so that any paged
|
||||
// databases can be automatically located.
|
||||
osg::ref_ptr<Options> local_opt = const_cast<Options*>(opt);
|
||||
if (!local_opt) local_opt = new Options;
|
||||
osg::ref_ptr<Options> local_opt = opt ? static_cast<Options*>(opt->clone(osg::CopyOp::SHALLOW_COPY)) : new Options;
|
||||
|
||||
if (local_opt.valid() && local_opt->getDatabasePathList().empty())
|
||||
{
|
||||
local_opt->setDatabasePath(osgDB::getFilePath(fileName));
|
||||
}
|
||||
local_opt->setDatabasePath(osgDB::getFilePath(fileName));
|
||||
|
||||
std::ifstream fin(fileName.c_str());
|
||||
if (fin)
|
||||
|
||||
Reference in New Issue
Block a user