aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2019-10-02 12:41:45 +0200
committerEugene Sandulenko2019-10-02 12:41:45 +0200
commit6dee0833520e06a8e97a85c3c76122d0af38d89f (patch)
treee2fb19e6157de222d50605921baa959c7e7e0725
parenta49fd0dd5e2c578399858e1687f45dff056dc964 (diff)
downloadscummvm-rg350-6dee0833520e06a8e97a85c3c76122d0af38d89f.tar.gz
scummvm-rg350-6dee0833520e06a8e97a85c3c76122d0af38d89f.tar.bz2
scummvm-rg350-6dee0833520e06a8e97a85c3c76122d0af38d89f.zip
GRAPHICS: MACGUI: Added debug printout for MacMenu
-rw-r--r--graphics/macgui/macmenu.cpp24
-rw-r--r--graphics/macgui/macmenu.h2
2 files changed, 26 insertions, 0 deletions
diff --git a/graphics/macgui/macmenu.cpp b/graphics/macgui/macmenu.cpp
index c22e3a0860..81208c0c35 100644
--- a/graphics/macgui/macmenu.cpp
+++ b/graphics/macgui/macmenu.cpp
@@ -276,9 +276,33 @@ MacMenu *MacMenu::createMenuFromPEexe(Common::PEResources &exe, MacWindowManager
}
}
delete menuData;
+
+ menu->printMenu();
+
return menu;
}
+void MacMenu::printMenu(int level, MacMenuSubMenu *submenu) {
+ if (!level) {
+ for (int i = 0; i < _items.size(); i++) {
+ debug("%s", _items[i]->unicode ? convertFromU32String(_items[i]->unicodeName).c_str() : _items[i]->name.c_str());
+
+ if (_items[i]->submenu != nullptr)
+ printMenu(level + 1, _items[i]->submenu);
+ }
+ } else {
+ for (int j = 0; j < level; j++)
+ debugN(" ");
+
+ for (int i = 0; i < submenu->subitems.size(); i++) {
+ debug("%s", submenu->subitems[i]->unicode ? convertFromU32String(submenu->subitems[i]->unicodeText).c_str() : submenu->subitems[i]->text.c_str());
+
+ if (submenu->subitems[i]->submenu != nullptr)
+ printMenu(level + 1, submenu->subitems[i]->submenu);
+ }
+ }
+}
+
void MacMenu::addStaticMenus(const MacMenuData *data) {
MacMenuItem *about = new MacMenuItem(_wm->_fontMan->hasBuiltInFonts() ? "\xa9" : "\xf0"); // (c) Symbol as the most resembling apple
_items.push_back(about);
diff --git a/graphics/macgui/macmenu.h b/graphics/macgui/macmenu.h
index 012ea5f609..1239cebcd7 100644
--- a/graphics/macgui/macmenu.h
+++ b/graphics/macgui/macmenu.h
@@ -107,6 +107,8 @@ private:
void drawSubMenuArrow(ManagedSurface *dst, int x, int y, int color);
+ void printMenu(int level = 0, MacMenuSubMenu *submenu = nullptr);
+
Common::Array<MacMenuItem *> _items;
const Font *_font;