GUI: Allow GUI background colors other than black in Classic Theme (#1526)

GUI: Allow GUI background colors other than black in Classic Theme
This commit is contained in:
Lothar Serra Mari 2019-03-10 15:56:17 +01:00 committed by Filippos Karapetis
parent 537e9af4e0
commit fe83c985be

View File

@ -2352,12 +2352,17 @@ drawBevelSquareAlg(int x, int y, int w, int h, int bevel, PixelType top_color, P
// Fill Background
ptr_left = (PixelType *)_activeSurface->getBasePtr(x, y);
i = h;
if (fill) {
assert((_bgColor & ~_alphaMask) == 0); // only support black
// Optimize rendering in case the background color is black
if ((_bgColor & ~_alphaMask) == 0) {
while (i--) {
darkenFill(ptr_left, ptr_left + w);
ptr_left += pitch;
}
} else {
while (i--) {
blendFill(ptr_left, ptr_left + w, _bgColor, 200);
ptr_left += pitch;
}
}
x = MAX(x - bevel, 0);
@ -2409,13 +2414,18 @@ drawBevelSquareAlgClip(int x, int y, int w, int h, int bevel, PixelType top_colo
ptr_left = (PixelType *)_activeSurface->getBasePtr(x, y);
ptr_x = x; ptr_y = y;
i = h;
if (fill) {
assert((_bgColor & ~_alphaMask) == 0); // only support black
// Optimize rendering in case the background color is black
if ((_bgColor & ~_alphaMask) == 0) {
while (i--) {
darkenFillClip(ptr_left, ptr_left + w, ptr_x, ptr_y);
ptr_left += pitch;
++ptr_y;
}
} else {
while (i-- ) {
blendFillClip(ptr_left, ptr_left + w, ptr_x, ptr_y, _bgColor, 200);
ptr_left += pitch;
}
}
x = MAX(x - bevel, 0);