diff options
author | johndoe123 | 2014-04-01 16:56:58 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2018-07-20 06:43:33 +0000 |
commit | 7dc8533f730645e7177bbdc4d214664d82856963 (patch) | |
tree | 1d835855d8946c5fc16a397599650ee2e80fb354 /engines/illusions/bbdou | |
parent | d67021b32cf96388291135b19060d6dba8b7fbd4 (diff) | |
download | scummvm-rg350-7dc8533f730645e7177bbdc4d214664d82856963.tar.gz scummvm-rg350-7dc8533f730645e7177bbdc4d214664d82856963.tar.bz2 scummvm-rg350-7dc8533f730645e7177bbdc4d214664d82856963.zip |
ILLUSIONS: Fix thread camera panning
- Minor fixes and corrections
Diffstat (limited to 'engines/illusions/bbdou')
-rw-r--r-- | engines/illusions/bbdou/bbdou_cursor.cpp | 2 | ||||
-rw-r--r-- | engines/illusions/bbdou/bbdou_inventory.cpp | 14 | ||||
-rw-r--r-- | engines/illusions/bbdou/bbdou_inventory.h | 1 | ||||
-rw-r--r-- | engines/illusions/bbdou/bbdou_specialcode.cpp | 8 | ||||
-rw-r--r-- | engines/illusions/bbdou/bbdou_specialcode.h | 1 |
5 files changed, 21 insertions, 5 deletions
diff --git a/engines/illusions/bbdou/bbdou_cursor.cpp b/engines/illusions/bbdou/bbdou_cursor.cpp index ec877556db..4aca265f6d 100644 --- a/engines/illusions/bbdou/bbdou_cursor.cpp +++ b/engines/illusions/bbdou/bbdou_cursor.cpp @@ -351,7 +351,7 @@ void BbdouCursor::hide(uint32 objectId) { if (_data._visibleCtr == 0) { Control *control = _vm->_dict->getObjectControl(objectId); control->startSequenceActor(0x60029, 2, 0); - // TODO item10_sub_10005040(objectId, &cursorData->item10); + _bbdou->resetItem10(objectId, &_data._item10); _vm->_camera->popCameraMode(); } _vm->_input->discardButtons(0xFFFF); diff --git a/engines/illusions/bbdou/bbdou_inventory.cpp b/engines/illusions/bbdou/bbdou_inventory.cpp index 5502616337..26265a706d 100644 --- a/engines/illusions/bbdou/bbdou_inventory.cpp +++ b/engines/illusions/bbdou/bbdou_inventory.cpp @@ -162,6 +162,14 @@ void BbdouInventory::removeInventoryItem(uint32 objectId) { } } +bool BbdouInventory::hasInventoryItem(uint32 objectId) { + for (uint i = 0; i < _inventoryItems.size(); ++i) + if (_inventoryItems[i]->_objectId == objectId && + _inventoryItems[i]->_assigned) + return true; + return false; +} + void BbdouInventory::open() { _activeBagSceneId = 0; InventoryBag *inventoryBag = getInventoryBag(_vm->getCurrentScene()); @@ -203,8 +211,8 @@ void BbdouInventory::close() { Control *control = _vm->_dict->getObjectControl(inventorySlot->_objectId); control->startSequenceActor(0x00060187, 2, 0); } - inventoryBag->_isActive = false; - _activeInventorySceneId = 0; + inventoryBag->_isActive = false; + _activeInventorySceneId = 0; } InventoryBag *BbdouInventory::getInventoryBag(uint32 sceneId) { @@ -245,7 +253,7 @@ void BbdouInventory::buildItems(InventoryBag *inventoryBag) { inventoryBag->buildItems(); for (InventoryItemsIterator it = _inventoryItems.begin(); it != _inventoryItems.end(); ++it) { InventoryItem *inventoryItem = *it; - if (inventoryItem->_assigned && !inventoryItem->_flag && + if (inventoryItem->_assigned && !inventoryItem->_flag && inventoryItem->_timesPresent == 0 && inventoryItem->_objectId != _bbdou->_cursor->_data._holdingObjectId) inventoryBag->addInventoryItem(inventoryItem, 0); diff --git a/engines/illusions/bbdou/bbdou_inventory.h b/engines/illusions/bbdou/bbdou_inventory.h index 3c211e5340..e4ee28fc08 100644 --- a/engines/illusions/bbdou/bbdou_inventory.h +++ b/engines/illusions/bbdou/bbdou_inventory.h @@ -79,6 +79,7 @@ public: void registerInventorySlot(uint32 namedPointId); void addInventoryItem(uint32 objectId); void removeInventoryItem(uint32 objectId); + bool hasInventoryItem(uint32 objectId); void open(); void close(); InventoryBag *getInventoryBag(uint32 sceneId); diff --git a/engines/illusions/bbdou/bbdou_specialcode.cpp b/engines/illusions/bbdou/bbdou_specialcode.cpp index 1547aabf1b..a3a3149e03 100644 --- a/engines/illusions/bbdou/bbdou_specialcode.cpp +++ b/engines/illusions/bbdou/bbdou_specialcode.cpp @@ -103,6 +103,7 @@ void BbdouSpecialCode::init() { SPECIAL(0x0016001C, spcOpenInventory); SPECIAL(0x0016001D, spcAddInventoryItem); SPECIAL(0x0016001E, spcRemoveInventoryItem); + SPECIAL(0x0016001F, spcHasInventoryItem); SPECIAL(0x00160025, spcCloseInventory); } @@ -221,6 +222,11 @@ void BbdouSpecialCode::spcRemoveInventoryItem(OpCall &opCall) { _inventory->removeInventoryItem(objectId); } +void BbdouSpecialCode::spcHasInventoryItem(OpCall &opCall) { + ARG_UINT32(objectId); + _vm->_scriptMan->_stack.push(_inventory->hasInventoryItem(objectId) ? 1 : 0); +} + void BbdouSpecialCode::spcCloseInventory(OpCall &opCall) { _inventory->close(); } @@ -349,7 +355,7 @@ bool BbdouSpecialCode::findVerbId(Item10 *item10, uint32 currOverlappedObjectId, void BbdouSpecialCode::cursorInteractControlRoutine(Control *cursorControl, uint32 deltaTime) { Actor *actor = cursorControl->_actor; CursorData &cursorData = _cursor->_data; - + if (cursorData._visibleCtr > 0) { Common::Point cursorPos = _vm->_input->getCursorPosition(); diff --git a/engines/illusions/bbdou/bbdou_specialcode.h b/engines/illusions/bbdou/bbdou_specialcode.h index d018f3859d..734e8e8755 100644 --- a/engines/illusions/bbdou/bbdou_specialcode.h +++ b/engines/illusions/bbdou/bbdou_specialcode.h @@ -92,6 +92,7 @@ public: void spcOpenInventory(OpCall &opCall); void spcAddInventoryItem(OpCall &opCall); void spcRemoveInventoryItem(OpCall &opCall); + void spcHasInventoryItem(OpCall &opCall); void spcCloseInventory(OpCall &opCall); void playSoundEffect(int soundIndex); |