aboutsummaryrefslogtreecommitdiff
path: root/engines/draci/game.h
diff options
context:
space:
mode:
authorDenis Kasak2009-08-17 18:50:38 +0000
committerDenis Kasak2009-08-17 18:50:38 +0000
commitb0fea939f49c3b0c6287d5a165c5f8ad27b9d794 (patch)
tree9567e9c71a55bf6d0301a7d5c7a2f0a17f128193 /engines/draci/game.h
parente5774d2881fe769e31ead57870b1315c56a4ba21 (diff)
downloadscummvm-rg350-b0fea939f49c3b0c6287d5a165c5f8ad27b9d794.tar.gz
scummvm-rg350-b0fea939f49c3b0c6287d5a165c5f8ad27b9d794.tar.bz2
scummvm-rg350-b0fea939f49c3b0c6287d5a165c5f8ad27b9d794.zip
Added inventory and item handling support (monster patch, sorry). Items were previously called "icons" as in the original player. This commit also renamed every such instance to the proper "item".
svn-id: r43487
Diffstat (limited to 'engines/draci/game.h')
-rw-r--r--engines/draci/game.h49
1 files changed, 38 insertions, 11 deletions
diff --git a/engines/draci/game.h b/engines/draci/game.h
index a95dbe7b52..5cefa5dec1 100644
--- a/engines/draci/game.h
+++ b/engines/draci/game.h
@@ -57,10 +57,10 @@ enum {
kNoEscRoom = -1
};
-// Used as a value to Game::_currentIcon and means there is no icon (game item) selected
+// Used as a value to Game::_currentIcon and means there is no item selected
// and a "real" cursor image is used
enum {
- kNoIcon = -1
+ kNoItem = -1
};
// Used as a default parameter in Game::loadWalkingMap() to specify that the default
@@ -82,6 +82,17 @@ enum SpeechConstants {
kSpeechTimeUnit = 400
};
+/** Inventory related magical constants */
+enum InventoryConstants {
+ kInventoryItemWidth = 25,
+ kInventoryItemHeight = 25,
+ kInventoryColumns = 7,
+ kInventoryLines = 5,
+ kInventoryX = 70, //!< Used for positioning of the inventory sprite on the X axis
+ kInventoryY = 30, //!< Used for positioning of the inventory sprite on the Y axis
+ kInventorySlots = kInventoryLines * kInventoryColumns
+};
+
class WalkingMap {
public:
@@ -140,11 +151,11 @@ struct GameInfo {
int _startRoom;
int _mapRoom;
uint _numObjects;
- uint _numIcons;
+ uint _numItems;
byte _numVariables;
byte _numPersons;
byte _numDialogues;
- uint _maxIconWidth, _maxIconHeight;
+ uint _maxItemWidth, _maxItemHeight;
uint _musicLength;
uint _crc[4];
uint _numDialogueBlocks;
@@ -255,6 +266,7 @@ public:
void loadOverlays();
void loadObject(uint numObj);
void loadWalkingMap(int mapID = kDefaultRoomMap);
+ void loadItem(int itemID);
uint getNumObjects();
GameObject *getObject(uint objNum);
@@ -271,8 +283,13 @@ public:
int getGateNum();
void setGateNum(int gate);
- int getIconStatus(int iconID);
- int getCurrentIcon();
+ int getItemStatus(int itemID);
+ void setItemStatus(int itemID, int status);
+ int getCurrentItem();
+ void setCurrentItem(int itemID);
+ void removeItem(int itemID);
+ void putItem(int itemID, int position);
+ void addItem(int itemID);
int getEscRoom();
@@ -297,6 +314,10 @@ public:
void updateTitle();
void updateCursor();
+ void inventoryInit();
+ void inventoryDraw();
+ void inventoryDone();
+
void dialogueMenu(int dialogueID);
int dialogueDraw();
void dialogueInit(int dialogID);
@@ -312,17 +333,23 @@ private:
GameInfo _info;
int *_variables;
- byte *_iconStatus;
Person *_persons;
GameObject *_objects;
+ byte *_itemStatus;
+ GameItem *_items;
+ int _currentItem;
+ int _itemUnderCursor;
+
+ int _inventory[kInventorySlots];
+ bool _inventoryExit;
+
+
Room _currentRoom;
int _currentGate;
int _newRoom;
int _newGate;
- int _currentIcon;
-
// HACK: remove public when tested and add getters instead
public:
uint *_dialogueOffsets;
@@ -336,8 +363,8 @@ public:
int _lastBlock;
int _dialogueLines;
int _blockNum;
- int _lines[4];
- Animation *_dialogueAnims[4];
+ int _lines[kDialogueLines];
+ Animation *_dialogueAnims[kDialogueLines];
LoopStatus _loopStatus;
LoopSubstatus _loopSubstatus;