From 40d920ddc9fec75f5e27250eea05bfdd7e00218b Mon Sep 17 00:00:00 2001 From: ehofman Date: Fri, 12 Mar 2004 10:09:09 +0000 Subject: [PATCH] Unselect the branch if the object has become fully translucent. --- simgear/scene/model/animation.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/simgear/scene/model/animation.cxx b/simgear/scene/model/animation.cxx index 67c69cb0..c5bbba8a 100644 --- a/simgear/scene/model/animation.cxx +++ b/simgear/scene/model/animation.cxx @@ -109,10 +109,16 @@ change_alpha( ssgBase *_branch, float _blend ) int num_colors = ((ssgLeaf *)_branch)->getNumColours(); - for (i = 0; i < num_colors; i++) - { - float *color = ((ssgLeaf *)_branch)->getColour(i); - color[3] = _blend; + 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; + } } }