From "Matthew Roberso, I've attached a small fix to the src/osgWrappers/serializers/osg/Texture2DArray.cpp against the svn head r11965 it simply calls setTextureDepth before attempting to load the individual textures into the array. Currently without that the loading fails with the following printout "Warning: Texture2DArray::setImage(..) failed, the given layer number is bigger then the size of the texture array." and the texture array is empty if loaded from an osga/b."

This commit is contained in:
Robert Osfield 2010-11-30 16:22:37 +00:00
parent e9cd13f120
commit 9c0e56d7a0

View File

@ -11,6 +11,7 @@ static bool checkImages( const osg::Texture2DArray& tex )
static bool readImages( osgDB::InputStream& is, osg::Texture2DArray& tex ) static bool readImages( osgDB::InputStream& is, osg::Texture2DArray& tex )
{ {
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET; unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
tex.setTextureDepth(size);
for ( unsigned int i=0; i<size; ++i ) for ( unsigned int i=0; i<size; ++i )
{ {
osg::Image* image = is.readImage(); osg::Image* image = is.readImage();