From 9c0e56d7a0e6064a8ceca7858d1eff1c0151074a Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 30 Nov 2010 16:22:37 +0000 Subject: [PATCH] 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." --- src/osgWrappers/serializers/osg/Texture2DArray.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/osgWrappers/serializers/osg/Texture2DArray.cpp b/src/osgWrappers/serializers/osg/Texture2DArray.cpp index 0c6855409..d6a091860 100644 --- a/src/osgWrappers/serializers/osg/Texture2DArray.cpp +++ b/src/osgWrappers/serializers/osg/Texture2DArray.cpp @@ -11,6 +11,7 @@ static bool checkImages( const osg::Texture2DArray& tex ) static bool readImages( osgDB::InputStream& is, osg::Texture2DArray& tex ) { unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET; + tex.setTextureDepth(size); for ( unsigned int i=0; i