From fbd7a45b8e006f6e0dd2d95e2d6f31deedeef735 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 26 Jan 2004 09:01:08 +0000 Subject: [PATCH] Fix to computation of size of texture in presense of compressed textures + mipaplevels<=1 --- src/osgPlugins/txp/TXPParser.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/osgPlugins/txp/TXPParser.cpp b/src/osgPlugins/txp/TXPParser.cpp index e35da7474..9023b0d5a 100644 --- a/src/osgPlugins/txp/TXPParser.cpp +++ b/src/osgPlugins/txp/TXPParser.cpp @@ -1288,8 +1288,7 @@ osg::Texture2D* txp::getLocalTexture(trpgrImageHelper& image_helper, const trpgT // osg::Image do their own mipmaps if(num_mipmaps <= 1) { - int32 size = s.x*s.y*depth; - // int32 size = const_cast(tex)->MipLevelSize(1) ; + int32 size = tex->CalcTotalSize(); data = new char [size]; image_helper.GetLocalGL(tex,data,size); image->setImage(s.x,s.y,1,internalFormat, pixelFormat, dataType, @@ -1361,8 +1360,7 @@ osg::Texture2D* txp::getTemplateTexture(trpgrImageHelper& image_helper, trpgLoca // osg::Image do their own mipmaps if(num_mipmaps <= 1) { - int32 size = s.x*s.y*depth; - // int32 size = const_cast(tex)->MipLevelSize(1) ; + int32 size = tex->CalcTotalSize(); data = new char [size]; image_helper.GetNthImageForLocalMat(locmat,index, data,size);