diff options
author | Johannes Schickel | 2006-01-29 12:41:58 +0000 |
---|---|---|
committer | Johannes Schickel | 2006-01-29 12:41:58 +0000 |
commit | f509762f997bd84ec161c3b43590979f9f5be55d (patch) | |
tree | 487fc34032213903eb245378ecbf408b4adca1cb /gui/ThemeNew.cpp | |
parent | 836e63561406c0e19cbd590304a054b1f72301a3 (diff) | |
download | scummvm-rg350-f509762f997bd84ec161c3b43590979f9f5be55d.tar.gz scummvm-rg350-f509762f997bd84ec161c3b43590979f9f5be55d.tar.bz2 scummvm-rg350-f509762f997bd84ec161c3b43590979f9f5be55d.zip |
Fixes transparency and enabled transparency for disabled buttons.
svn-id: r20295
Diffstat (limited to 'gui/ThemeNew.cpp')
-rw-r--r-- | gui/ThemeNew.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gui/ThemeNew.cpp b/gui/ThemeNew.cpp index 45beb7625e..3e4496d158 100644 --- a/gui/ThemeNew.cpp +++ b/gui/ThemeNew.cpp @@ -348,8 +348,9 @@ void ThemeNew::drawButton(const Common::Rect &r, const Common::String &str, kSta 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 @@ void ThemeNew::drawSurfaceMasked(const Common::Rect &r, const Graphics::Surface 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 @@ void ThemeNew::drawSurfaceMasked(const Common::Rect &r, const Graphics::Surface 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 @@ void ThemeNew::drawSurfaceMasked(const Common::Rect &r, const Graphics::Surface 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 @@ void ThemeNew::drawSurfaceMasked(const Common::Rect &r, const Graphics::Surface 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; |