diff options
author | Johannes Schickel | 2008-04-24 21:18:10 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-04-24 21:18:10 +0000 |
commit | f0cbfff93e2beb98bd50d86524de1c9f8c0de9bf (patch) | |
tree | e8a8652a04e5dc4ce4d19ca333e9be305d1f78a3 | |
parent | 1c660c452436fbcf2e5d06f1e10cc7c236ee11b5 (diff) | |
download | scummvm-rg350-f0cbfff93e2beb98bd50d86524de1c9f8c0de9bf.tar.gz scummvm-rg350-f0cbfff93e2beb98bd50d86524de1c9f8c0de9bf.tar.bz2 scummvm-rg350-f0cbfff93e2beb98bd50d86524de1c9f8c0de9bf.zip |
Implemented opcode 60: o3_removeItemsFromScene.
svn-id: r31705
-rw-r--r-- | engines/kyra/kyra_v3.h | 1 | ||||
-rw-r--r-- | engines/kyra/script_v3.cpp | 22 |
2 files changed, 22 insertions, 1 deletions
diff --git a/engines/kyra/kyra_v3.h b/engines/kyra/kyra_v3.h index 2762b80e2b..7279b52c5e 100644 --- a/engines/kyra/kyra_v3.h +++ b/engines/kyra/kyra_v3.h @@ -699,6 +699,7 @@ private: int o3_delay(ScriptState *script); int o3_updateScore(ScriptState *script); int o3_setSceneFilename(ScriptState *script); + int o3_removeItemsFromScene(ScriptState *script); int o3_drawSceneShape(ScriptState *script); int o3_checkInRect(ScriptState *script); int o3_updateConversations(ScriptState *script); diff --git a/engines/kyra/script_v3.cpp b/engines/kyra/script_v3.cpp index 172645eaad..cedc182278 100644 --- a/engines/kyra/script_v3.cpp +++ b/engines/kyra/script_v3.cpp @@ -329,6 +329,26 @@ int KyraEngine_v3::o3_setSceneFilename(ScriptState *script) { return 0; } +int KyraEngine_v3::o3_removeItemsFromScene(ScriptState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_removeItemsFromScene(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); + const uint16 itemId = stackPos(0); + const uint16 sceneId = stackPos(1); + const bool allItems = (stackPos(2) != 0); + + int retValue = 0; + + for (int i = 0; i < 50; ++i) { + if (_itemList[i].sceneId == sceneId && _itemList[i].id == itemId) { + resetItem(i); + retValue = 1; + if (!allItems) + return 1; + } + } + + return retValue; +} + int KyraEngine_v3::o3_drawSceneShape(ScriptState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_drawSceneShape(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); const int shape = stackPos(0); @@ -1103,7 +1123,7 @@ void KyraEngine_v3::setupOpcodeTable() { Opcode(o3_setSceneFilename); OpcodeUnImpl(); // 0x3c - OpcodeUnImpl(); + Opcode(o3_removeItemsFromScene); OpcodeUnImpl(); OpcodeUnImpl(); Opcode(o3_drawSceneShape); |