diff options
author | Eugene Sandulenko | 2019-10-02 13:47:04 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2019-10-02 13:47:04 +0200 |
commit | 87dc3689aa8f245ceb3b1b7ff614c107cd81a414 (patch) | |
tree | cb3d2c55ac60803989b87a9b24b0feec2f6a2e98 /graphics/macgui | |
parent | 5b0e4650016791ad95dd888548f27be22c843e8b (diff) | |
download | scummvm-rg350-87dc3689aa8f245ceb3b1b7ff614c107cd81a414.tar.gz scummvm-rg350-87dc3689aa8f245ceb3b1b7ff614c107cd81a414.tar.bz2 scummvm-rg350-87dc3689aa8f245ceb3b1b7ff614c107cd81a414.zip |
GRAPHICS: MACGUI: Fix and simplify nested submenu reading
Diffstat (limited to 'graphics/macgui')
-rw-r--r-- | graphics/macgui/macmenu.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/graphics/macgui/macmenu.cpp b/graphics/macgui/macmenu.cpp index 839404de81..91c01e0983 100644 --- a/graphics/macgui/macmenu.cpp +++ b/graphics/macgui/macmenu.cpp @@ -231,19 +231,15 @@ MacMenu *MacMenu::createMenuFromPEexe(Common::PEResources &exe, MacWindowManager if (flags & kPopUp) { if (depth == 0) { menu->addMenuItem(readUnicodeString(menuData)); - - MacMenuSubMenu *submenu = menu->addSubMenu(nullptr); - menus.push(submenu); } else { - MacMenuSubMenu *submenu = menu->addSubMenu(menus.size() ? menus.top() : nullptr); - - menus.push(submenu); - Common::U32String name = readUnicodeString(menuData); - menu->addSubMenuItem(submenu, name, action); + menu->addSubMenuItem(menus.top(), name, action); action++; } + MacMenuSubMenu *submenu = menu->addSubMenu(menus.size() ? menus.top() : nullptr); + menus.push(submenu); + if (lastPopUp) { lastPopUpCopy = lastPopUp; } |