diff --git a/src/osg/ImageSequence.cpp b/src/osg/ImageSequence.cpp index ffc9ab15b..d9be79ed7 100644 --- a/src/osg/ImageSequence.cpp +++ b/src/osg/ImageSequence.cpp @@ -217,7 +217,8 @@ void ImageSequence::update(osg::NodeVisitor* nv) bool looping = getLoopingMode()==LOOPING; double time = (fs->getSimulationTime() - _referenceTime)*_timeMultiplier; - + bool useDirectTimeRequest = _seekTimeSet; + if (_seekTimeSet || _status==PAUSED || _status==INVALID) { time = _seekTime; @@ -248,12 +249,11 @@ void ImageSequence::update(osg::NodeVisitor* nv) bool pruneOldImages = false; - switch(_mode) { case(PRE_LOAD_ALL_IMAGES): { - if (_fileNames.size()>_images.size()) + if (irh && _fileNames.size()>_images.size()) { FileNames::iterator itr = _fileNames.begin(); for(unsigned int i=0;i<_images.size();++i) ++itr; @@ -286,12 +286,27 @@ void ImageSequence::update(osg::NodeVisitor* nv) if (index>=0 && index=0 && !_images[index].valid()) + if (_previousAppliedImageIndex=0 && !_images[index].valid()) + { + --index; + } + } + else if (_previousAppliedImageIndex>index) + { + OSG_NOTICE<<"ImageSequence::update(..) Moving back by "<<_previousAppliedImageIndex-index<(_images.size()) && !_images[index].valid()) + { + ++index; + } + } + else + { + OSG_NOTICE<<"ImageSequence::update(..) Same index."<