aboutsummaryrefslogtreecommitdiff
path: root/gui/ThemeNew.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/ThemeNew.cpp')
-rw-r--r--gui/ThemeNew.cpp25
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) {