Added support for osg::Texture::setUnRefImageDataAfterApply(true) into all

objects osg::Textures the TXP plugin creates.
This commit is contained in:
Robert Osfield
2004-01-19 11:02:54 +00:00
parent 694aec666c
commit 9ebffd4055
2 changed files with 9 additions and 0 deletions

View File

@@ -130,6 +130,9 @@ bool TXPArchive::loadMaterials()
// Create a texture by name.
osg::ref_ptr<osg::Texture2D> osg_texture = new osg::Texture2D();
// make sure the Texture unref's the Image after apply, when it is no longer needed.
osg_texture->setUnRefImageDataAfterApply(true);
// Load Texture and Create Texture State
std::string filename = osgDB::getSimpleFileName(texName);

View File

@@ -1176,6 +1176,9 @@ osg::Texture2D* txp::getLocalTexture(trpgrImageHelper& image_helper, const trpgT
{
osg_texture = new osg::Texture2D();
// make sure the Texture unref's the Image after apply, when it is no longer needed.
osg_texture->setUnRefImageDataAfterApply(true);
osg::Image* image = new osg::Image;
char* data = 0L;
@@ -1246,6 +1249,9 @@ osg::Texture2D* txp::getTemplateTexture(trpgrImageHelper& image_helper, trpgLoca
{
osg_texture = new osg::Texture2D();
// make sure the Texture unref's the Image after apply, when it is no longer needed.
osg_texture->setUnRefImageDataAfterApply(true);
osg::Image* image = new osg::Image;
char* data = 0L;