From e37752f957c3407d7d99a3c540b468ee443ae742 Mon Sep 17 00:00:00 2001 From: ehofman Date: Fri, 12 Mar 2004 17:38:57 +0000 Subject: [PATCH] Use a more clever way to deselect a fully translucent leaf. --- simgear/scene/model/animation.cxx | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/simgear/scene/model/animation.cxx b/simgear/scene/model/animation.cxx index c5bbba8a..b6bf5607 100644 --- a/simgear/scene/model/animation.cxx +++ b/simgear/scene/model/animation.cxx @@ -108,17 +108,13 @@ change_alpha( ssgBase *_branch, float _blend ) return; int num_colors = ((ssgLeaf *)_branch)->getNumColours(); + unsigned int select_ = (_blend == 1.0) ? 0x0000 : 0xffff; - if ( _blend == 1.0 ) { // fully translucent. - for (i = 0; i < num_colors; i++) - ((ssgSelector *)_branch)->select(0x0000); // deselect item. - } else { - for (i = 0; i < num_colors; i++) - { - ((ssgSelector *)_branch)->select(0xffff); - float *color = ((ssgLeaf *)_branch)->getColour(i); - color[3] = _blend; - } + for (i = 0; i < num_colors; i++) + { + ((ssgSelector *)_branch)->select( select_ ); + float *color = ((ssgLeaf *)_branch)->getColour(i); + color[3] = _blend; } } -- 2.39.5