From 94e7f4e860c7d80e50c6ad4a95189c5165cd0be5 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 26 Jun 2014 10:05:55 +0000 Subject: [PATCH] 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. src\osgPlugins\ive\ImageSequence.cpp src\osgWrappers\deprecated-dotosg\osg\ImageSequence.cpp src\osgWrappers\serializers\osg\ImageSequence.cpp" git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14291 16af8721-9629-0410-8352-f15c8da7e697 --- src/osgPlugins/ive/ImageSequence.cpp | 2 ++ src/osgWrappers/deprecated-dotosg/osg/ImageSequence.cpp | 1 + src/osgWrappers/serializers/osg/ImageSequence.cpp | 1 + 3 files changed, 4 insertions(+) diff --git a/src/osgPlugins/ive/ImageSequence.cpp b/src/osgPlugins/ive/ImageSequence.cpp index 0348df74b..53a86a672 100644 --- a/src/osgPlugins/ive/ImageSequence.cpp +++ b/src/osgPlugins/ive/ImageSequence.cpp @@ -17,6 +17,7 @@ #include "Object.h" #include +#include using namespace ive; @@ -75,6 +76,7 @@ void ImageSequence::read(DataInputStream* in) unsigned int numFileNames = in->readUInt(); if (numFileNames>0) { + if (in->getOptions()) setReadOptions(new osgDB::Options(*in->getOptions())); for(unsigned int i=0; ireadString()); diff --git a/src/osgWrappers/deprecated-dotosg/osg/ImageSequence.cpp b/src/osgWrappers/deprecated-dotosg/osg/ImageSequence.cpp index 039e56d4c..a93b59a77 100644 --- a/src/osgWrappers/deprecated-dotosg/osg/ImageSequence.cpp +++ b/src/osgWrappers/deprecated-dotosg/osg/ImageSequence.cpp @@ -60,6 +60,7 @@ bool ImageSequence_readLocalData(Object& obj, Input& fr) if (fr.matchSequence("FileNames {")) { + if (fr.getOptions()) is.setReadOptions(new osgDB::Options(*fr.getOptions())); fr += 2; iteratorAdvanced = true; int entry = fr[0].getNoNestedBrackets(); diff --git a/src/osgWrappers/serializers/osg/ImageSequence.cpp b/src/osgWrappers/serializers/osg/ImageSequence.cpp index 92832bb00..7444973df 100644 --- a/src/osgWrappers/serializers/osg/ImageSequence.cpp +++ b/src/osgWrappers/serializers/osg/ImageSequence.cpp @@ -12,6 +12,7 @@ static bool checkFileNames( const osg::ImageSequence& image ) static bool readFileNames( osgDB::InputStream& is, osg::ImageSequence& image ) { 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