From 4811adda0a7e8af8fdacc907c70ce19ca8210879 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 10 May 2005 08:07:37 +0000 Subject: [PATCH] From Farshid Lashkari, and non power of two resize hint support to .osg ascii --- src/osgPlugins/osg/Texture.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/osgPlugins/osg/Texture.cpp b/src/osgPlugins/osg/Texture.cpp index 424ad1929..184746e8c 100644 --- a/src/osgPlugins/osg/Texture.cpp +++ b/src/osgPlugins/osg/Texture.cpp @@ -158,6 +158,22 @@ bool Texture_readLocalData(Object& obj, Input& fr) } } + if (fr[0].matchWord("resizeNonPowerOfTwo")) + { + if (fr[1].matchWord("TRUE")) + { + texture.setResizeNonPowerOfTwoHint(true); + fr +=2 ; + iteratorAdvanced = true; + } + else if (fr[1].matchWord("FALSE")) + { + texture.setResizeNonPowerOfTwoHint(false); + fr +=2 ; + iteratorAdvanced = true; + } + } + return iteratorAdvanced; } @@ -190,6 +206,9 @@ bool Texture_writeLocalData(const Object& obj, Output& fw) else fw.indent() << "internalFormat " << texture.getInternalFormat() << std::endl; } + + fw.indent() << "resizeNonPowerOfTwo "<< (texture.getResizeNonPowerOfTwoHint()?"TRUE":"FALSE") << std::endl; + return true; }