diff options
author | Johannes Schickel | 2006-05-29 14:00:00 +0000 |
---|---|---|
committer | Johannes Schickel | 2006-05-29 14:00:00 +0000 |
commit | 0a557cf2a47038ea290fd13b3d64e7ce887c484c (patch) | |
tree | 852ec18d7b84b5bef279176563d4346d0a7e60b1 /gui/ThemeNew.cpp | |
parent | af25e65c31cf01026ba8baf84ab01595b16b1ddd (diff) | |
download | scummvm-rg350-0a557cf2a47038ea290fd13b3d64e7ce887c484c.tar.gz scummvm-rg350-0a557cf2a47038ea290fd13b3d64e7ce887c484c.tar.bz2 scummvm-rg350-0a557cf2a47038ea290fd13b3d64e7ce887c484c.zip |
- changes transparency parameter of Theme::drawSurface to alpha parameter.
- adds possibility to draw GraphicsWidgets with alpha values.
svn-id: r22738
Diffstat (limited to 'gui/ThemeNew.cpp')
-rw-r--r-- | gui/ThemeNew.cpp | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/gui/ThemeNew.cpp b/gui/ThemeNew.cpp index 94fc94a4db..55bb334485 100644 --- a/gui/ThemeNew.cpp +++ b/gui/ThemeNew.cpp @@ -624,7 +624,7 @@ void ThemeNew::drawButton(const Common::Rect &r, const Common::String &str, kSta addDirtyRect(r2); } -void ThemeNew::drawSurface(const Common::Rect &r, const Graphics::Surface &surface, kState state, bool transparency) { +void ThemeNew::drawSurface(const Common::Rect &r, const Graphics::Surface &surface, kState state, int alpha) { if (!_initOk) return; @@ -636,25 +636,12 @@ void ThemeNew::drawSurface(const Common::Rect &r, const Graphics::Surface &surfa assert(surface.bytesPerPixel == sizeof(OverlayColor)); - if (transparency) { - drawSurface(rect, &surface, false, false, 256); - addDirtyRect(r); - return; - } - - OverlayColor *src = (OverlayColor *)surface.pixels; - OverlayColor *dst = (OverlayColor *)_screen.getBasePtr(rect.left, rect.top); - - int w = rect.width(); - int h = rect.height(); + if (alpha != 256) + restoreBackground(rect); - while (h--) { - memcpy(dst, src, surface.pitch); - src += w; - // FIXME: this should be pitch - dst += _screen.w; - } - addDirtyRect(r); + drawSurface(rect, &surface, false, false, alpha); + addDirtyRect(rect); + return; } void ThemeNew::drawSlider(const Common::Rect &rr, int width, kState state) { |