aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorWalter van Niftrik2016-04-15 12:52:56 +0200
committerWalter van Niftrik2016-06-06 20:35:49 +0200
commite755f8fcba4d3dfc746d83f60b70d2aad86360b9 (patch)
tree52e7a245823c6ca9851d94fa8d905fbff5445690 /engines
parente79f26c9bcda2c08ef7a7628960c71cff336daaf (diff)
downloadscummvm-rg350-e755f8fcba4d3dfc746d83f60b70d2aad86360b9.tar.gz
scummvm-rg350-e755f8fcba4d3dfc746d83f60b70d2aad86360b9.tar.bz2
scummvm-rg350-e755f8fcba4d3dfc746d83f60b70d2aad86360b9.zip
ADL: Implement hires6 "move item" opcode
Diffstat (limited to 'engines')
-rw-r--r--engines/adl/adl_v3.cpp22
-rw-r--r--engines/adl/adl_v3.h1
2 files changed, 22 insertions, 1 deletions
diff --git a/engines/adl/adl_v3.cpp b/engines/adl/adl_v3.cpp
index d0e924296e..9041a47945 100644
--- a/engines/adl/adl_v3.cpp
+++ b/engines/adl/adl_v3.cpp
@@ -81,7 +81,7 @@ void AdlEngine_v3::setupOpcodeTables() {
Opcode(o1_varSet);
// 0x04
Opcode(o1_listInv);
- Opcode(o2_moveItem);
+ Opcode(o3_moveItem);
Opcode(o1_setRoom);
Opcode(o1_setCurPic);
// 0x08
@@ -136,6 +136,7 @@ int AdlEngine_v3::o3_skipOneCommand(ScriptEnv &e) {
return -1;
}
+// FIXME: Rename "isLineArt" and look at code duplication
int AdlEngine_v3::o3_isItemInRoom(ScriptEnv &e) {
OP_DEBUG_2("\t&& GET_ITEM_ROOM(%s) == %s", itemStr(e.arg(1)).c_str(), itemRoomStr(e.arg(2)).c_str());
@@ -168,4 +169,23 @@ int AdlEngine_v3::o3_isNounNotInRoom(ScriptEnv &e) {
return 1;
}
+int AdlEngine_v3::o3_moveItem(ScriptEnv &e) {
+ OP_DEBUG_2("\tSET_ITEM_ROOM(%s, %s)", itemStr(e.arg(1)).c_str(), itemRoomStr(e.arg(2)).c_str());
+
+ byte room = roomArg(e.arg(2));
+
+ Item &item = getItem(e.arg(1));
+
+ if (item.room == _roomOnScreen)
+ _picOnScreen = 0;
+
+ // Set items that move from inventory to a room to state "dropped"
+ if (item.room == IDI_ANY && room != IDI_VOID_ROOM)
+ item.state = IDI_ITEM_DROPPED;
+
+ item.room = room;
+ item.isLineArt = _curDisk;
+ return 2;
+}
+
} // End of namespace Adl
diff --git a/engines/adl/adl_v3.h b/engines/adl/adl_v3.h
index f022adf3b7..77b64fde23 100644
--- a/engines/adl/adl_v3.h
+++ b/engines/adl/adl_v3.h
@@ -50,6 +50,7 @@ protected:
int o3_isItemInRoom(ScriptEnv &e);
int o3_isNounNotInRoom(ScriptEnv &e);
int o3_skipOneCommand(ScriptEnv &e);
+ int o3_moveItem(ScriptEnv &e);
Common::Array<Common::String> _itemDesc;
byte _curDisk;