[Scummvm-cvs-logs] SF.net SVN: scummvm:[44476] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Wed Sep 30 09:47:59 CEST 2009


Revision: 44476
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44476&view=rev
Author:   peres001
Date:     2009-09-30 07:47:58 +0000 (Wed, 30 Sep 2009)

Log Message:
-----------
* Added secondary inventories for BRA.
* Added comments where code must be added/updated to support multiple inventories.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/exec_br.cpp
    scummvm/trunk/engines/parallaction/inventory.cpp
    scummvm/trunk/engines/parallaction/parallaction.h
    scummvm/trunk/engines/parallaction/parallaction_br.cpp

Modified: scummvm/trunk/engines/parallaction/exec_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/exec_br.cpp	2009-09-30 07:09:07 UTC (rev 44475)
+++ scummvm/trunk/engines/parallaction/exec_br.cpp	2009-09-30 07:47:58 UTC (rev 44476)
@@ -274,7 +274,16 @@
 
 
 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);
+*/
 }
 
 

Modified: scummvm/trunk/engines/parallaction/inventory.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/inventory.cpp	2009-09-30 07:09:07 UTC (rev 44475)
+++ scummvm/trunk/engines/parallaction/inventory.cpp	2009-09-30 07:47:58 UTC (rev 44476)
@@ -356,6 +356,10 @@
 	_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 @@
 	delete _inventory;
 	_inventory = 0;
 	_inventoryRenderer = 0;
+
+	delete _charInventories[0];
+	delete _charInventories[1];
+	delete _charInventories[2];
+	_charInventories[0] = 0;
+	_charInventories[1] = 0;
+	_charInventories[2] = 0;
 }
 
 

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2009-09-30 07:09:07 UTC (rev 44475)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2009-09-30 07:47:58 UTC (rev 44476)
@@ -547,7 +547,8 @@
 	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;

Modified: scummvm/trunk/engines/parallaction/parallaction_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_br.cpp	2009-09-30 07:09:07 UTC (rev 44475)
+++ scummvm/trunk/engines/parallaction/parallaction_br.cpp	2009-09-30 07:47:58 UTC (rev 44476)
@@ -455,6 +455,11 @@
 		_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;


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