diff options
author | Walter van Niftrik | 2016-12-11 16:45:54 +0100 |
---|---|---|
committer | Walter van Niftrik | 2016-12-11 16:51:14 +0100 |
commit | 64ff20acbc24b859ff2c66d0f58be900d302ca43 (patch) | |
tree | 32ea358dea23eae70bc6bea7b1969b1fc4a1a901 | |
parent | 0b6b5a34b0a9dec0bf71b877e552bbf9f2fa1245 (diff) | |
download | scummvm-rg350-64ff20acbc24b859ff2c66d0f58be900d302ca43.tar.gz scummvm-rg350-64ff20acbc24b859ff2c66d0f58be900d302ca43.tar.bz2 scummvm-rg350-64ff20acbc24b859ff2c66d0f58be900d302ca43.zip |
ADL: Unify inventory opcodes
-rw-r--r-- | engines/adl/adl.cpp | 2 | ||||
-rw-r--r-- | engines/adl/adl_v3.cpp | 14 | ||||
-rw-r--r-- | engines/adl/adl_v3.h | 1 | ||||
-rw-r--r-- | engines/adl/adl_v5.cpp | 14 | ||||
-rw-r--r-- | engines/adl/adl_v5.h | 1 |
5 files changed, 2 insertions, 30 deletions
diff --git a/engines/adl/adl.cpp b/engines/adl/adl.cpp index 63b0937354..76f5bac5b5 100644 --- a/engines/adl/adl.cpp +++ b/engines/adl/adl.cpp @@ -1009,7 +1009,7 @@ int AdlEngine::o1_listInv(ScriptEnv &e) { for (item = _state.items.begin(); item != _state.items.end(); ++item) if (item->room == IDI_ANY) - printMessage(item->description); + printString(getItemDescription(*item)); return 0; } diff --git a/engines/adl/adl_v3.cpp b/engines/adl/adl_v3.cpp index ba9e4a063e..46af211695 100644 --- a/engines/adl/adl_v3.cpp +++ b/engines/adl/adl_v3.cpp @@ -62,8 +62,6 @@ void AdlEngine_v3::setupOpcodeTables() { AdlEngine_v2::setupOpcodeTables(); delete _condOpcodes[0x04]; _condOpcodes[0x04] = new OpcodeV3(this, &AdlEngine_v3::o3_isNounNotInRoom); - delete _actOpcodes[0x04]; - _actOpcodes[0x04] = new OpcodeV3(this, &AdlEngine_v3::o3_listInv); } int AdlEngine_v3::o3_isNounNotInRoom(ScriptEnv &e) { @@ -85,16 +83,4 @@ int AdlEngine_v3::o3_isNounNotInRoom(ScriptEnv &e) { return (isAnItem ? 1 : -1); } -int AdlEngine_v3::o3_listInv(ScriptEnv &e) { - OP_DEBUG_0("\tLIST_INVENTORY()"); - - Common::List<Item>::const_iterator item; - - for (item = _state.items.begin(); item != _state.items.end(); ++item) - if (item->room == IDI_ANY) - printString(_itemDesc[item->description - 1]); - - return 0; -} - } // End of namespace Adl diff --git a/engines/adl/adl_v3.h b/engines/adl/adl_v3.h index b0d40f3993..ab56d4e7d2 100644 --- a/engines/adl/adl_v3.h +++ b/engines/adl/adl_v3.h @@ -41,7 +41,6 @@ protected: void loadItemDescriptions(Common::SeekableReadStream &stream, byte count); int o3_isNounNotInRoom(ScriptEnv &e); - int o3_listInv(ScriptEnv &e); Common::Array<Common::String> _itemDesc; }; diff --git a/engines/adl/adl_v5.cpp b/engines/adl/adl_v5.cpp index cb416e1828..7e7c6e40ac 100644 --- a/engines/adl/adl_v5.cpp +++ b/engines/adl/adl_v5.cpp @@ -94,7 +94,7 @@ void AdlEngine_v5::setupOpcodeTables() { Opcode(o1_varSub); Opcode(o1_varSet); // 0x04 - Opcode(o5_listInv); + Opcode(o1_listInv); Opcode(o5_moveItem); Opcode(o1_setRoom); Opcode(o2_setCurPic); @@ -183,18 +183,6 @@ int AdlEngine_v5::o5_isNounNotInRoom(ScriptEnv &e) { return 1; } -int AdlEngine_v5::o5_listInv(ScriptEnv &e) { - OP_DEBUG_0("\tLIST_INVENTORY()"); - - Common::List<Item>::const_iterator item; - - for (item = _state.items.begin(); item != _state.items.end(); ++item) - if (item->room == IDI_ANY) - printString(_itemDesc[item->id - 1]); - - return 0; -} - int AdlEngine_v5::o5_moveItem(ScriptEnv &e) { OP_DEBUG_2("\tSET_ITEM_ROOM(%s, %s)", itemStr(e.arg(1)).c_str(), itemRoomStr(e.arg(2)).c_str()); diff --git a/engines/adl/adl_v5.h b/engines/adl/adl_v5.h index 5e5e86d47b..377fe45e20 100644 --- a/engines/adl/adl_v5.h +++ b/engines/adl/adl_v5.h @@ -58,7 +58,6 @@ protected: int o5_isItemInRoom(ScriptEnv &e); int o5_isNounNotInRoom(ScriptEnv &e); int o5_skipOneCommand(ScriptEnv &e); - int o5_listInv(ScriptEnv &e); int o5_moveItem(ScriptEnv &e); int o5_dummy(ScriptEnv &e); int o5_setTextMode(ScriptEnv &e); |