]> git.mxchange.org Git - simgear.git/commitdiff
Unselect the branch if the object has become fully translucent.
authorehofman <ehofman>
Fri, 12 Mar 2004 10:09:09 +0000 (10:09 +0000)
committerehofman <ehofman>
Fri, 12 Mar 2004 10:09:09 +0000 (10:09 +0000)
simgear/scene/model/animation.cxx

index 67c69cb08d8b3d7fdf1470a2bb9a944bf2ae15d2..c5bbba8a28aea499106ada9b3afb252ed5f7d6d6 100644 (file)
@@ -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;
+    }
   }
 }