diff options
author | Martin Kiewitz | 2009-11-12 12:49:17 +0000 |
---|---|---|
committer | Martin Kiewitz | 2009-11-12 12:49:17 +0000 |
commit | d1dc586aa39cbcc2b1f8136f50494d0bb5fc9757 (patch) | |
tree | cc9033073a8db744e6799f00fea6c4fcb2af149b | |
parent | c45c335e0d303bd179beabe9013caf67893768d4 (diff) | |
download | scummvm-rg350-d1dc586aa39cbcc2b1f8136f50494d0bb5fc9757.tar.gz scummvm-rg350-d1dc586aa39cbcc2b1f8136f50494d0bb5fc9757.tar.bz2 scummvm-rg350-d1dc586aa39cbcc2b1f8136f50494d0bb5fc9757.zip |
SCI/newgui: SciGuiMenu now has said support (used in at least codename iceman)
svn-id: r45859
-rw-r--r-- | engines/sci/gui/gui_menu.cpp | 15 | ||||
-rw-r--r-- | engines/sci/gui/gui_menu.h | 1 |
2 files changed, 11 insertions, 5 deletions
diff --git a/engines/sci/gui/gui_menu.cpp b/engines/sci/gui/gui_menu.cpp index 1521e044e5..34e6394329 100644 --- a/engines/sci/gui/gui_menu.cpp +++ b/engines/sci/gui/gui_menu.cpp @@ -233,7 +233,6 @@ void SciGuiMenu::setAttribute(uint16 menuId, uint16 itemId, uint16 attributeId, itemEntry->enabled = value.isNull() ? false : true; break; case SCI_MENU_ATTRIBUTE_SAID: - itemEntry->said = _segMan->getString(value); itemEntry->saidVmPtr = value; break; case SCI_MENU_ATTRIBUTE_TEXT: @@ -334,6 +333,8 @@ reg_t SciGuiMenu::select(reg_t eventObject) { GuiMenuItemList::iterator itemEnd = _itemList.end(); GuiMenuItemEntry *itemEntry = NULL; bool forceClaimed = false; + EngineState *s; + byte saidSpec[64]; switch (eventType) { case SCI_EVT_KEYBOARD: @@ -359,11 +360,17 @@ reg_t SciGuiMenu::select(reg_t eventObject) { break; case SCI_EVT_SAID: + // HACK: should be removed as soon as said() is cleaned up + s = ((SciEngine *)g_engine)->getEngineState(); while (itemIterator != itemEnd) { itemEntry = *itemIterator; - // TODO: said comparsion - // said(_s, itemEntry->said.c_str(), 0) != SAID_NO_MATCH - // Where is this used anyway, so we can test it out? + + if (!itemEntry->saidVmPtr.isNull()) { + // TODO: get a pointer to saidVmPtr or make said() work on VmPtrs + _segMan->memcpy(saidSpec, itemEntry->saidVmPtr, 64); + if (said(s, saidSpec, 0) != SAID_NO_MATCH) + break; + } itemIterator++; } if (itemIterator == itemEnd) diff --git a/engines/sci/gui/gui_menu.h b/engines/sci/gui/gui_menu.h index 59765f8d0f..91176ab586 100644 --- a/engines/sci/gui/gui_menu.h +++ b/engines/sci/gui/gui_menu.h @@ -60,7 +60,6 @@ struct GuiMenuItemEntry { uint16 keyPress; uint16 keyModifier; bool separatorLine; - Common::String said; reg_t saidVmPtr; Common::String text; reg_t textVmPtr; |