diff options
author | Eugene Sandulenko | 2019-12-11 01:10:41 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2019-12-11 01:10:41 +0100 |
commit | ecc7986b0b679ce7cea86290687c22b371ac5624 (patch) | |
tree | 0fdf93979b95caf1c5974518208567fb75c3cafd /engines/director | |
parent | 521d28a62c4ae55d1f0b9ef1650cddd8fb5ef09e (diff) | |
download | scummvm-rg350-ecc7986b0b679ce7cea86290687c22b371ac5624.tar.gz scummvm-rg350-ecc7986b0b679ce7cea86290687c22b371ac5624.tar.bz2 scummvm-rg350-ecc7986b0b679ce7cea86290687c22b371ac5624.zip |
DIRECTOR: LINGO: Pass menu to MacMenu in installMenu built-in
Diffstat (limited to 'engines/director')
-rw-r--r-- | engines/director/lingo/lingo-builtins.cpp | 21 | ||||
-rw-r--r-- | engines/director/score.cpp | 2 |
2 files changed, 20 insertions, 3 deletions
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp index 3355ddc0e0..f3b7e377c9 100644 --- a/engines/director/lingo/lingo-builtins.cpp +++ b/engines/director/lingo/lingo-builtins.cpp @@ -1177,7 +1177,9 @@ void Lingo::b_installMenu(int nargs) { Common::String line; int linenum = -1; // We increment it before processing - //Graphics::MacMenu *menu = g_director->_wm->addMenu(); + Graphics::MacMenu *menu = g_director->_wm->addMenu(); + int submenu; + Common::String submenuText; //Graphics::MacMenuSubMenu *submenu = nullptr; for (const byte *s = (const byte *)menuStxt.c_str(); *s; s++) { @@ -1207,10 +1209,14 @@ void Lingo::b_installMenu(int nargs) { while (*p && (*p == ' ' || *p == '\t')) p++; + if (!submenuText.empty()) { + menu->createSubMenuFromString(submenu, submenuText.c_str(), 100); + } + warning("menu: '%s'", Common::toPrintable(p).c_str()); - //menu->addMenuItem(nullptr, Common::String(p)); + submenu = menu->addMenuItem(nullptr, Common::String(p)); - //submenu = menu->addSubMenu(nullptr); + submenuText.clear(); continue; } @@ -1233,6 +1239,15 @@ void Lingo::b_installMenu(int nargs) { command.trim(); warning("text: '%s' command: '%s'", Common::toPrintable(text).c_str(), Common::toPrintable(command).c_str()); + + if (!submenuText.empty()) + submenuText += ';'; + + submenuText += text; + } + + if (!submenuText.empty()) { + menu->createSubMenuFromString(submenu, submenuText.c_str(), 100); } warning("STUB: b_installMenu(%d)", d.u.i); diff --git a/engines/director/score.cpp b/engines/director/score.cpp index e462fd51d7..554a01b31d 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -1272,6 +1272,8 @@ void Score::startLoop() { _trailSurface->create(_movieRect.width(), _movieRect.height()); _backSurface->create(_movieRect.width(), _movieRect.height()); + g_director->_wm->setScreen(_surface); + if (_stageColor == 0) _trailSurface->clear(_vm->getPaletteColorCount() - 1); else |