aboutsummaryrefslogtreecommitdiff
path: root/graphics/macgui
diff options
context:
space:
mode:
authorEugene Sandulenko2019-10-02 13:47:04 +0200
committerEugene Sandulenko2019-10-02 13:47:04 +0200
commit87dc3689aa8f245ceb3b1b7ff614c107cd81a414 (patch)
treecb3d2c55ac60803989b87a9b24b0feec2f6a2e98 /graphics/macgui
parent5b0e4650016791ad95dd888548f27be22c843e8b (diff)
downloadscummvm-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.cpp12
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;
}