diff options
Diffstat (limited to 'engines/wage')
-rw-r--r-- | engines/wage/design.cpp | 12 | ||||
-rw-r--r-- | engines/wage/design.h | 2 | ||||
-rw-r--r-- | engines/wage/menu.cpp | 16 |
3 files changed, 25 insertions, 5 deletions
diff --git a/engines/wage/design.cpp b/engines/wage/design.cpp index 621da1e331..3db9d27f4c 100644 --- a/engines/wage/design.cpp +++ b/engines/wage/design.cpp @@ -661,6 +661,12 @@ void Design::drawEllipse(int x0, int y0, int x1, int y1, bool filled, void (*plo } } +void Design::drawHLine(Graphics::Surface *surface, int x1, int x2, int y, int thickness, int color, Patterns &patterns, byte fillType) { + plotData pd(surface, &patterns, fillType, thickness); + + drawHLine(x1, x2, y, color, drawPixel, &pd); +} + void Design::drawHLine(int x1, int x2, int y, int color, void (*plotProc)(int, int, int, void *), void *data) { if (x1 > x2) SWAP(x1, x2); @@ -669,6 +675,12 @@ void Design::drawHLine(int x1, int x2, int y, int color, void (*plotProc)(int, i (*plotProc)(x, y, color, data); } +void Design::drawVLine(Graphics::Surface *surface, int x, int y1, int y2, int thickness, int color, Patterns &patterns, byte fillType) { + plotData pd(surface, &patterns, fillType, thickness); + + drawVLine(x, y1, y2, color, drawPixel, &pd); +} + void Design::drawVLine(int x, int y1, int y2, int color, void (*plotProc)(int, int, int, void *), void *data) { if (y1 > y2) SWAP(y1, y2); diff --git a/engines/wage/design.h b/engines/wage/design.h index 459862ed38..26f832e767 100644 --- a/engines/wage/design.h +++ b/engines/wage/design.h @@ -72,6 +72,8 @@ public: static void drawRect(Graphics::Surface *surface, Common::Rect &rect, int thickness, int color, Patterns &patterns, byte fillType); static void drawFilledRect(Graphics::Surface *surface, Common::Rect &rect, int color, Patterns &patterns, byte fillType); static void drawFilledRoundRect(Graphics::Surface *surface, Common::Rect &rect, int arc, int color, Patterns &patterns, byte fillType); + static void drawHLine(Graphics::Surface *surface, int x1, int x2, int y, int thickness, int color, Patterns &patterns, byte fillType); + static void drawVLine(Graphics::Surface *surface, int x, int y1, int y2, int thickness, int color, Patterns &patterns, byte fillType); private: diff --git a/engines/wage/menu.cpp b/engines/wage/menu.cpp index 7c680d7c68..5dc761b82c 100644 --- a/engines/wage/menu.cpp +++ b/engines/wage/menu.cpp @@ -274,6 +274,10 @@ void Menu::renderSubmenu(MenuItem *menu) { Design::drawFilledRect(&_gui->_screen, *r, kColorWhite, _patterns, 1); Design::drawRect(&_gui->_screen, *r, 1, kColorBlack, _patterns, 1); + Design::drawVLine(&_gui->_screen, r->right + 1, r->top + 2, r->bottom + 2, 1, kColorBlack, _patterns, 1); + Design::drawVLine(&_gui->_screen, r->right + 2, r->top + 2, r->bottom + 2, 1, kColorBlack, _patterns, 1); + Design::drawHLine(&_gui->_screen, r->left + 3, r->right + 2, r->bottom + 1, 1, kColorBlack, _patterns, 1); + Design::drawHLine(&_gui->_screen, r->left + 3, r->right + 2, r->bottom + 2, 1, kColorBlack, _patterns, 1); int x = r->left + kMenuDropdownPadding; int y = r->top; @@ -283,7 +287,7 @@ void Menu::renderSubmenu(MenuItem *menu) { y += kMenuDropdownItemHeight; } - g_system->copyRectToScreen(_gui->_screen.getBasePtr(r->left, r->top), _gui->_screen.pitch, r->left, r->top, r->width() + 1, r->height() + 1); + g_system->copyRectToScreen(_gui->_screen.getBasePtr(r->left, r->top), _gui->_screen.pitch, r->left, r->top, r->width() + 3, r->height() + 3); } bool Menu::mouseClick(int x, int y) { @@ -296,11 +300,13 @@ bool Menu::mouseClick(int x, int y) { if (_activeItem == i) return false; - if (_activeItem != -1) { - Common::Rect *r = &_items[_activeItem]->subbbox; + if (_activeItem != -1) { // Restore background + Common::Rect r(_items[_activeItem]->subbbox); + r.right += 3; + r.bottom += 3; - _gui->_screen.copyRectToSurface(_screenCopy, r->left, r->top, *r); - g_system->copyRectToScreen(_gui->_screen.getBasePtr(r->left, r->top), _gui->_screen.pitch, r->left, r->top, r->width() + 1, r->height() + 1); + _gui->_screen.copyRectToSurface(_screenCopy, r.left, r.top, r); + g_system->copyRectToScreen(_gui->_screen.getBasePtr(r.left, r.top), _gui->_screen.pitch, r.left, r.top, r.width() + 1, r.height() + 1); } _activeItem = i; |