diff options
author | Martin Kiewitz | 2010-01-22 17:38:06 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-01-22 17:38:06 +0000 |
commit | 61acb22fc56c59331fa539fbd9d7920e97409ad9 (patch) | |
tree | 1d8ddf1942ae8312c9d0e46e3de43e5184ed4b9c /engines/sci | |
parent | 90d503c74acaba56ca1233a0220ca98c4f58b87e (diff) | |
download | scummvm-rg350-61acb22fc56c59331fa539fbd9d7920e97409ad9.tar.gz scummvm-rg350-61acb22fc56c59331fa539fbd9d7920e97409ad9.tar.bz2 scummvm-rg350-61acb22fc56c59331fa539fbd9d7920e97409ad9.zip |
SCI: draw a black line under menubar when menu is active (effectively for jones, wouldnt be needed otherwise), adjust inverting menu selections accordingly
svn-id: r47441
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/graphics/gfx.cpp | 2 | ||||
-rw-r--r-- | engines/sci/graphics/gfx.h | 2 | ||||
-rw-r--r-- | engines/sci/graphics/menu.cpp | 19 |
3 files changed, 15 insertions, 8 deletions
diff --git a/engines/sci/graphics/gfx.cpp b/engines/sci/graphics/gfx.cpp index 3a3d39bc7d..c230371b42 100644 --- a/engines/sci/graphics/gfx.cpp +++ b/engines/sci/graphics/gfx.cpp @@ -66,6 +66,8 @@ void Gfx::init(Text *text) { _text->SetFont(0); _menuPort->rect = Common::Rect(0, 0, _screen->getWidth(), _screen->getHeight()); _menuBarRect = Common::Rect(0, 0, _screen->getWidth(), 9); + _menuRect = Common::Rect(0, 0, _screen->getWidth(), 10); + _menuLine = Common::Rect(0, 9, _screen->getWidth(), 10); _EGAdrawingVisualize = false; diff --git a/engines/sci/graphics/gfx.h b/engines/sci/graphics/gfx.h index fb26790cb9..284cc6f8f4 100644 --- a/engines/sci/graphics/gfx.h +++ b/engines/sci/graphics/gfx.h @@ -105,6 +105,8 @@ public: Port *_menuPort; Common::Rect _menuBarRect; + Common::Rect _menuRect; + Common::Rect _menuLine; Port *_curPort; View *getView(GuiResourceId viewNum); diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp index d3fb457b0a..6a3313f503 100644 --- a/engines/sci/graphics/menu.cpp +++ b/engines/sci/graphics/menu.cpp @@ -300,8 +300,9 @@ void Menu::drawBar() { GuiMenuList::iterator listIterator; GuiMenuList::iterator listEnd = _list.end(); - // Hardcoded black on white + // Hardcoded black on white and a black line afterwards _gfx->FillRect(_gfx->_menuBarRect, 1, _screen->getColorWhite()); + _gfx->FillRect(_gfx->_menuLine, 1, 0); _gfx->PenColor(0); _gfx->MoveTo(8, 1); @@ -418,7 +419,7 @@ reg_t Menu::select(reg_t eventObject) { } if (!_barSaveHandle.isNull()) { _gfx->BitsRestore(_barSaveHandle); - _gfx->BitsShow(_gfx->_menuBarRect); + _gfx->BitsShow(_gfx->_menuRect); _barSaveHandle = NULL_REG; } if (_oldPort) @@ -559,6 +560,8 @@ void Menu::drawMenu(uint16 oldMenuId, uint16 newMenuId) { } _gfx->TextGreyedOutput(false); + // Draw the black line again + _gfx->FillRect(_gfx->_menuLine, 1, 0); _menuRect.left -= 8; _menuRect.left--; _menuRect.right++; _menuRect.bottom++; @@ -571,8 +574,8 @@ void Menu::invertMenuSelection(uint16 itemId) { if (itemId == 0) return; - itemRect.top += (itemId - 1) * _gfx->_curPort->fontHeight; - itemRect.bottom = itemRect.top + _gfx->_curPort->fontHeight + 1; + itemRect.top += (itemId - 1) * _gfx->_curPort->fontHeight + 1; + itemRect.bottom = itemRect.top + _gfx->_curPort->fontHeight; itemRect.left++; itemRect.right--; _gfx->InvertRect(itemRect); @@ -648,7 +651,7 @@ GuiMenuItemEntry *Menu::interactiveWithKeyboard() { calculateTextWidth(); _oldPort = _gfx->SetPort(_gfx->_menuPort); - _barSaveHandle = _gfx->BitsSave(_gfx->_menuBarRect, SCI_SCREEN_MASK_VISUAL); + _barSaveHandle = _gfx->BitsSave(_gfx->_menuRect, SCI_SCREEN_MASK_VISUAL); _gfx->PenColor(0); _gfx->BackColor(_screen->getColorWhite()); @@ -656,7 +659,7 @@ GuiMenuItemEntry *Menu::interactiveWithKeyboard() { drawBar(); drawMenu(0, curItemEntry->menuId); invertMenuSelection(curItemEntry->id); - _gfx->BitsShow(_gfx->_menuBarRect); + _gfx->BitsShow(_gfx->_menuRect); _gfx->BitsShow(_menuRect); while (true) { @@ -769,13 +772,13 @@ GuiMenuItemEntry *Menu::interactiveWithMouse() { calculateTextWidth(); _oldPort = _gfx->SetPort(_gfx->_menuPort); - _barSaveHandle = _gfx->BitsSave(_gfx->_menuBarRect, SCI_SCREEN_MASK_VISUAL); + _barSaveHandle = _gfx->BitsSave(_gfx->_menuRect, SCI_SCREEN_MASK_VISUAL); _gfx->PenColor(0); _gfx->BackColor(_screen->getColorWhite()); drawBar(); - _gfx->BitsShow(_gfx->_menuBarRect); + _gfx->BitsShow(_gfx->_menuRect); while (true) { curEvent = _event->get(SCI_EVENT_ANY); |