From 4c81aa0aa7ff141d2dc7e18ffce82ea9596959a6 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 26 May 2008 21:33:41 +0000 Subject: [PATCH] From Paul Martz, "The attached code changes StateSet::merge() so that it copies RenderBin data such as the rendering hint and RenderBin details from rhs into "this", only if "this" has RenderBin mode set to INHERIT. It replaces a comment by you indicating something along these lines should be done. To me, this seems like the right thing to do." --- src/osg/StateSet.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/osg/StateSet.cpp b/src/osg/StateSet.cpp index 663ba5e74..40d35f70d 100644 --- a/src/osg/StateSet.cpp +++ b/src/osg/StateSet.cpp @@ -774,10 +774,15 @@ void StateSet::merge(const StateSet& rhs) } } - // need to merge rendering hints - // but will need to think how best to do this first - // RO, Nov. 2001. - + // Merge RenderBin state from rhs into this. + // Only do so if this's RenderBinMode is INHERIT. + if (getRenderBinMode() == INHERIT_RENDERBIN_DETAILS) + { + setRenderingHint( rhs.getRenderingHint() ); + setRenderBinMode( rhs.getRenderBinMode() ); + setBinNumber( rhs.getBinNumber() ); + setBinName( rhs.getBinName() ); + } }