aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/inventory.cpp
diff options
context:
space:
mode:
authorNicola Mettifogo2007-07-09 19:19:56 +0000
committerNicola Mettifogo2007-07-09 19:19:56 +0000
commit945be6e5f220a92e92cf715c80ee72a108cfe9b6 (patch)
treea02ff212ad28a6702a31db4de8f2b46710773bdf /engines/parallaction/inventory.cpp
parent11b43f877d47965773fa9b0f7127cc22f7000db6 (diff)
downloadscummvm-rg350-945be6e5f220a92e92cf715c80ee72a108cfe9b6.tar.gz
scummvm-rg350-945be6e5f220a92e92cf715c80ee72a108cfe9b6.tar.bz2
scummvm-rg350-945be6e5f220a92e92cf715c80ee72a108cfe9b6.zip
Moved mouse cursor tampering from inventory.cpp to Gfx class, and some cleanup.
svn-id: r27996
Diffstat (limited to 'engines/parallaction/inventory.cpp')
-rw-r--r--engines/parallaction/inventory.cpp33
1 files changed, 6 insertions, 27 deletions
diff --git a/engines/parallaction/inventory.cpp b/engines/parallaction/inventory.cpp
index d45b831a23..b7ff835dcc 100644
--- a/engines/parallaction/inventory.cpp
+++ b/engines/parallaction/inventory.cpp
@@ -42,10 +42,6 @@ namespace Parallaction {
#define INVENTORY_MAX_ITEMS 30
#define INVENTORY_FIRST_ITEM 4 // first four entries are used up by verbs
-#define INVENTORYITEM_PITCH 32
-#define INVENTORYITEM_WIDTH 24
-#define INVENTORYITEM_HEIGHT 24
-
#define INVENTORY_ITEMS_PER_LINE 5
#define INVENTORY_LINES 6
@@ -89,7 +85,6 @@ InventoryItem _inventory[INVENTORY_MAX_ITEMS] = {
{ 0, 0 }
};
-void drawInventoryItem(uint16 pos, InventoryItem *item);
int16 getNumUsedSlots() {
int16 num = 0;
@@ -224,30 +219,14 @@ void highlightInventoryItem(int16 pos, byte color) {
}
+int16 getInventoryItemIndex(int16 pos) {
+ // TODO: should assert against the number of items actually contained,
+ // not the theoretical limit.
+ assert(pos >= 0 && pos < INVENTORY_MAX_ITEMS);
+ return _inventory[pos]._index;
+}
-void extractInventoryGraphics(int16 pos, byte *dst) {
-// printf("extractInventoryGraphics(%i)\n", pos);
-
- // NOTE: this refresh is needed because we are reading graphics data from the
- // inventory buffer instead than from the inventory icons storage.
- refreshInventory();
-
- int16 line = pos / INVENTORY_ITEMS_PER_LINE;
- int16 col = pos % INVENTORY_ITEMS_PER_LINE;
-
- // FIXME: this will end up in a general blit function
- byte* d = dst;
- byte* s = _buffer + col * INVENTORYITEM_WIDTH + line * _vm->_char._objs->_height * INVENTORY_WIDTH;
- for (uint32 i = 0; i < INVENTORYITEM_HEIGHT; i++) {
- memcpy(d, s, INVENTORYITEM_WIDTH);
-
- s += INVENTORY_WIDTH;
- d += INVENTORYITEM_PITCH;
- }
-
- return;
-}
void jobShowInventory(void *parm, Job *j) {
// printf("job_showInventory()...");