Hi Jannik,

Thanks for the wee optimization.  I've looked at the code and feel that use
of if else blocks is a bit overkill line wise, replacing it with a single
line makes the code more readable so I've gone with:

        // set up clear masks/values
        rtts->setClearDepth(camera.getClearDepth());
        rtts->setClearAccum(camera.getClearAccum());
        rtts->setClearStencil(camera.getClearStencil());
        rtts->setClearMask((camera.getInheritanceMask() & CLEAR_MASK) ?
previous_stage->getClearMask() : camera.getClearMask());
        rtts->setClearColor((camera.getInheritanceMask() & CLEAR_COLOR) ?
previous_stage->getClearColor() : camera.getClearColor());

I have checked this change into svn/trunk and OSG-3.4 branch.

Cheers,
Robert.




On 25 October 2015 at 16:28, Jannik Heller <[email protected]> wrote:

> Hi Robert,
>
> reading through code I noticed the clear mask of a camera is being set
> twice.
> First here:
>
> Code:
>
>         // set up clear masks/values
>         ...
>         rtts->setClearMask(camera.getClearMask());
>
>
>
> and then again a few lines further:
>
> Code:
>
>         if (camera.getInheritanceMask() & CLEAR_MASK)
>         {
>             rtts->setClearMask(previous_stage->getClearMask());
>         }
>         else
>         {
>             rtts->setClearMask(camera.getClearMask());
>         }
>
>
>
>
>
> This patch removes the redundant first call.
>
> Cheers,
> Jannik
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=65435#65435
>
>
>
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to