From 3b3f84c764f8cab8f54b06bbafc607cfb6899fdd Mon Sep 17 00:00:00 2001 From: johndoe123 Date: Fri, 28 Mar 2014 21:53:21 +0100 Subject: ILLUSIONS: Implement inventory - Implement cursor camera tracking - Various bugfixes --- engines/illusions/bbdou/bbdou_inventory.h | 63 +++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) (limited to 'engines/illusions/bbdou/bbdou_inventory.h') diff --git a/engines/illusions/bbdou/bbdou_inventory.h b/engines/illusions/bbdou/bbdou_inventory.h index 31023c063a..a983212114 100644 --- a/engines/illusions/bbdou/bbdou_inventory.h +++ b/engines/illusions/bbdou/bbdou_inventory.h @@ -24,6 +24,7 @@ #define ILLUSIONS_BBDOU_BBDOU_INVENTORY_H #include "illusions/specialcode.h" +#include "common/array.h" #include "common/rect.h" namespace Illusions { @@ -32,6 +33,68 @@ class IllusionsEngine; class BbdouSpecialCode; class Control; +struct InventoryItem { + uint32 _objectId; + uint32 _sequenceId; + bool _assigned; + bool _flag; + int _timesPresent; + int _fieldE; + InventoryItem(uint32 objectId, uint32 sequenceId); +}; + +struct InventorySlot { + uint32 _namedPointId; + uint32 _objectId; + InventoryItem *_inventoryItem; + InventorySlot(uint32 namedPointId); +}; + +class InventoryBag { +public: + InventoryBag(IllusionsEngine *vm, uint32 sceneId); + void registerInventorySlot(uint32 namedPointId); + bool addInventoryItem(InventoryItem *inventoryItem, InventorySlot *inventorySlot); + void removeInventoryItem(InventoryItem *inventoryItem); + void buildItems(); +protected: +public: + typedef Common::Array InventorySlots; + typedef InventorySlots::iterator InventorySlotsIterator; + IllusionsEngine *_vm; + uint32 _sceneId; + InventorySlots _inventorySlots; + bool _isActive; + int _fieldA; +}; + +class BbdouInventory { +public: + BbdouInventory(IllusionsEngine *vm, BbdouSpecialCode *bbdou); + void registerInventoryBag(uint32 sceneId); + void registerInventoryItem(uint32 objectId, uint32 sequenceId); + void registerInventorySlot(uint32 namedPointId); + void addInventoryItem(uint32 objectId); + void removeInventoryItem(uint32 objectId); + void open(); + void close(); + InventoryBag *getInventoryBag(uint32 sceneId); + InventoryItem *getInventoryItem(uint32 objectId); + void refresh(); + void buildItems(InventoryBag *inventoryBag); +protected: + typedef Common::Array InventoryItems; + typedef InventoryItems::iterator InventoryItemsIterator; + IllusionsEngine *_vm; + BbdouSpecialCode *_bbdou; + Common::Array _inventoryBags; + InventoryItems _inventoryItems; + uint32 _activeBagSceneId; + uint32 _activeInventorySceneId; + int _index; + //field_12 dw +}; + } // End of namespace Illusions #endif // ILLUSIONS_BBDOU_BBDOU_INVENTORY_H -- cgit v1.2.3