From 6e55e32a381d1219dfbe8d3c1532d55b28291192 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Wed, 25 Jul 2012 20:00:58 +0200 Subject: WINTERMUTE: Cleanup and comment BaseRenderer a bit --- engines/wintermute/ui/ui_window.cpp | 10 +++++++++- engines/wintermute/ui/ui_window.h | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'engines/wintermute/ui') 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 &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; -- cgit v1.2.3