diff options
author | Eugene Sandulenko | 2019-12-16 11:23:06 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2019-12-16 11:23:06 +0100 |
commit | 8c0590be77979645429e254fb4a763d0932c8722 (patch) | |
tree | f6c299c24b758715132e1e29c9ea518b0b8d3756 /graphics/macgui | |
parent | f724e672f8b65e4be74b73711e996e8b1bb78291 (diff) | |
download | scummvm-rg350-8c0590be77979645429e254fb4a763d0932c8722.tar.gz scummvm-rg350-8c0590be77979645429e254fb4a763d0932c8722.tar.bz2 scummvm-rg350-8c0590be77979645429e254fb4a763d0932c8722.zip |
GRAPHICS: MACGUI: Initial code for truly modal MacMenu
Diffstat (limited to 'graphics/macgui')
-rw-r--r-- | graphics/macgui/macmenu.cpp | 23 | ||||
-rw-r--r-- | graphics/macgui/macmenu.h | 2 | ||||
-rw-r--r-- | graphics/macgui/macwindowmanager.cpp | 1 |
3 files changed, 24 insertions, 2 deletions
diff --git a/graphics/macgui/macmenu.cpp b/graphics/macgui/macmenu.cpp index 54b9c9e91f..4594b6a156 100644 --- a/graphics/macgui/macmenu.cpp +++ b/graphics/macgui/macmenu.cpp @@ -954,12 +954,16 @@ bool MacMenu::mouseClick(int x, int y) { _items[_activeItem]->submenu->highlight = -1; } + if (!_menuActivated) + _wm->activateMenu(); + _menuActivated = true; _contentIsDirty = true; _wm->setFullRefresh(true); - _wm->activateMenu(); + if (_wm->_mode & kWMModalMenuMode) + eventLoop(); return true; } @@ -1185,4 +1189,21 @@ void MacMenu::disableAllMenus() { _contentIsDirty = true; } +void MacMenu::eventLoop() { + _contentIsDirty = true; + + while (_menuActivated) { + Common::Event event; + + while (g_system->getEventManager()->pollEvent(event)) { + processEvent(event); + + draw(_wm->_screen); + } + + g_system->updateScreen(); + g_system->delayMillis(10); + } +} + } // End of namespace Wage diff --git a/graphics/macgui/macmenu.h b/graphics/macgui/macmenu.h index 88f6e9bb74..c8633c0cc7 100644 --- a/graphics/macgui/macmenu.h +++ b/graphics/macgui/macmenu.h @@ -111,6 +111,8 @@ private: void drawSubMenuArrow(ManagedSurface *dst, int x, int y, int color); + void eventLoop(); + ItemArray _items; const Font *_font; diff --git a/graphics/macgui/macwindowmanager.cpp b/graphics/macgui/macwindowmanager.cpp index f48a2faf74..5d59e2d57a 100644 --- a/graphics/macgui/macwindowmanager.cpp +++ b/graphics/macgui/macwindowmanager.cpp @@ -240,7 +240,6 @@ void MacWindowManager::activateMenu() { return; if (_mode & kWMModalMenuMode) { - warning("HHERE"); if (!_screenCopy) _screenCopy = new ManagedSurface(*_screen); // Create a copy else |