aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorNicola Mettifogo2009-09-30 07:47:58 +0000
committerNicola Mettifogo2009-09-30 07:47:58 +0000
commiteb5beef6a1f5a76735b35fb17796420ba2e6d080 (patch)
treeec471a2627565c4772b9b4220f60ed5febf7d90f /engines
parente660f31ed896e487dba5783619840cc065cc1bc5 (diff)
downloadscummvm-rg350-eb5beef6a1f5a76735b35fb17796420ba2e6d080.tar.gz
scummvm-rg350-eb5beef6a1f5a76735b35fb17796420ba2e6d080.tar.bz2
scummvm-rg350-eb5beef6a1f5a76735b35fb17796420ba2e6d080.zip
* Added secondary inventories for BRA.
* Added comments where code must be added/updated to support multiple inventories. svn-id: r44476
Diffstat (limited to 'engines')
-rw-r--r--engines/parallaction/exec_br.cpp11
-rw-r--r--engines/parallaction/inventory.cpp11
-rw-r--r--engines/parallaction/parallaction.h3
-rw-r--r--engines/parallaction/parallaction_br.cpp5
4 files changed, 28 insertions, 2 deletions
diff --git a/engines/parallaction/exec_br.cpp b/engines/parallaction/exec_br.cpp
index 9289bac78d..e351a5ab2f 100644
--- a/engines/parallaction/exec_br.cpp
+++ b/engines/parallaction/exec_br.cpp
@@ -274,7 +274,16 @@ DECLARE_COMMAND_OPCODE(swap) {
DECLARE_COMMAND_OPCODE(give) {
- warning("Parallaction_br::cmdOp_give not yet implemented");
+ warning("Parallaction_br::cmdOp_give not yet implemented");
+
+ /* NOTE: the following code is disabled until I deal with _inventory and
+ * _charInventories not being public
+ */
+/* int item = ctxt._cmd->_object;
+ int recipient = ctxt._cmd->_characterId;
+ _vm->_charInventories[recipient]->addItem(item);
+ _vm->_inventory->removeItem(item);
+*/
}
diff --git a/engines/parallaction/inventory.cpp b/engines/parallaction/inventory.cpp
index 5283fe23fb..2b9e63c9fa 100644
--- a/engines/parallaction/inventory.cpp
+++ b/engines/parallaction/inventory.cpp
@@ -356,6 +356,10 @@ void Parallaction_br::initInventory() {
_inventoryRenderer = new InventoryRenderer(this, &_invProps_BR);
assert(_inventoryRenderer);
_inventoryRenderer->bindInventory(_inventory);
+
+ _charInventories[0] = new Inventory(_invProps_BR._maxItems, _verbs_BR);
+ _charInventories[1] = new Inventory(_invProps_BR._maxItems, _verbs_BR);
+ _charInventories[2] = new Inventory(_invProps_BR._maxItems, _verbs_BR);
}
void Parallaction_ns::destroyInventory() {
@@ -370,6 +374,13 @@ void Parallaction_br::destroyInventory() {
delete _inventory;
_inventory = 0;
_inventoryRenderer = 0;
+
+ delete _charInventories[0];
+ delete _charInventories[1];
+ delete _charInventories[2];
+ _charInventories[0] = 0;
+ _charInventories[1] = 0;
+ _charInventories[2] = 0;
}
diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h
index 43d22c2f36..424c24fc37 100644
--- a/engines/parallaction/parallaction.h
+++ b/engines/parallaction/parallaction.h
@@ -547,7 +547,8 @@ private:
LocationParser_br *_locationParser;
ProgramParser_br *_programParser;
SoundMan_br *_soundManI;
- Inventory *_inventory;
+ Inventory *_inventory; // inventory for the current character
+ Inventory *_charInventories[3]; // all the inventories
int32 _counters[32];
Table *_countersNames;
diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp
index 18f0abb909..c2982185ab 100644
--- a/engines/parallaction/parallaction_br.cpp
+++ b/engines/parallaction/parallaction_br.cpp
@@ -455,6 +455,11 @@ void Parallaction_br::changeCharacter(const char *name) {
_char.setName(name);
_char._ani->gfxobj = _gfx->loadCharacterAnim(name);
_char._talk = _disk->loadTalk(name);
+
+ /* TODO: adjust inventories as following
+ * 1) if not on game load, then copy _inventory to the right slot of _charInventories
+ * 2) copy the new inventory from the right slot of _charInventories
+ */
}
_char._ani->_flags |= kFlagsActive;