Fix handling of in-scenegraph Drawables in ShaderGenVisitor
This commit is contained in:
@@ -67,7 +67,7 @@ public:
|
||||
osg::StateSet *getRootStateSet() const { return _rootStateSet.get(); }
|
||||
|
||||
void apply(osg::Node &node);
|
||||
void apply(osg::Geode &geode);
|
||||
void apply(osg::Drawable &drawable);
|
||||
|
||||
void reset();
|
||||
|
||||
|
||||
@@ -322,24 +322,13 @@ void ShaderGenVisitor::apply(osg::Node &node)
|
||||
_state->popStateSet();
|
||||
}
|
||||
|
||||
void ShaderGenVisitor::apply(osg::Geode &geode)
|
||||
void ShaderGenVisitor::apply(osg::Drawable &drawable)
|
||||
{
|
||||
osg::StateSet *stateSet = geode.getStateSet();
|
||||
osg::StateSet *stateSet = drawable.getStateSet();
|
||||
if (stateSet)
|
||||
_state->pushStateSet(stateSet);
|
||||
|
||||
for (unsigned int i=0; i<geode.getNumDrawables(); ++i)
|
||||
{
|
||||
osg::Drawable *drawable = geode.getDrawable(i);
|
||||
osg::StateSet *ss = drawable->getStateSet();
|
||||
if (ss)
|
||||
_state->pushStateSet(ss);
|
||||
|
||||
update(drawable);
|
||||
|
||||
if (ss)
|
||||
_state->popStateSet();
|
||||
}
|
||||
update(&drawable);
|
||||
|
||||
if (stateSet)
|
||||
_state->popStateSet();
|
||||
|
||||
Reference in New Issue
Block a user