aboutsummaryrefslogtreecommitdiff
path: root/engines/illusions
diff options
context:
space:
mode:
authorjohndoe1232015-12-15 13:17:34 +0100
committerEugene Sandulenko2018-07-20 06:43:33 +0000
commitc9b0a8452a3c5ef64da2955ef58412efa32e70c4 (patch)
tree8067eb6b8ec3054c353dd0b4c36feb1225749edb /engines/illusions
parent48011948d60f700676629e157de75475d52c8abc (diff)
downloadscummvm-rg350-c9b0a8452a3c5ef64da2955ef58412efa32e70c4.tar.gz
scummvm-rg350-c9b0a8452a3c5ef64da2955ef58412efa32e70c4.tar.bz2
scummvm-rg350-c9b0a8452a3c5ef64da2955ef58412efa32e70c4.zip
ILLUSIONS: BBDOU: Implement remaining special opcodes 160018, 160028, 16002B
Diffstat (limited to 'engines/illusions')
-rw-r--r--engines/illusions/bbdou/bbdou_inventory.cpp18
-rw-r--r--engines/illusions/bbdou/bbdou_inventory.h2
-rw-r--r--engines/illusions/bbdou/bbdou_specialcode.cpp19
-rw-r--r--engines/illusions/bbdou/bbdou_specialcode.h3
4 files changed, 41 insertions, 1 deletions
diff --git a/engines/illusions/bbdou/bbdou_inventory.cpp b/engines/illusions/bbdou/bbdou_inventory.cpp
index fbe10a5bee..1c4c2c8619 100644
--- a/engines/illusions/bbdou/bbdou_inventory.cpp
+++ b/engines/illusions/bbdou/bbdou_inventory.cpp
@@ -102,6 +102,14 @@ void InventoryBag::buildItems() {
}
}
+void InventoryBag::clear() {
+ for (InventorySlotsIterator it = _inventorySlots.begin();
+ it != _inventorySlots.end(); ++it) {
+ InventorySlot *inventorySlot = *it;
+ inventorySlot->_inventoryItem = 0;
+ }
+}
+
InventorySlot *InventoryBag::getInventorySlot(uint32 objectId) {
for (uint i = 0; i < _inventorySlots.size(); ++i)
if (_inventorySlots[i]->_objectId == objectId)
@@ -270,6 +278,16 @@ void BbdouInventory::buildItems(InventoryBag *inventoryBag) {
}
}
+void BbdouInventory::clear() {
+ for (InventoryItemsIterator it = _inventoryItems.begin(); it != _inventoryItems.end(); ++it) {
+ InventoryItem *inventoryItem = *it;
+ inventoryItem->_assigned = false;
+ inventoryItem->_flag = false;
+ }
+ for (uint i = 0; i < _inventoryBags.size(); ++i)
+ _inventoryBags[i]->clear();
+}
+
void BbdouInventory::cause0x1B0001(TriggerFunction *triggerFunction, uint32 callingThreadId) {
// TODO
debug("cause0x1B0001");
diff --git a/engines/illusions/bbdou/bbdou_inventory.h b/engines/illusions/bbdou/bbdou_inventory.h
index 2a275d41fd..a5b55f407b 100644
--- a/engines/illusions/bbdou/bbdou_inventory.h
+++ b/engines/illusions/bbdou/bbdou_inventory.h
@@ -59,6 +59,7 @@ public:
void removeInventoryItem(InventoryItem *inventoryItem);
bool hasInventoryItem(uint32 objectId);
void buildItems();
+ void clear();
InventorySlot *getInventorySlot(uint32 objectId);
InventorySlot *findClosestSlot(Common::Point putPos, int index);
protected:
@@ -87,6 +88,7 @@ public:
InventoryItem *getInventoryItem(uint32 objectId);
void refresh();
void buildItems(InventoryBag *inventoryBag);
+ void clear();
void cause0x1B0001(TriggerFunction *triggerFunction, uint32 callingThreadId);
void cause0x1B0002(TriggerFunction *triggerFunction, uint32 callingThreadId);
void putBackInventoryItem(uint32 objectId, Common::Point cursorPosition);
diff --git a/engines/illusions/bbdou/bbdou_specialcode.cpp b/engines/illusions/bbdou/bbdou_specialcode.cpp
index 8839e2f8dd..727be8eab3 100644
--- a/engines/illusions/bbdou/bbdou_specialcode.cpp
+++ b/engines/illusions/bbdou/bbdou_specialcode.cpp
@@ -27,6 +27,7 @@
#include "illusions/bbdou/bbdou_credits.h"
#include "illusions/bbdou/bbdou_cursor.h"
#include "illusions/bbdou/bbdou_foodctl.h"
+#include "illusions/resources/scriptresource.h"
#include "illusions/actor.h"
#include "illusions/camera.h"
#include "illusions/dictionary.h"
@@ -127,7 +128,6 @@ typedef Common::Functor1Mem<OpCall&, void, BbdouSpecialCode> SpecialCodeFunction
#define SPECIAL(id, func) _map[id] = new SpecialCodeFunctionI(this, &BbdouSpecialCode::func);
void BbdouSpecialCode::init() {
- // TODO
// 0x00160001 only used for original debugging purposes
SPECIAL(0x00160006, spcInitCursor);
SPECIAL(0x00160008, spcEnableCursor);
@@ -140,6 +140,7 @@ void BbdouSpecialCode::init() {
SPECIAL(0x00160014, spcSetupBubble);
SPECIAL(0x00160015, spcSetObjectInteractMode);
SPECIAL(0x00160017, spcInitInventory);
+ SPECIAL(0x00160018, spcClearInventory);
SPECIAL(0x00160019, spcRegisterInventoryBag);
SPECIAL(0x0016001A, spcRegisterInventorySlot);
SPECIAL(0x0016001B, spcRegisterInventoryItem);
@@ -149,6 +150,8 @@ void BbdouSpecialCode::init() {
SPECIAL(0x0016001F, spcHasInventoryItem);
SPECIAL(0x00160025, spcCloseInventory);
SPECIAL(0x00160027, spcInitConversation);
+ SPECIAL(0x00160028, spcClearConversation);
+ SPECIAL(0x0016002B, spcClearBlockCounter);
SPECIAL(0x00160030, spcResetCursor);
SPECIAL(0x00160032, spcSetCursorField90);
SPECIAL(0x00160034, spcFoodCtl);
@@ -258,6 +261,10 @@ void BbdouSpecialCode::spcInitInventory(OpCall &opCall) {
// inventory is initialized in this class' constructor
}
+void BbdouSpecialCode::spcClearInventory(OpCall &opCall) {
+ _inventory->clear();
+}
+
void BbdouSpecialCode::spcRegisterInventoryBag(OpCall &opCall) {
ARG_UINT32(sceneId);
_inventory->registerInventoryBag(sceneId);
@@ -301,6 +308,16 @@ void BbdouSpecialCode::spcInitConversation(OpCall &opCall) {
// Conversations seem unused but this is still called
}
+void BbdouSpecialCode::spcClearConversation(OpCall &opCall) {
+ // Conversations seem unused but this is still called
+}
+
+void BbdouSpecialCode::spcClearBlockCounter(OpCall &opCall) {
+ // Conversations seem unused but this is still called
+ ARG_UINT32(index);
+ _vm->_scriptResource->_blockCounters.set(index, 0);
+}
+
void BbdouSpecialCode::spcResetCursor(OpCall &opCall) {
ARG_UINT32(objectId);
_cursor->reset(objectId);
diff --git a/engines/illusions/bbdou/bbdou_specialcode.h b/engines/illusions/bbdou/bbdou_specialcode.h
index f48330784e..40ed53d749 100644
--- a/engines/illusions/bbdou/bbdou_specialcode.h
+++ b/engines/illusions/bbdou/bbdou_specialcode.h
@@ -128,6 +128,7 @@ public:
void spcSetupBubble(OpCall &opCall);
void spcSetObjectInteractMode(OpCall &opCall);
void spcInitInventory(OpCall &opCall);
+ void spcClearInventory(OpCall &opCall);
void spcRegisterInventoryBag(OpCall &opCall);
void spcRegisterInventorySlot(OpCall &opCall);
void spcRegisterInventoryItem(OpCall &opCall);
@@ -137,6 +138,8 @@ public:
void spcHasInventoryItem(OpCall &opCall);
void spcCloseInventory(OpCall &opCall);
void spcInitConversation(OpCall &opCall);
+ void spcClearConversation(OpCall &opCall);
+ void spcClearBlockCounter(OpCall &opCall);
void spcResetCursor(OpCall &opCall);
void spcSetCursorField90(OpCall &opCall);
void spcFoodCtl(OpCall &opCall);