From Laurens Voerman, "while testing databasepager stuff I noticed that the various loaders (osg/ive/osgx) do not pass the current options to the imagePager, therefore the images cannot be found if not in the global OSG_FILE_PATH. Attached is a fix, containing modified versions of

From Robert Osfield, add check to only apply Options object when a valid Option object is assigned.


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14290 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield 2014-06-26 10:05:53 +00:00
parent d939adeb56
commit d82131544b
3 changed files with 4 additions and 0 deletions

View File

@ -17,6 +17,7 @@
#include "Object.h" #include "Object.h"
#include <osg/Notify> #include <osg/Notify>
#include <osgDB/Options>
using namespace ive; using namespace ive;
@ -75,6 +76,7 @@ void ImageSequence::read(DataInputStream* in)
unsigned int numFileNames = in->readUInt(); unsigned int numFileNames = in->readUInt();
if (numFileNames>0) if (numFileNames>0)
{ {
if (in->getOptions()) setReadOptions(new osgDB::Options(*in->getOptions()));
for(unsigned int i=0; i<numFileNames; ++i) for(unsigned int i=0; i<numFileNames; ++i)
{ {
addImageFile(in->readString()); addImageFile(in->readString());

View File

@ -60,6 +60,7 @@ bool ImageSequence_readLocalData(Object& obj, Input& fr)
if (fr.matchSequence("FileNames {")) if (fr.matchSequence("FileNames {"))
{ {
if (fr.getOptions()) is.setReadOptions(new osgDB::Options(*fr.getOptions()));
fr += 2; fr += 2;
iteratorAdvanced = true; iteratorAdvanced = true;
int entry = fr[0].getNoNestedBrackets(); int entry = fr[0].getNoNestedBrackets();

View File

@ -12,6 +12,7 @@ static bool checkFileNames( const osg::ImageSequence& image )
static bool readFileNames( osgDB::InputStream& is, osg::ImageSequence& image ) static bool readFileNames( osgDB::InputStream& is, osg::ImageSequence& image )
{ {
unsigned int files = 0; is >> files >> is.BEGIN_BRACKET; unsigned int files = 0; is >> files >> is.BEGIN_BRACKET;
if (is.getOptions()) image.setReadOptions(new osgDB::Options(*is.getOptions()));
for ( unsigned int i=0; i<files; ++i ) for ( unsigned int i=0; i<files; ++i )
{ {
std::string filename; is.readWrappedString( filename ); std::string filename; is.readWrappedString( filename );