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

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


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

Log Message:
-----------
MOHAWK: Fix disabling inventory features in CSTime.

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

Modified: scummvm/trunk/engines/mohawk/cstime_game.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/cstime_game.cpp	2011-01-21 19:45:08 UTC (rev 55387)
+++ scummvm/trunk/engines/mohawk/cstime_game.cpp	2011-01-21 19:45:33 UTC (rev 55388)
@@ -704,6 +704,7 @@
 	invObj->hotspotId = invObjStream->readUint16BE();
 	invObj->featureId = invObjStream->readUint16BE();
 	invObj->canTake = invObjStream->readUint16BE();
+	invObj->featureDisabled = false;
 	debug(" invobj '%s', hotspot id %d, feature id %d, can take %d", _rolloverText[invObj->stringId].c_str(), invObj->hotspotId, invObj->featureId, invObj->canTake);
 	uint16 numConsumableLocations = invObjStream->readUint16BE();
 	debug(" Loading %d consumable locations...", numConsumableLocations);
@@ -970,6 +971,7 @@
 					// FIXME: 0x2000 is set! help?
 					uint32 flags = kFeatureNewNoLoop | 0x2000;
 					invObj->feature = _vm->getView()->installViewFeature(id, flags, &grabPoint);
+					invObj->featureDisabled = false;
 					_vm->getInterface()->startDragging(hotspot.invObjId);
 				}
 			}

Modified: scummvm/trunk/engines/mohawk/cstime_game.h
===================================================================
--- scummvm/trunk/engines/mohawk/cstime_game.h	2011-01-21 19:45:08 UTC (rev 55387)
+++ scummvm/trunk/engines/mohawk/cstime_game.h	2011-01-21 19:45:33 UTC (rev 55388)
@@ -123,6 +123,7 @@
 struct CSTimeInventoryObject {
 	uint16 id, stringId, hotspotId, featureId, canTake;
 	Feature *feature;
+	bool featureDisabled;
 	Common::Array<CSTimeLocation> locations;
 	Common::Array<CSTimeInventoryHotspot> hotspots;
 	Common::Array<CSTimeEvent> events;

Modified: scummvm/trunk/engines/mohawk/cstime_ui.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/cstime_ui.cpp	2011-01-21 19:45:08 UTC (rev 55387)
+++ scummvm/trunk/engines/mohawk/cstime_ui.cpp	2011-01-21 19:45:33 UTC (rev 55388)
@@ -704,21 +704,22 @@
 			_vm->getView()->dragFeature((NewFeature *)invObj->feature, mousePos, 2, 0x800, NULL);
 			// TODO: playSound(151);
 		} else if (_draggedItem != TIME_CUFFS_ID) {
-			_vm->getView()->dragFeature((NewFeature *)invObj->feature, mousePos, 2, 0x800, NULL);
+			_vm->getView()->dragFeature((NewFeature *)invObj->feature, mousePos, 2, 0x600, NULL);
 			_vm->_haveInvItem[_draggedItem] = 0;
-			// FIXME: the original sets the feature to -2 here, see comment below
 			invObj->feature = NULL;
+			invObj->featureDisabled = true;
 			_inventoryDisplay->removeItem(_draggedItem);
 		} else if (!_inventoryDisplay->getCuffsState()) {
 			// Inactive cuffs.
+			// TODO: We never actually get here? Which would explain why it makes no sense.
 			_vm->getView()->dragFeature((NewFeature *)invObj->feature, mousePos, 2, 0x800, NULL);
 			invObj->feature = NULL;
 		} else {
 			// Active cuffs.
 			_vm->getView()->dragFeature((NewFeature *)invObj->feature, mousePos, 2, 0x600, NULL);
 			_vm->_haveInvItem[_draggedItem] = 0;
-			// FIXME: the original sets the feature to -2 here, see comment below
 			invObj->feature = NULL;
+			invObj->featureDisabled = true;
 		}
 
 		if (runConsumeEvents) {
@@ -755,9 +756,8 @@
 			CSTimeEvent event;
 			event.param1 = 0xffff;
 			if (consumeObj) {
-				// FIXME: the original sets the feature to -2 here, which is used in the inventory display drawing
-				// so it knows not to draw the object. we should replace that with a flag.
 				invObj->feature = NULL;
+				invObj->featureDisabled = true;
 				event.type = kCSTimeEventDisableHotspot;
 				event.param2 = invObj->hotspotId;
 			} else {
@@ -872,7 +872,8 @@
 			continue;
 		CSTimeInventoryObject *invObj = _vm->getCase()->_inventoryObjs[_displayedItems[i]];
 
-		// FIXME: ignore on -2 feature (see CSTimeInterface::stopDragging)
+		if (invObj->featureDisabled)
+			continue;
 
 		if (invObj->feature) {
 			invObj->feature->resetFeatureScript(1, 0);
@@ -1064,6 +1065,7 @@
 		_vm->getView()->removeFeature(invObj->feature, true);
 	uint32 flags = kFeatureSortStatic | kFeatureNewNoLoop;
 	invObj->feature = _vm->getView()->installViewFeature(100 + _cuffsShape, flags, NULL);
+	invObj->featureDisabled = false;
 }
 
 void CSTimeInventoryDisplay::setCuffsFlashing() {
@@ -1073,6 +1075,7 @@
 		_vm->getView()->removeFeature(invObj->feature, true);
 	uint32 flags = kFeatureSortStatic | 0x2000;
 	invObj->feature = _vm->getView()->installViewFeature(100 + _cuffsShape, flags, NULL);
+	invObj->featureDisabled = false;
 }
 
 CSTimeBook::CSTimeBook(MohawkEngine_CSTime *vm) : _vm(vm) {


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