aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
authorAlyssa Milburn2011-01-21 19:45:33 +0000
committerAlyssa Milburn2011-01-21 19:45:33 +0000
commit13eb46eb9900bef3ed33da38454f2d196104a5c4 (patch)
tree17f5decc22af59ada71f107d52f73aed45ce164e /engines/mohawk
parent0c797cf359c0191ee78f0fbcf391af87059c017c (diff)
downloadscummvm-rg350-13eb46eb9900bef3ed33da38454f2d196104a5c4.tar.gz
scummvm-rg350-13eb46eb9900bef3ed33da38454f2d196104a5c4.tar.bz2
scummvm-rg350-13eb46eb9900bef3ed33da38454f2d196104a5c4.zip
MOHAWK: Fix disabling inventory features in CSTime.
svn-id: r55388
Diffstat (limited to 'engines/mohawk')
-rw-r--r--engines/mohawk/cstime_game.cpp2
-rw-r--r--engines/mohawk/cstime_game.h1
-rw-r--r--engines/mohawk/cstime_ui.cpp15
3 files changed, 12 insertions, 6 deletions
diff --git a/engines/mohawk/cstime_game.cpp b/engines/mohawk/cstime_game.cpp
index 1f359c24f0..addddea3e8 100644
--- a/engines/mohawk/cstime_game.cpp
+++ b/engines/mohawk/cstime_game.cpp
@@ -704,6 +704,7 @@ CSTimeInventoryObject *CSTimeCase::loadInventoryObject(uint id) {
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 @@ void CSTimeScene::mouseMove(Common::Point &pos) {
// 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);
}
}
diff --git a/engines/mohawk/cstime_game.h b/engines/mohawk/cstime_game.h
index d859664d80..d604f120ad 100644
--- a/engines/mohawk/cstime_game.h
+++ b/engines/mohawk/cstime_game.h
@@ -123,6 +123,7 @@ struct CSTimeInventoryHotspot {
struct CSTimeInventoryObject {
uint16 id, stringId, hotspotId, featureId, canTake;
Feature *feature;
+ bool featureDisabled;
Common::Array<CSTimeLocation> locations;
Common::Array<CSTimeInventoryHotspot> hotspots;
Common::Array<CSTimeEvent> events;
diff --git a/engines/mohawk/cstime_ui.cpp b/engines/mohawk/cstime_ui.cpp
index d3985998ce..3004556193 100644
--- a/engines/mohawk/cstime_ui.cpp
+++ b/engines/mohawk/cstime_ui.cpp
@@ -704,21 +704,22 @@ void CSTimeInterface::stopDragging() {
_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 @@ void CSTimeInterface::stopDragging() {
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 @@ void CSTimeInventoryDisplay::draw() {
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 @@ void CSTimeInventoryDisplay::activateCuffs(bool active) {
_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 @@ void CSTimeInventoryDisplay::setCuffsFlashing() {
_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) {