From 945be6e5f220a92e92cf715c80ee72a108cfe9b6 Mon Sep 17 00:00:00 2001 From: Nicola Mettifogo Date: Mon, 9 Jul 2007 19:19:56 +0000 Subject: Moved mouse cursor tampering from inventory.cpp to Gfx class, and some cleanup. svn-id: r27996 --- engines/parallaction/inventory.cpp | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) (limited to 'engines/parallaction/inventory.cpp') 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()..."); -- cgit v1.2.3