87 {
88 if (amountOfOverlay == 0) {
89 return existing;
90 }
91
92 if (amountOfOverlay == 255) {
93 existing = overlay;
94 return existing;
95 }
96
97#if 0
98
99 fract8 amountOfKeep = 255 - amountOfOverlay;
100
101 existing.red = scale8_LEAVING_R1_DIRTY( existing.red, amountOfKeep)
102 + scale8_LEAVING_R1_DIRTY( overlay.red, amountOfOverlay);
103 existing.green = scale8_LEAVING_R1_DIRTY( existing.green, amountOfKeep)
104 + scale8_LEAVING_R1_DIRTY( overlay.green, amountOfOverlay);
105 existing.blue = scale8_LEAVING_R1_DIRTY( existing.blue, amountOfKeep)
106 + scale8_LEAVING_R1_DIRTY( overlay.blue, amountOfOverlay);
107
108 cleanup_R1();
109#else
110
111 existing.red = blend8(existing.red, overlay.red, amountOfOverlay);
112 existing.green = blend8(existing.green, overlay.green, amountOfOverlay);
113 existing.blue = blend8(existing.blue, overlay.blue, amountOfOverlay);
114#endif
115
116 return existing;
117}
u8 fract8
Fixed-Point Fractional Types.