Restructed the setting of the RenderStage ClearColor/ClearMask to make the code more readable and to avoid double setting of the ClearMask.

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15170 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield 2015-10-26 11:41:44 +00:00
parent 5dc251a5c1
commit 5310a96c73

View File

@ -1600,27 +1600,8 @@ void CullVisitor::apply(osg::Camera& camera)
rtts->setClearDepth(camera.getClearDepth());
rtts->setClearAccum(camera.getClearAccum());
rtts->setClearStencil(camera.getClearStencil());
rtts->setClearMask(camera.getClearMask());
// set up the background color and clear mask.
if (camera.getInheritanceMask() & CLEAR_COLOR)
{
rtts->setClearColor(previous_stage->getClearColor());
}
else
{
rtts->setClearColor(camera.getClearColor());
}
if (camera.getInheritanceMask() & CLEAR_MASK)
{
rtts->setClearMask(previous_stage->getClearMask());
}
else
{
rtts->setClearMask(camera.getClearMask());
}
rtts->setClearMask((camera.getInheritanceMask() & CLEAR_MASK) ? previous_stage->getClearMask() : camera.getClearMask());
rtts->setClearColor((camera.getInheritanceMask() & CLEAR_COLOR) ? previous_stage->getClearColor() : camera.getClearColor());
// set the color mask.
osg::ColorMask* colorMask = camera.getColorMask()!=0 ? camera.getColorMask() : previous_stage->getColorMask();