Show
Ignore:
Timestamp:
10/06/08 19:03:32 (6 years ago)
Author:
robert
Message:

Improved the ImageSequence::setLength() settting.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgimagesequence/osgimagesequence.cpp

    r8918 r8992  
    9494        else 
    9595        { 
    96             imageSequence->setLength(float(imageSequence->getImages().size())*0.1f); 
     96            unsigned int maxNum = osg::maximum(imageSequence->getFileNames().size(), 
     97                                               imageSequence->getImages().size()); 
     98                                                
     99            imageSequence->setLength(float(maxNum)*0.1f); 
    97100        } 
    98101    } 
     
    126129    texture->setImage(imageSequence.get()); 
    127130    //texture->setTextureSize(512,512); 
    128      
    129     //texture->setUpdateCallback(new osg::ImageSequence::UpdateCallback); 
    130131#else     
    131132    osg::TextureRectangle* texture = new osg::TextureRectangle; 
     
    133134    texture->setFilter(osg::Texture::MAG_FILTER,osg::Texture::LINEAR); 
    134135    texture->setWrap(osg::Texture::WRAP_R,osg::Texture::REPEAT); 
    135     // texture->setResizeNonPowerOfTwoHint(false); 
    136136    texture->setImage(imageSequence.get()); 
    137137    //texture->setTextureSize(512,512); 
    138      
    139     //texture->setUpdateCallback(new osg::ImageSequence::UpdateCallback); 
    140138#endif 
    141139