[Scummvm-cvs-logs] CVS: scummvm/gui ThemeNew.cpp,1.9,1.10

Johannes Schickel lordhoto at users.sourceforge.net
Sun Jan 29 04:43:04 CET 2006


Update of /cvsroot/scummvm/scummvm/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5293

Modified Files:
	ThemeNew.cpp 
Log Message:
Fixes transparency and enabled transparency for disabled buttons.


Index: ThemeNew.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/ThemeNew.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- ThemeNew.cpp	28 Jan 2006 23:56:12 -0000	1.9
+++ ThemeNew.cpp	29 Jan 2006 12:41:58 -0000	1.10
@@ -348,8 +348,9 @@
 	if (!_initOk)
 		return;
 
+	restoreBackground(r);
 	drawRectMasked(r, surface(kWidgetBkgdCorner), surface(kWidgetBkgdTop), surface(kWidgetBkgdLeft), surface(kWidgetBkgd),
-					256, _colors[kButtonBackgroundStart], _colors[kButtonBackgroundEnd], 2);
+					(state == kStateDisabled) ? 128 : 256, _colors[kButtonBackgroundStart], _colors[kButtonBackgroundEnd], 2);
 
 	const int off = (r.height() - _font->getFontHeight()) / 2;
 
@@ -747,7 +748,7 @@
 			OverlayColor rowColor = calcGradient(start, end, i, r.height(), factor);
 			for (int x = 0; x < drawWidth; ++x) {
 				if (src[x] != transparency && dst >= _screen.pixels) {
-					dst[x] = getColorAlpha(src[x], dst[x], alpha) & rowColor;
+					dst[x] = getColorAlpha(src[x] & rowColor, dst[x], alpha);
 				}
 			}
 			dst += _screen.w;
@@ -760,7 +761,7 @@
 			OverlayColor rowColor = calcGradient(start, end, i, r.height(), factor);
 			for (int x = 0; x < drawWidth; ++x) {
 				if (src[drawWidth-x-1] != transparency && dst >= _screen.pixels) {
-					dst[x] = getColorAlpha(src[drawWidth-x-1], dst[x], alpha) & rowColor;
+					dst[x] = getColorAlpha(src[drawWidth-x-1] & rowColor, dst[x], alpha);
 				}
 			}
 			dst += _screen.w;
@@ -773,7 +774,7 @@
 			OverlayColor rowColor = calcGradient(start, end, i, r.height(), factor);
 			for (int x = 0; x < drawWidth; ++x) {
 				if (src[drawWidth-x-1] != transparency && dst >= _screen.pixels) {
-					dst[x] = getColorAlpha(src[drawWidth-x-1], dst[x], alpha) & rowColor;
+					dst[x] = getColorAlpha(src[drawWidth-x-1] & rowColor, dst[x], alpha);
 				}
 			}
 			dst += _screen.w;
@@ -786,7 +787,7 @@
 			OverlayColor rowColor = calcGradient(start, end, i, r.height(), factor);
 			for (int x = 0; x < drawWidth; ++x) {
 				if (src[x] != transparency && dst >= _screen.pixels) {
-					dst[x] = getColorAlpha(src[x], dst[x], alpha) & rowColor;
+					dst[x] = getColorAlpha(src[x] & rowColor, dst[x], alpha);
 				}
 			}
 			dst += _screen.w;





More information about the Scummvm-git-logs mailing list