Fix R/G/B not being clamped in Gradient_Blend

This commit is contained in:
UnknownShadow200 2019-10-10 10:57:06 +11:00
parent 5513d49b85
commit 060afd7d7b

View File

@ -234,9 +234,9 @@ void Gradient_Blend(Bitmap* bmp, BitmapCol col, int blend,
for (xx = 0; xx < width; xx++, dst++) { for (xx = 0; xx < width; xx++, dst++) {
/* TODO: Not shift when multiplying */ /* TODO: Not shift when multiplying */
R = BitmapCol_R(col) + (BitmapCol_R(*dst) * blend) / 255; R = BitmapCol_R(col) + (BitmapCol_R(*dst) * blend) / 255; Drawer2D_ClampPixel(R);
G = BitmapCol_G(col) + (BitmapCol_G(*dst) * blend) / 255; G = BitmapCol_G(col) + (BitmapCol_G(*dst) * blend) / 255; Drawer2D_ClampPixel(G);
B = BitmapCol_B(col) + (BitmapCol_B(*dst) * blend) / 255; B = BitmapCol_B(col) + (BitmapCol_B(*dst) * blend) / 255; Drawer2D_ClampPixel(B);
*dst = BitmapCol_Make(R, G, B, 255); *dst = BitmapCol_Make(R, G, B, 255);
} }