Do not modify danymically generated textures.

Modified Files:
	simgear/scene/model/ModelRegistry.cxx
This commit is contained in:
frohlich
2009-06-11 15:55:11 +02:00
committed by Tim Moore
parent d4c52b599d
commit daa0fbdc6b
+17 -3
View File
@@ -258,9 +258,13 @@ public:
if (!texture) if (!texture)
return; return;
// Hmm, true?? // Do not touch dynamically generated textures.
texture->setDataVariance(osg::Object::STATIC); if (texture->getReadPBuffer())
return;
if (texture->getDataVariance() == osg::Object::DYNAMIC)
return;
// If no image attached, we assume this one is dynamically generated
Image* image = texture->getImage(0); Image* image = texture->getImage(0);
if (!image) if (!image)
return; return;
@@ -285,6 +289,16 @@ public:
if (!texture) if (!texture)
return; return;
// Cannot be static if this is a render to texture thing
if (texture->getReadPBuffer())
return;
if (texture->getDataVariance() == osg::Object::DYNAMIC)
return;
// If no image attached, we assume this one is dynamically generated
Image* image = texture->getImage(0);
if (!image)
return;
texture->setDataVariance(Object::STATIC); texture->setDataVariance(Object::STATIC);
} }
@@ -292,8 +306,8 @@ public:
{ {
if (!stateSet) if (!stateSet)
return; return;
SGTextureStateAttributeVisitor::apply(stateSet);
stateSet->setDataVariance(Object::STATIC); stateSet->setDataVariance(Object::STATIC);
SGTextureStateAttributeVisitor::apply(stateSet);
} }
}; };