[Scummvm-cvs-logs] SF.net SVN: scummvm: [31705] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Thu Apr 24 23:18:13 CEST 2008


Revision: 31705
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31705&view=rev
Author:   lordhoto
Date:     2008-04-24 14:18:10 -0700 (Thu, 24 Apr 2008)

Log Message:
-----------
Implemented opcode 60: o3_removeItemsFromScene.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra_v3.h
    scummvm/trunk/engines/kyra/script_v3.cpp

Modified: scummvm/trunk/engines/kyra/kyra_v3.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v3.h	2008-04-24 21:11:55 UTC (rev 31704)
+++ scummvm/trunk/engines/kyra/kyra_v3.h	2008-04-24 21:18:10 UTC (rev 31705)
@@ -699,6 +699,7 @@
 	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);

Modified: scummvm/trunk/engines/kyra/script_v3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_v3.cpp	2008-04-24 21:11:55 UTC (rev 31704)
+++ scummvm/trunk/engines/kyra/script_v3.cpp	2008-04-24 21:18:10 UTC (rev 31705)
@@ -329,6 +329,26 @@
 	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,9 +1123,9 @@
 	Opcode(o3_setSceneFilename);
 	OpcodeUnImpl();
 	// 0x3c
+	Opcode(o3_removeItemsFromScene);
 	OpcodeUnImpl();
 	OpcodeUnImpl();
-	OpcodeUnImpl();
 	Opcode(o3_drawSceneShape);
 	// 0x40
 	Opcode(o3_checkInRect);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list