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