diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/ThemeEngine.cpp | 15 | ||||
-rw-r--r-- | gui/ThemeEngine.h | 4 | ||||
-rw-r--r-- | gui/widget.cpp | 16 |
3 files changed, 18 insertions, 17 deletions
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp index ee860ffbf9..e0563da711 100644 --- a/gui/ThemeEngine.cpp +++ b/gui/ThemeEngine.cpp @@ -172,14 +172,15 @@ protected: class ThemeItemABitmap : public ThemeItem { public: - ThemeItemABitmap(ThemeEngine *engine, const Common::Rect &area, Graphics::TransparentSurface *bitmap, ThemeEngine::AutoScaleMode autoscale) : - ThemeItem(engine, area), _bitmap(bitmap), _autoscale(autoscale) {} + ThemeItemABitmap(ThemeEngine *engine, const Common::Rect &area, Graphics::TransparentSurface *bitmap, ThemeEngine::AutoScaleMode autoscale, int alpha) : + ThemeItem(engine, area), _bitmap(bitmap), _autoscale(autoscale), _alpha(alpha) {} void drawSelf(bool draw, bool restore); protected: Graphics::TransparentSurface *_bitmap; ThemeEngine::AutoScaleMode _autoscale; + int _alpha; }; class ThemeItemBitmapClip : public ThemeItem { @@ -334,7 +335,7 @@ void ThemeItemABitmap::drawSelf(bool draw, bool restore) { _engine->restoreBackground(_area); if (draw) - _engine->renderer()->blitAlphaBitmap(_bitmap, _area, _autoscale); + _engine->renderer()->blitAlphaBitmap(_bitmap, _area, _autoscale, Graphics::DrawStep::kVectorAlignManual, Graphics::DrawStep::kVectorAlignManual, _alpha); _engine->addDirtyRect(_area); } @@ -1114,12 +1115,12 @@ void ThemeEngine::queueBitmap(const Graphics::Surface *bitmap, const Common::Rec } } -void ThemeEngine::queueABitmap(Graphics::TransparentSurface *bitmap, const Common::Rect &r, AutoScaleMode autoscale) { +void ThemeEngine::queueABitmap(Graphics::TransparentSurface *bitmap, const Common::Rect &r, AutoScaleMode autoscale, int alpha) { Common::Rect area = r; area.clip(_screen.w, _screen.h); - ThemeItemABitmap *q = new ThemeItemABitmap(this, area, bitmap, autoscale); + ThemeItemABitmap *q = new ThemeItemABitmap(this, area, bitmap, autoscale, alpha); if (_buffering) { _screenQueue.push_back(q); @@ -1519,11 +1520,11 @@ void ThemeEngine::drawSurface(const Common::Rect &r, const Graphics::Surface &su queueBitmap(&surface, r, themeTrans); } -void ThemeEngine::drawASurface(const Common::Rect &r, Graphics::TransparentSurface &surface, AutoScaleMode autoscale) { +void ThemeEngine::drawASurface(const Common::Rect &r, Graphics::TransparentSurface &surface, AutoScaleMode autoscale, int alpha) { if (!ready()) return; - queueABitmap(&surface, r, autoscale); + queueABitmap(&surface, r, autoscale, alpha); } void ThemeEngine::drawSurfaceClip(const Common::Rect &r, const Common::Rect &clip, const Graphics::Surface &surface, WidgetStateInfo state, int alpha, bool themeTrans) { diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h index f4a8b1ed0a..91f82b1122 100644 --- a/gui/ThemeEngine.h +++ b/gui/ThemeEngine.h @@ -364,7 +364,7 @@ public: void drawSurfaceClip(const Common::Rect &r, const Common::Rect &clippingRect, const Graphics::Surface &surface, WidgetStateInfo state = kStateEnabled, int alpha = 255, bool themeTrans = false); - void drawASurface(const Common::Rect &r, Graphics::TransparentSurface &surface, AutoScaleMode autoscale); + void drawASurface(const Common::Rect &r, Graphics::TransparentSurface &surface, AutoScaleMode autoscale, int alpha); void drawSlider(const Common::Rect &r, int width, WidgetStateInfo state = kStateEnabled); @@ -645,7 +645,7 @@ protected: bool elipsis, Graphics::TextAlign alignH = Graphics::kTextAlignLeft, TextAlignVertical alignV = kTextAlignVTop, int deltax = 0, const Common::Rect &drawableTextArea = Common::Rect(0, 0, 0, 0)); void queueBitmap(const Graphics::Surface *bitmap, const Common::Rect &r, bool alpha); void queueBitmapClip(const Graphics::Surface *bitmap, const Common::Rect &clippingRect, const Common::Rect &r, bool alpha); - void queueABitmap(Graphics::TransparentSurface *bitmap, const Common::Rect &r, AutoScaleMode autoscale); + void queueABitmap(Graphics::TransparentSurface *bitmap, const Common::Rect &r, AutoScaleMode autoscale, int alpha); /** * DEBUG: Draws a white square and writes some text next to it. diff --git a/gui/widget.cpp b/gui/widget.cpp index ffdca7337b..fcfd0f8986 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -398,7 +398,7 @@ void ButtonWidget::setUnpressedState() { PicButtonWidget::PicButtonWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip, uint32 cmd, uint8 hotkey) : ButtonWidget(boss, x, y, w, h, "", tooltip, cmd, hotkey), - _alpha(256), _transparency(false), _showButton(true) { + _alpha(255), _transparency(false), _showButton(true) { setFlags(WIDGET_ENABLED/* | WIDGET_BORDER*/ | WIDGET_CLEARBG); _type = kButtonWidget; @@ -407,7 +407,7 @@ PicButtonWidget::PicButtonWidget(GuiObject *boss, int x, int y, int w, int h, co PicButtonWidget::PicButtonWidget(GuiObject *boss, const Common::String &name, const char *tooltip, uint32 cmd, uint8 hotkey) : ButtonWidget(boss, name, "", tooltip, cmd, hotkey), - _alpha(256), _transparency(false), _showButton(true), _isAlpha(false) { + _alpha(255), _transparency(false), _showButton(true), _isAlpha(false) { setFlags(WIDGET_ENABLED/* | WIDGET_BORDER*/ | WIDGET_CLEARBG); _type = kButtonWidget; _mode = ThemeEngine::kAutoScaleNone; @@ -520,10 +520,10 @@ void PicButtonWidget::drawWidget() { const int x = _x + (_w - gfx->w) / 2; const int y = _y + (_h - gfx->h) / 2; - g_gui.theme()->drawASurface(Common::Rect(x, y, x + gfx->w, y + gfx->h), *gfx, _mode); + g_gui.theme()->drawASurface(Common::Rect(x, y, x + gfx->w, y + gfx->h), *gfx, _mode, _alpha); } else { - g_gui.theme()->drawASurface(Common::Rect(_x, _y, _x + _w, _y + _h), *gfx, _mode); + g_gui.theme()->drawASurface(Common::Rect(_x, _y, _x + _w, _y + _h), *gfx, _mode, _alpha); } } } @@ -715,13 +715,13 @@ int SliderWidget::posToValue(int pos) { #pragma mark - GraphicsWidget::GraphicsWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip) - : Widget(boss, x, y, w, h, tooltip), _gfx(), _alpha(256), _transparency(false) { + : Widget(boss, x, y, w, h, tooltip), _gfx(), _alpha(255), _transparency(false) { setFlags(WIDGET_ENABLED | WIDGET_CLEARBG); _type = kGraphicsWidget; } GraphicsWidget::GraphicsWidget(GuiObject *boss, const Common::String &name, const char *tooltip) - : Widget(boss, name, tooltip), _gfx(), _alpha(256), _transparency(false) { + : Widget(boss, name, tooltip), _gfx(), _alpha(255), _transparency(false) { setFlags(WIDGET_ENABLED | WIDGET_CLEARBG); _type = kGraphicsWidget; } @@ -807,10 +807,10 @@ void GraphicsWidget::drawWidget() { const int x = _x + (_w - _agfx.w) / 2; const int y = _y + (_h - _agfx.h) / 2; - g_gui.theme()->drawASurface(Common::Rect(x, y, x + _agfx.w, y + _agfx.h), _agfx, _mode); + g_gui.theme()->drawASurface(Common::Rect(x, y, x + _agfx.w, y + _agfx.h), _agfx, _mode, _alpha); } else { - g_gui.theme()->drawASurface(Common::Rect(_x, _y, _x + _w, _y + _h), _agfx, _mode); + g_gui.theme()->drawASurface(Common::Rect(_x, _y, _x + _w, _y + _h), _agfx, _mode, _alpha); } } } |