diff options
Diffstat (limited to 'engines/scumm')
-rw-r--r-- | engines/scumm/script_v4.cpp | 26 | ||||
-rw-r--r-- | engines/scumm/script_v5.cpp | 27 | ||||
-rw-r--r-- | engines/scumm/scumm_v4.h | 3 | ||||
-rw-r--r-- | engines/scumm/scumm_v5.h | 1 |
4 files changed, 31 insertions, 26 deletions
diff --git a/engines/scumm/script_v4.cpp b/engines/scumm/script_v4.cpp index 0111c91f8c..77f293470b 100644 --- a/engines/scumm/script_v4.cpp +++ b/engines/scumm/script_v4.cpp @@ -32,6 +32,32 @@ namespace Scumm { void ScummEngine_v4::setupOpcodes() { ScummEngine_v5::setupOpcodes(); + + OPCODE(0x50, o4_pickupObject); + OPCODE(0xd0, o4_pickupObject); +} + +void ScummEngine_v4::o4_pickupObject() { + int obj = getVarOrDirectWord(PARAM_1); + + if (obj < 1) { + error("pickupObjectOld received invalid index %d (script %d)", obj, vm.slot[_currentScript].number); + } + + if (getObjectIndex(obj) == -1) + return; + + if (whereIsObject(obj) == WIO_INVENTORY) // Don't take an object twice + return; + + // debug(0, "adding %d from %d to inventoryOld", obj, _currentRoom); + addObjectToInventory(obj, _roomResource); + markObjectRectAsDirty(obj); + putOwner(obj, VAR(VAR_EGO)); + putClass(obj, kObjectClassUntouchable, 1); + putState(obj, 1); + clearDrawObjectQueue(); + runInventoryScript(1); } } // End of namespace Scumm diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp index 7e805c0c63..957543a257 100644 --- a/engines/scumm/script_v5.cpp +++ b/engines/scumm/script_v5.cpp @@ -141,7 +141,7 @@ void ScummEngine_v5::setupOpcodes() { OPCODE(0x4e, o5_putActorAtObject); OPCODE(0x4f, o5_ifState); /* 50 */ - OPCODE(0x50, o5_pickupObjectOld); +// OPCODE(0x50, o5_pickupObjectOld); OPCODE(0x51, o5_animateActor); OPCODE(0x52, o5_actorFollowCamera); OPCODE(0x53, o5_actorOps); @@ -301,7 +301,7 @@ void ScummEngine_v5::setupOpcodes() { OPCODE(0xce, o5_putActorAtObject); OPCODE(0xcf, o5_ifState); /* D0 */ - OPCODE(0xd0, o5_pickupObjectOld); +// OPCODE(0xd0, o5_pickupObjectOld); OPCODE(0xd1, o5_animateActor); OPCODE(0xd2, o5_actorFollowCamera); OPCODE(0xd3, o5_actorOps); @@ -3053,27 +3053,4 @@ void ScummEngine_v5::o5_oldRoomEffect() { } } -void ScummEngine_v5::o5_pickupObjectOld() { - int obj = getVarOrDirectWord(PARAM_1); - - if (obj < 1) { - error("pickupObjectOld received invalid index %d (script %d)", obj, vm.slot[_currentScript].number); - } - - if (getObjectIndex(obj) == -1) - return; - - if (whereIsObject(obj) == WIO_INVENTORY) /* Don't take an */ - return; /* object twice */ - - // debug(0, "adding %d from %d to inventoryOld", obj, _currentRoom); - addObjectToInventory(obj, _roomResource); - markObjectRectAsDirty(obj); - putOwner(obj, VAR(VAR_EGO)); - putClass(obj, kObjectClassUntouchable, 1); - putState(obj, 1); - clearDrawObjectQueue(); - runInventoryScript(1); -} - } // End of namespace Scumm diff --git a/engines/scumm/scumm_v4.h b/engines/scumm/scumm_v4.h index e25bfb31ab..3300019c67 100644 --- a/engines/scumm/scumm_v4.h +++ b/engines/scumm/scumm_v4.h @@ -50,6 +50,9 @@ protected: virtual void readGlobalObjects(); virtual void resetRoomObject(ObjectData *od, const byte *room, const byte *searchptr = NULL); + + /* Version 4 script opcodes */ + void o4_pickupObject(); }; diff --git a/engines/scumm/scumm_v5.h b/engines/scumm/scumm_v5.h index 57b8244136..4ff8b26ecc 100644 --- a/engines/scumm/scumm_v5.h +++ b/engines/scumm/scumm_v5.h @@ -161,7 +161,6 @@ protected: void o5_beginOverride(); void o5_panCameraTo(); void o5_pickupObject(); - void o5_pickupObjectOld(); void o5_print(); void o5_printEgo(); void o5_pseudoRoom(); |