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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Mar 16 14:39:41 CET 2008


Revision: 31140
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31140&view=rev
Author:   lordhoto
Date:     2008-03-16 06:39:40 -0700 (Sun, 16 Mar 2008)

Log Message:
-----------
Implemented opcode 30: o2_addItemToCurScene

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra_v2.cpp
    scummvm/trunk/engines/kyra/kyra_v2.h
    scummvm/trunk/engines/kyra/script_v2.cpp

Modified: scummvm/trunk/engines/kyra/kyra_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.cpp	2008-03-16 13:31:18 UTC (rev 31139)
+++ scummvm/trunk/engines/kyra/kyra_v2.cpp	2008-03-16 13:39:40 UTC (rev 31140)
@@ -2117,8 +2117,8 @@
 		// 0x1c
 		OpcodeUnImpl(),
 		OpcodeUnImpl(),
+		Opcode(o2_addItemToCurScene),
 		OpcodeUnImpl(),
-		OpcodeUnImpl(),
 		// 0x20
 		Opcode(o2_checkForItem),
 		OpcodeUnImpl(),

Modified: scummvm/trunk/engines/kyra/kyra_v2.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.h	2008-03-16 13:31:18 UTC (rev 31139)
+++ scummvm/trunk/engines/kyra/kyra_v2.h	2008-03-16 13:39:40 UTC (rev 31140)
@@ -952,6 +952,7 @@
 	int o2_wsaOpen(ScriptState *script);
 	int o2_displayWsaSequentialFrames(ScriptState *script);
 	int o2_displayWsaSequence(ScriptState *script);
+	int o2_addItemToCurScene(ScriptState *script);
 	int o2_checkForItem(ScriptState *script);
 	int o2_defineItem(ScriptState *script);
 	int o2_removeItemFromInventory(ScriptState *script);

Modified: scummvm/trunk/engines/kyra/script_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_v2.cpp	2008-03-16 13:31:18 UTC (rev 31139)
+++ scummvm/trunk/engines/kyra/script_v2.cpp	2008-03-16 13:39:40 UTC (rev 31140)
@@ -311,6 +311,28 @@
 	return 0;
 }
 
+int KyraEngine_v2::o2_addItemToCurScene(ScriptState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "o2_addItemToCurScene(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+	const int16 id = stackPos(0);
+	int x = stackPos(1);
+	int y = stackPos(2);
+
+	int freeItem = findFreeItem();
+	x = MAX(14, x);
+	x = MIN(304, x);
+	y = MAX(14, y);
+	y = MIN(136, y);
+	if (freeItem >= 0) {
+		_itemList[freeItem].id = id;
+		_itemList[freeItem].x = x;
+		_itemList[freeItem].y = y;
+		_itemList[freeItem].sceneId = _mainCharacter.sceneId;
+		addItemToAnimList(freeItem);
+		refreshAnimObjectsIfNeed();
+	}
+	return 0;
+}
+
 int KyraEngine_v2::o2_checkForItem(ScriptState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "o2_checkForItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
 	return findItem(stackPos(0), stackPos(1)) == -1 ? 0 : 1;


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