aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/ui
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-07-25 20:00:58 +0200
committerEinar Johan Trøan Sømåen2012-07-25 20:00:58 +0200
commit6e55e32a381d1219dfbe8d3c1532d55b28291192 (patch)
treebe0675bdbb14236502a154dbd1fea229c9ef4176 /engines/wintermute/ui
parent6331bea4231b5db86d01a8f21b5ff84e4b96d8f6 (diff)
downloadscummvm-rg350-6e55e32a381d1219dfbe8d3c1532d55b28291192.tar.gz
scummvm-rg350-6e55e32a381d1219dfbe8d3c1532d55b28291192.tar.bz2
scummvm-rg350-6e55e32a381d1219dfbe8d3c1532d55b28291192.zip
WINTERMUTE: Cleanup and comment BaseRenderer a bit
Diffstat (limited to 'engines/wintermute/ui')
-rw-r--r--engines/wintermute/ui/ui_window.cpp10
-rw-r--r--engines/wintermute/ui/ui_window.h3
2 files changed, 11 insertions, 2 deletions
diff --git a/engines/wintermute/ui/ui_window.cpp b/engines/wintermute/ui/ui_window.cpp
index e9308e052b..4c1068d366 100644
--- a/engines/wintermute/ui/ui_window.cpp
+++ b/engines/wintermute/ui/ui_window.cpp
@@ -142,7 +142,15 @@ bool UIWindow::display(int offsetX, int offsetY) {
if (!_visible)
return STATUS_OK;
- if (_fadeBackground) _gameRef->_renderer->fadeToColor(_fadeColor);
+ if (_fadeBackground) {
+ Graphics::PixelFormat format = _gameRef->_renderer->getPixelFormat();
+ byte fadeR, fadeG, fadeB, fadeA;
+ // First convert from the internal format to the screen-format
+ uint32 fadeColor = format.ARGBToColor(RGBCOLGetA(_fadeColor), RGBCOLGetR(_fadeColor), RGBCOLGetG(_fadeColor), RGBCOLGetB(_fadeColor));
+ // Then get components
+ format.colorToARGB(fadeColor, fadeA, fadeR, fadeG, fadeB);
+ _gameRef->_renderer->fadeToColor(fadeR, fadeG, fadeB, fadeA);
+ }
if (_dragging) {
_posX += (_gameRef->_mousePos.x - _dragFrom.x);
diff --git a/engines/wintermute/ui/ui_window.h b/engines/wintermute/ui/ui_window.h
index 9e8862471c..c2baeb1ea1 100644
--- a/engines/wintermute/ui/ui_window.h
+++ b/engines/wintermute/ui/ui_window.h
@@ -38,6 +38,7 @@ namespace WinterMute {
class UIButton;
class BaseViewport;
class UIWindow : public UIObject {
+ uint32 _fadeColor;
public:
bool getWindowObjects(BaseArray<UIObject *, UIObject *> &Objects, bool InteractiveOnly);
@@ -49,7 +50,7 @@ public:
bool _inGame;
bool _isMenu;
bool _fadeBackground;
- uint32 _fadeColor;
+
virtual bool handleMouseWheel(int delta);
UIWindow *_shieldWindow;
UIButton *_shieldButton;