Merge pull request #646 from flashk/patch-7

Use options when loading images in Collada loader
This commit is contained in:
OpenSceneGraph git repository 2018-10-17 14:43:13 +01:00 committed by GitHub
commit c4100174a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View File

@ -143,6 +143,9 @@ ReaderWriterDAE::readNode(const std::string& fname,
std::string fileName( osgDB::findDataFile( fname, options ) );
if( fileName.empty() ) return ReadResult::FILE_NOT_FOUND;
pluginOptions.options = options ? osg::clone(options, osg::CopyOp::SHALLOW_COPY) : new Options;
pluginOptions.options->getDatabasePathList().push_front(osgDB::getFilePath(fileName));
OSG_INFO << "ReaderWriterDAE( \"" << fileName << "\" )" << std::endl;

View File

@ -1136,7 +1136,7 @@ osg::Texture2D* daeReader::processTexture(
}
else
{
osg::ref_ptr<osg::Image> img = osgDB::readRefImageFile(parameters.filename);
osg::ref_ptr<osg::Image> img = osgDB::readRefImageFile(parameters.filename, _pluginOptions.options.get());
if (!img.valid())
{

View File

@ -157,6 +157,7 @@ public:
int precisionHint; ///< Precision hint flags, as specified in osgDB::Options::PrecisionHint
bool usePredefinedTextureUnits;
TessellateMode tessellateMode;
osg::ref_ptr<osgDB::ReaderWriter::Options> options;
};
daeReader(DAE *dae_, const Options * pluginOptions);