diff options
Diffstat (limited to 'engines/dm/objectman.cpp')
-rw-r--r-- | engines/dm/objectman.cpp | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/engines/dm/objectman.cpp b/engines/dm/objectman.cpp index f75b116427..4099b33b77 100644 --- a/engines/dm/objectman.cpp +++ b/engines/dm/objectman.cpp @@ -28,58 +28,8 @@ #include "objectman.h" #include "dungeonman.h" - namespace DM { -SlotBox gSlotBoxes[46] = { -/* 8 for champion hands in status boxes, 30 for champion inventory, 8 for chest */ - SlotBox(4, 10, 0), /* Champion Status Box 0 Ready Hand */ - SlotBox(24, 10, 0), /* Champion Status Box 0 Action Hand */ - SlotBox(73, 10, 0), /* Champion Status Box 1 Ready Hand */ - SlotBox(93, 10, 0), /* Champion Status Box 1 Action Hand */ - SlotBox(142, 10, 0), /* Champion Status Box 2 Ready Hand */ - SlotBox(162, 10, 0), /* Champion Status Box 2 Action Hand */ - SlotBox(211, 10, 0), /* Champion Status Box 3 Ready Hand */ - SlotBox(231, 10, 0), /* Champion Status Box 3 Action Hand */ - SlotBox(6, 53, 0), /* Ready Hand */ - SlotBox(62, 53, 0), /* Action Hand */ - SlotBox(34, 26, 0), /* Head */ - SlotBox(34, 46, 0), /* Torso */ - SlotBox(34, 66, 0), /* Legs */ - SlotBox(34, 86, 0), /* Feet */ - SlotBox(6, 90, 0), /* Pouch 2 */ - SlotBox(79, 73, 0), /* Quiver Line2 1 */ - SlotBox(62, 90, 0), /* Quiver Line1 2 */ - SlotBox(79, 90, 0), /* Quiver Line2 2 */ - SlotBox(6, 33, 0), /* Neck */ - SlotBox(6, 73, 0), /* Pouch 1 */ - SlotBox(62, 73, 0), /* Quiver Line1 1 */ - SlotBox(66, 33, 0), /* Backpack Line1 1 */ - SlotBox(83, 16, 0), /* Backpack Line2 2 */ - SlotBox(100, 16, 0), /* Backpack Line2 3 */ - SlotBox(117, 16, 0), /* Backpack Line2 4 */ - SlotBox(134, 16, 0), /* Backpack Line2 5 */ - SlotBox(151, 16, 0), /* Backpack Line2 6 */ - SlotBox(168, 16, 0), /* Backpack Line2 7 */ - SlotBox(185, 16, 0), /* Backpack Line2 8 */ - SlotBox(202, 16, 0), /* Backpack Line2 9 */ - SlotBox(83, 33, 0), /* Backpack Line1 2 */ - SlotBox(100, 33, 0), /* Backpack Line1 3 */ - SlotBox(117, 33, 0), /* Backpack Line1 4 */ - SlotBox(134, 33, 0), /* Backpack Line1 5 */ - SlotBox(151, 33, 0), /* Backpack Line1 6 */ - SlotBox(168, 33, 0), /* Backpack Line1 7 */ - SlotBox(185, 33, 0), /* Backpack Line1 8 */ - SlotBox(202, 33, 0), /* Backpack Line1 9 */ - SlotBox(117, 59, 0), /* Chest 1 */ - SlotBox(106, 76, 0), /* Chest 2 */ - SlotBox(111, 93, 0), /* Chest 3 */ - SlotBox(128, 98, 0), /* Chest 4 */ - SlotBox(145, 101, 0), /* Chest 5 */ - SlotBox(162, 103, 0), /* Chest 6 */ - SlotBox(179, 104, 0), /* Chest 7 */ - SlotBox(196, 105, 0)}; /* Chest 8 */ - int16 gIconGraphicHeight[7] = {32, 32, 32, 32, 32, 32, 32}; // @ K0077_ai_IconGraphicHeight int16 gIconGraphicFirstIndex[7] = { // G0026_ai_Graphic562_IconGraphicFirstIconIndex @@ -91,7 +41,55 @@ int16 gIconGraphicFirstIndex[7] = { // G0026_ai_Graphic562_IconGraphicFirstIconI 160, /* First icon index in graphic #47 */ 192}; /* First icon index in graphic #48 */ -ObjectMan::ObjectMan(DMEngine *vm) : _vm(vm) {} +ObjectMan::ObjectMan(DMEngine *vm) : _vm(vm) { + /* 8 for champion hands in status boxes, 30 for champion inventory, 8 for chest */ + _slotBoxes[0] = SlotBox(4, 10, 0); /* Champion Status Box 0 Ready Hand */ + _slotBoxes[1] = SlotBox(24, 10, 0); /* Champion Status Box 0 Action Hand */ + _slotBoxes[2] = SlotBox(73, 10, 0); /* Champion Status Box 1 Ready Hand */ + _slotBoxes[3] = SlotBox(93, 10, 0); /* Champion Status Box 1 Action Hand */ + _slotBoxes[4] = SlotBox(142, 10, 0); /* Champion Status Box 2 Ready Hand */ + _slotBoxes[5] = SlotBox(162, 10, 0); /* Champion Status Box 2 Action Hand */ + _slotBoxes[6] = SlotBox(211, 10, 0); /* Champion Status Box 3 Ready Hand */ + _slotBoxes[7] = SlotBox(231, 10, 0); /* Champion Status Box 3 Action Hand */ + _slotBoxes[8] = SlotBox(6, 53, 0); /* Ready Hand */ + _slotBoxes[9] = SlotBox(62, 53, 0); /* Action Hand */ + _slotBoxes[10] = SlotBox(34, 26, 0); /* Head */ + _slotBoxes[11] = SlotBox(34, 46, 0); /* Torso */ + _slotBoxes[12] = SlotBox(34, 66, 0); /* Legs */ + _slotBoxes[13] = SlotBox(34, 86, 0); /* Feet */ + _slotBoxes[14] = SlotBox(6, 90, 0); /* Pouch 2 */ + _slotBoxes[15] = SlotBox(79, 73, 0); /* Quiver Line2 1 */ + _slotBoxes[16] = SlotBox(62, 90, 0); /* Quiver Line1 2 */ + _slotBoxes[17] = SlotBox(79, 90, 0); /* Quiver Line2 2 */ + _slotBoxes[18] = SlotBox(6, 33, 0); /* Neck */ + _slotBoxes[19] = SlotBox(6, 73, 0); /* Pouch 1 */ + _slotBoxes[20] = SlotBox(62, 73, 0); /* Quiver Line1 1 */ + _slotBoxes[21] = SlotBox(66, 33, 0); /* Backpack Line1 1 */ + _slotBoxes[22] = SlotBox(83, 16, 0); /* Backpack Line2 2 */ + _slotBoxes[23] = SlotBox(100, 16, 0); /* Backpack Line2 3 */ + _slotBoxes[24] = SlotBox(117, 16, 0); /* Backpack Line2 4 */ + _slotBoxes[25] = SlotBox(134, 16, 0); /* Backpack Line2 5 */ + _slotBoxes[26] = SlotBox(151, 16, 0); /* Backpack Line2 6 */ + _slotBoxes[27] = SlotBox(168, 16, 0); /* Backpack Line2 7 */ + _slotBoxes[28] = SlotBox(185, 16, 0); /* Backpack Line2 8 */ + _slotBoxes[29] = SlotBox(202, 16, 0); /* Backpack Line2 9 */ + _slotBoxes[30] = SlotBox(83, 33, 0); /* Backpack Line1 2 */ + _slotBoxes[31] = SlotBox(100, 33, 0); /* Backpack Line1 3 */ + _slotBoxes[32] = SlotBox(117, 33, 0); /* Backpack Line1 4 */ + _slotBoxes[33] = SlotBox(134, 33, 0); /* Backpack Line1 5 */ + _slotBoxes[34] = SlotBox(151, 33, 0); /* Backpack Line1 6 */ + _slotBoxes[35] = SlotBox(168, 33, 0); /* Backpack Line1 7 */ + _slotBoxes[36] = SlotBox(185, 33, 0); /* Backpack Line1 8 */ + _slotBoxes[37] = SlotBox(202, 33, 0); /* Backpack Line1 9 */ + _slotBoxes[38] = SlotBox(117, 59, 0); /* Chest 1 */ + _slotBoxes[39] = SlotBox(106, 76, 0); /* Chest 2 */ + _slotBoxes[40] = SlotBox(111, 93, 0); /* Chest 3 */ + _slotBoxes[41] = SlotBox(128, 98, 0); /* Chest 4 */ + _slotBoxes[42] = SlotBox(145, 101, 0); /* Chest 5 */ + _slotBoxes[43] = SlotBox(162, 103, 0); /* Chest 6 */ + _slotBoxes[44] = SlotBox(179, 104, 0); /* Chest 7 */ + _slotBoxes[45] = SlotBox(196, 105, 0); /* Chest 8 */ +} IconIndice ObjectMan::getObjectType(Thing thing) { if (thing == Thing::_thingNone) @@ -156,23 +154,25 @@ IconIndice ObjectMan::getIconIndex(Thing thing) { void ObjectMan::extractIconFromBitmap(uint16 iconIndex, byte *destBitmap) { int16 i; - for (i = 0; i < 7; ++i) + for (i = 0; i < 7; ++i) { if (gIconGraphicFirstIndex[i] > iconIndex) break; + } + --i; byte *srcBitmap = _vm->_displayMan->getBitmap(kObjectIcons_000_TO_031 + i); iconIndex -= gIconGraphicFirstIndex[i]; _vm->_displayMan->_useByteBoxCoordinates = true; _vm->_displayMan->blitToBitmap(srcBitmap, 256, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0, destBitmap, 16, 0, 16, 0, 16, kColorNoTransparency); - } void ObjectMan::drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex) { - SlotBox *slotBox = &gSlotBoxes[slotBoxIndex]; + SlotBox *slotBox = &_slotBoxes[slotBoxIndex]; slotBox->_iconIndex = iconIndex; // yes, this modifies the global array if (slotBox->_iconIndex == kIconIndiceNone) { return; } + Box box; box._x1 = slotBox->_x; box._y1 = slotBox->_y; |