diff options
-rw-r--r-- | scumm/script.cpp | 95 | ||||
-rw-r--r-- | scumm/script_v5.cpp | 18 | ||||
-rw-r--r-- | scumm/scumm.h | 1 |
3 files changed, 113 insertions, 1 deletions
diff --git a/scumm/script.cpp b/scumm/script.cpp index 67a902ca5e..24b69d7394 100644 --- a/scumm/script.cpp +++ b/scumm/script.cpp @@ -30,6 +30,7 @@ #include "scumm/resource.h" #include "scumm/util.h" #include "scumm/scumm.h" +#include "scumm/verbs.h" namespace Scumm { @@ -726,8 +727,100 @@ void ScummEngine::runInventoryScript(int i) { memset(args, 0, sizeof(args)); args[0] = i; if (VAR(VAR_INVENTORY_SCRIPT)) { - runScript(VAR(VAR_INVENTORY_SCRIPT), 0, 0, args); + if (_gameId == GID_INDY3 && _platform == Common::kPlatformMacintosh) { + inventoryScript(args); + } else { + runScript(VAR(VAR_INVENTORY_SCRIPT), 0, 0, args); + } + } +} + +void ScummEngine::inventoryScript(int *args) { + VerbSlot *vs; + int j, slot; + + if (VAR(67) < 0) { + VAR(67) = 0; + } + args[5] = getInventoryCount(VAR(VAR_EGO)); + if (args[5] <= 6) { + VAR(67) = 0; + } + if (args[5] >= 6) { + args[5] -= 6; + } + args[6] = 0; + if (VAR(67) >= args[5]) { + VAR(67) = args[5]; + args[4] = args[5]; + args[5] /= 2; + args[5] *= 2; + args[4] -= args[5]; + if (args[4]) { + VAR(67)++; + } + args[6]++; + } + args[2] = 1; + for (j = 1; j < 7; j++) { + args[1] = (VAR(67) + args[2]); + args[3] = findInventory(VAR(VAR_EGO),args[1]); + VAR(82 + args[2]) = args[3]; + args[2]++; + } + + byte tmp[6]; + + tmp[0] = 0xFF; + tmp[1] = 0x06; + tmp[3] = 0x00; + tmp[4] = 0x00; + + for (j = 0; j < 6; j++) { + tmp[2] = 0x53 + j; + + slot = getVerbSlot(101 + j, 0); + vs = &_verbs[slot]; + loadPtrToResource(rtVerb, slot, tmp); + vs->type = kTextVerbType; + vs->imgindex = 0; + vs->curmode = 1; + drawVerb(slot, 0); + } + + args[5] = getInventoryCount(VAR(VAR_EGO)); + if (args[5] > 6) { + slot = getVerbSlot(107, 0); + if (VAR(67)) { + vs = &_verbs[slot]; + vs->curmode = 1; + } else { + vs = &_verbs[slot]; + vs->curmode = 0; + } + drawVerb(slot, 0); + slot = getVerbSlot(108, 0); + if (!args[6]) { + vs = &_verbs[slot]; + vs->curmode = 1; + } else { + vs = &_verbs[slot]; + vs->curmode = 0; + } + drawVerb(slot, 0); + } else { + slot = getVerbSlot(107, 0); + vs = &_verbs[slot]; + vs->curmode = 0; + drawVerb(slot, 0); + verbMouseOver(0); + slot = getVerbSlot(108, 0); + vs = &_verbs[slot]; + vs->curmode = 0; + drawVerb(slot, 0); } + + verbMouseOver(0); } void ScummEngine::freezeScripts(int flag) { diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp index a33e522d94..cf9a43c2ce 100644 --- a/scumm/script_v5.cpp +++ b/scumm/script_v5.cpp @@ -2131,6 +2131,24 @@ void ScummEngine_v5::o5_setVarRange() { setResult(b); _resultVarNumber++; } while (--a); + + // Macintosh verison of indy3ega used different interface, so adjust values. + if (_gameId == GID_INDY3 && _platform == Common::kPlatformMacintosh) { + VAR(68) = 0; + VAR(69) = 0; + VAR(70) = 168; + VAR(71) = 0; + VAR(72) = 168; + VAR(73) = 0; + VAR(74) = 168; + VAR(75) = 0; + VAR(76) = 176; + VAR(77) = 176; + VAR(78) = 184; + VAR(79) = 184; + VAR(80) = 192; + VAR(81) = 192; + } } void ScummEngine_v5::o5_startMusic() { diff --git a/scumm/scumm.h b/scumm/scumm.h index 412759aec6..38753045a6 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -623,6 +623,7 @@ protected: void executeScript(); void updateScriptPtr(); virtual void runInventoryScript(int i); + void inventoryScript(int *args); void checkAndRunSentenceScript(); void runExitScript(); void runEntryScript(); |