aboutsummaryrefslogtreecommitdiff
path: root/graphics/VectorRendererSpec.cpp
diff options
context:
space:
mode:
authorLothar Serra Mari2019-03-10 15:56:17 +0100
committerFilippos Karapetis2019-03-10 16:56:17 +0200
commitfe83c985be5b16b2f1ef51c4c6ac173117580489 (patch)
treee60baaca611662ff874f67713f01cc818a5d230b /graphics/VectorRendererSpec.cpp
parent537e9af4e03abe5e961f9933a493722a8971f75c (diff)
downloadscummvm-rg350-fe83c985be5b16b2f1ef51c4c6ac173117580489.tar.gz
scummvm-rg350-fe83c985be5b16b2f1ef51c4c6ac173117580489.tar.bz2
scummvm-rg350-fe83c985be5b16b2f1ef51c4c6ac173117580489.zip
GUI: Allow GUI background colors other than black in Classic Theme (#1526)
GUI: Allow GUI background colors other than black in Classic Theme
Diffstat (limited to 'graphics/VectorRendererSpec.cpp')
-rw-r--r--graphics/VectorRendererSpec.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index e308dde821..2f7164cc9b 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -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);