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

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Fri Jun 5 23:34:18 CEST 2009


Revision: 41199
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41199&view=rev
Author:   athrxx
Date:     2009-06-05 21:34:18 +0000 (Fri, 05 Jun 2009)

Log Message:
-----------
LOL: implemented another opcode

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/lol.h
    scummvm/trunk/engines/kyra/script_lol.cpp

Modified: scummvm/trunk/engines/kyra/lol.h
===================================================================
--- scummvm/trunk/engines/kyra/lol.h	2009-06-05 19:04:14 UTC (rev 41198)
+++ scummvm/trunk/engines/kyra/lol.h	2009-06-05 21:34:18 UTC (rev 41199)
@@ -771,6 +771,7 @@
 	int olol_getNextActiveCharacter(EMCState *script);
 	int olol_paralyzePoisonCharacter(EMCState *script);
 	int olol_drawCharPortrait(EMCState *script);
+	int olol_removeInventoryItem(EMCState *script);	
 	int olol_getAnimationLastPart(EMCState *script);
 	int olol_assignSpecialGuiShape(EMCState *script);
 	int olol_findInventoryItem(EMCState *script);

Modified: scummvm/trunk/engines/kyra/script_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_lol.cpp	2009-06-05 19:04:14 UTC (rev 41198)
+++ scummvm/trunk/engines/kyra/script_lol.cpp	2009-06-05 21:34:18 UTC (rev 41199)
@@ -1896,6 +1896,31 @@
 	return 1;
 }
 
+int LoLEngine::olol_removeInventoryItem(EMCState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_removeInventoryItem(%p) (%d)", (const void *)script, stackPos(0));
+	int itemType = stackPos(0);
+	for (int i = 0; i < 48; i++) {
+		if (!_inventory[i] || _itemsInPlay[_inventory[i]].itemPropertyIndex != itemType)
+			continue;
+		_inventory[i] = 0;
+		gui_drawInventory();
+		return 1;
+	}
+
+	for (int i = 0; i < 4; i++) {
+		if (!(_characters[i].flags & 1))
+			continue;
+
+		for (int ii = 0; ii < 11; ii++) {
+			if (!_characters[i].items[ii] || _itemsInPlay[_characters[i].items[ii]].itemPropertyIndex != itemType)
+				continue;
+			_characters[i].items[ii] = 0;
+			return 1;
+		}
+	}
+	return 0;
+}
+
 int LoLEngine::olol_getAnimationLastPart(EMCState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_getAnimationLastPart(%p) (%d)", (const void *)script, stackPos(0));
 	return _tim->resetAnimationLastPart(stackPos(0));
@@ -2730,9 +2755,9 @@
 	Opcode(olol_drawCharPortrait);
 
 	// 0xA0
+	Opcode(olol_removeInventoryItem);
 	OpcodeUnImpl();
 	OpcodeUnImpl();
-	OpcodeUnImpl();
 	Opcode(olol_getAnimationLastPart);
 
 	// 0xA4


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