Use a more clever way to deselect a fully translucent leaf.
This commit is contained in:
parent
40d920ddc9
commit
e37752f957
@ -108,17 +108,13 @@ change_alpha( ssgBase *_branch, float _blend )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
int num_colors = ((ssgLeaf *)_branch)->getNumColours();
|
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++)
|
||||||
for (i = 0; i < num_colors; i++)
|
{
|
||||||
((ssgSelector *)_branch)->select(0x0000); // deselect item.
|
((ssgSelector *)_branch)->select( select_ );
|
||||||
} else {
|
float *color = ((ssgLeaf *)_branch)->getColour(i);
|
||||||
for (i = 0; i < num_colors; i++)
|
color[3] = _blend;
|
||||||
{
|
|
||||||
((ssgSelector *)_branch)->select(0xffff);
|
|
||||||
float *color = ((ssgLeaf *)_branch)->getColour(i);
|
|
||||||
color[3] = _blend;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user