aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/menu.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2010-07-28 19:03:49 +0000
committerMatthew Hoops2010-07-28 19:03:49 +0000
commit07b67fe44b20f8f1c9dcdf659f5e2666d69834f4 (patch)
tree60d2c4ff90a13499324b86b6c3377d72607b1d72 /engines/sci/graphics/menu.cpp
parent9a1afc5a2473b29a288a808917ed522ac3fac531 (diff)
downloadscummvm-rg350-07b67fe44b20f8f1c9dcdf659f5e2666d69834f4.tar.gz
scummvm-rg350-07b67fe44b20f8f1c9dcdf659f5e2666d69834f4.tar.bz2
scummvm-rg350-07b67fe44b20f8f1c9dcdf659f5e2666d69834f4.zip
SCI: Fix using the parser in SCI Fan Games
Get a pointer to the said spec instead of copying to a buffer. The fan games use a said spec with size < 64. Also, make said() take a const pointer as the spec cannot change. Thanks to waltervn and wjp. svn-id: r51432
Diffstat (limited to 'engines/sci/graphics/menu.cpp')
-rw-r--r--engines/sci/graphics/menu.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp
index 92c0e92f48..120c43f379 100644
--- a/engines/sci/graphics/menu.cpp
+++ b/engines/sci/graphics/menu.cpp
@@ -397,7 +397,6 @@ reg_t GfxMenu::kernelSelect(reg_t eventObject, bool pauseSound) {
GuiMenuItemEntry *itemEntry = NULL;
bool forceClaimed = false;
EngineState *s;
- byte saidSpec[64];
switch (eventType) {
case SCI_EVENT_KEYBOARD:
@@ -437,8 +436,13 @@ reg_t GfxMenu::kernelSelect(reg_t eventObject, bool pauseSound) {
itemEntry = *itemIterator;
if (!itemEntry->saidVmPtr.isNull()) {
- // TODO: get a pointer to saidVmPtr or make said() work on VmPtrs
- _segMan->memcpy(saidSpec, itemEntry->saidVmPtr, 64);
+ byte *saidSpec = _segMan->derefBulkPtr(itemEntry->saidVmPtr, 0);
+
+ if (!saidSpec) {
+ warning("Could not dereference saidSpec");
+ continue;
+ }
+
if (said(s, saidSpec, 0) != SAID_NO_MATCH)
break;
}