From 5c2abfe062ee41cdecf012ecd14d57672b75cda3 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 17 Jun 2010 11:01:40 +0000 Subject: [PATCH] From Jim Vaughan, "The attached file fixes a bug in the Inventor loader that causes texture images to have r with a value of zero. The bug caused the image data to not get copied, size the size was calculated to be zero. This caused crashes during rendering." --- src/osgPlugins/Inventor/ConvertFromInventor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgPlugins/Inventor/ConvertFromInventor.cpp b/src/osgPlugins/Inventor/ConvertFromInventor.cpp index 326ae9b96..7f8265e16 100644 --- a/src/osgPlugins/Inventor/ConvertFromInventor.cpp +++ b/src/osgPlugins/Inventor/ConvertFromInventor.cpp @@ -1599,7 +1599,7 @@ ConvertFromInventor::convertIVTexToOSGTex(const SoNode* soNode, osg::ref_ptr osgImage = new osg::Image; osgImage->setFileName(fileName); GLenum formats[] = {GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA}; - osgImage->setImage(soSize[0], soSize[1], 0, soNC, formats[soNC-1], + osgImage->setImage(soSize[0], soSize[1], 1, soNC, formats[soNC-1], GL_UNSIGNED_BYTE, osgImageData, osg::Image::USE_NEW_DELETE); // Create the osg::Texture2D