- if(alpha) {
- dest[pos2].r = ((int)data[pos + 1]*255)/alpha;
- dest[pos2].g = ((int)data[pos + 2]*255)/alpha;
- dest[pos2].b = ((int)data[pos + 3]*255)/alpha;
- } else {
- dest[pos2].r = data[pos + 1];
- dest[pos2].g = data[pos + 2];
- dest[pos2].b = data[pos + 3];
- }
+ if(alpha)
+ alpha = 0xff0000/alpha;
+ dest[pos2].r = (data[pos + 1]*alpha)>>16;
+ dest[pos2].g = (data[pos + 2]*alpha)>>16;
+ dest[pos2].b = (data[pos + 3]*alpha)>>16;