[Scummvm-git-logs] scummvm master -> fe83c985be5b16b2f1ef51c4c6ac173117580489

bluegr bluegr at gmail.com
Sun Mar 10 15:56:20 CET 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

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


Commit: fe83c985be5b16b2f1ef51c4c6ac173117580489
    https://github.com/scummvm/scummvm/commit/fe83c985be5b16b2f1ef51c4c6ac173117580489
Author: Lothar Serra Mari (serra at scummvm.org)
Date: 2019-03-10T16:56:17+02:00

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

GUI: Allow GUI background colors other than black in Classic Theme

Changed paths:
    graphics/VectorRendererSpec.cpp


diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index e308dde..2f7164c 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);





More information about the Scummvm-git-logs mailing list