[Scummvm-cvs-logs] SF.net SVN: scummvm:[55389] scummvm/trunk/engines/mohawk

fuzzie at users.sourceforge.net fuzzie at users.sourceforge.net
Fri Jan 21 20:45:58 CET 2011


Revision: 55389
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55389&view=rev
Author:   fuzzie
Date:     2011-01-21 19:45:58 +0000 (Fri, 21 Jan 2011)

Log Message:
-----------
MOHAWK: Implement kCSTimeEventRemoveItemFromInventory.

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/cstime.cpp
    scummvm/trunk/engines/mohawk/cstime_ui.cpp
    scummvm/trunk/engines/mohawk/cstime_ui.h

Modified: scummvm/trunk/engines/mohawk/cstime.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/cstime.cpp	2011-01-21 19:45:33 UTC (rev 55388)
+++ scummvm/trunk/engines/mohawk/cstime.cpp	2011-01-21 19:45:58 UTC (rev 55389)
@@ -430,6 +430,13 @@
 		_interface->dropItemInInventory(event.param2);
 		break;
 
+	case kCSTimeEventRemoveItemFromInventory:
+		if (!_interface->getInventoryDisplay()->isItemDisplayed(event.param2))
+			break;
+		_haveInvItem[event.param2] = 0;
+		_interface->getInventoryDisplay()->removeItem(event.param2);
+		break;
+
 	case kCSTimeEventAddNotePiece:
 		_interface->clearTextLine();
 		_interface->getCarmenNote()->addPiece(event.param2, event.param1);

Modified: scummvm/trunk/engines/mohawk/cstime_ui.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/cstime_ui.cpp	2011-01-21 19:45:33 UTC (rev 55388)
+++ scummvm/trunk/engines/mohawk/cstime_ui.cpp	2011-01-21 19:45:58 UTC (rev 55389)
@@ -1078,6 +1078,15 @@
 	invObj->featureDisabled = false;
 }
 
+bool CSTimeInventoryDisplay::isItemDisplayed(uint16 id) {
+	for (uint i = 0; i < MAX_DISPLAYED_ITEMS; i++) {
+		if (_displayedItems[i] == id)
+			return true;
+	}
+
+	return false;
+}
+
 CSTimeBook::CSTimeBook(MohawkEngine_CSTime *vm) : _vm(vm) {
 	_state = 0;
 	_smallBookFeature = NULL;

Modified: scummvm/trunk/engines/mohawk/cstime_ui.h
===================================================================
--- scummvm/trunk/engines/mohawk/cstime_ui.h	2011-01-21 19:45:33 UTC (rev 55388)
+++ scummvm/trunk/engines/mohawk/cstime_ui.h	2011-01-21 19:45:58 UTC (rev 55389)
@@ -83,6 +83,7 @@
 	bool getCuffsState() { return _cuffsState; }
 	uint16 getCuffsShape() { return _cuffsShape; }
 
+	bool isItemDisplayed(uint16 id);
 	uint16 getDisplayedNum(uint id) { return _displayedItems[id]; }
 	uint16 getLastDisplayedClicked() { return getDisplayedNum(_draggedItem); }
 


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