diff --git a/include/osgUtil/StateGraph b/include/osgUtil/StateGraph index 66df68b8d..8922a9c16 100644 --- a/include/osgUtil/StateGraph +++ b/include/osgUtil/StateGraph @@ -279,7 +279,7 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced } - inline static int numToPop(osg::State& state,StateGraph* sg_curr) + inline static int numToPop(StateGraph* sg_curr) { int numToPop = 0; // need to pop back all statesets and matrices. diff --git a/src/osgUtil/RenderBin.cpp b/src/osgUtil/RenderBin.cpp index aead4906f..23ab70c88 100644 --- a/src/osgUtil/RenderBin.cpp +++ b/src/osgUtil/RenderBin.cpp @@ -377,7 +377,7 @@ void RenderBin::drawImplementation(osg::RenderInfo& renderInfo,RenderLeaf*& prev // osg::notify(osg::NOTICE)<<"begin RenderBin::drawImplementation "<_parent) : 0); + unsigned int numToPop = (previous ? StateGraph::numToPop(previous->_parent) : 0); if (numToPop>1) --numToPop; unsigned int insertStateSetPosition = state.getStateSetStackSize() - numToPop;