aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/staticres.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/kyra/staticres.cpp')
-rw-r--r--engines/kyra/staticres.cpp76
1 files changed, 46 insertions, 30 deletions
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index 865839b1bf..613d0e1069 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -1424,51 +1424,67 @@ const int8 KyraEngine_v2::_dosTrackMap[] = {
const int KyraEngine_v2::_dosTrackMapSize = ARRAYSIZE(KyraEngine_v2::_dosTrackMap);
-void KyraEngine_v2::initMainButtonList() {
- // note: _buttonDataListPtr
- static Button mainButtons[] = {
- { 0, 0x1, 0x4F, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0, 0x00A, 0x95, 0x39, 0x1D, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, /*&KyraEngine_v2::sub_C9A1*/0 },
- { 0, 0x2, 0x00, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0, 0x104, 0x90, 0x3C, 0x2C, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, &KyraEngine_v2::cauldronButton },
- { 0, 0x5, 0x00, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0, 0x0FA, 0x90, 0x0A, 0x2C, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, &KyraEngine_v2::cauldronClearButton },
- { 0, 0x3, 0x00, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0, 0x0CE, 0x90, 0x2C, 0x2C, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, &KyraEngine_v2::bookButton },
- { 0, 0x4, 0x00, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0, 0x0B6, 0x9D, 0x18, 0x1E, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, &KyraEngine_v2::scrollInventory },
- { 0, 0x6, 0x00, 0, 0, 0, 0, 0x1100, 0, 0, 0, 0, 0x04D, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, &KyraEngine_v2::buttonInventory },
- { 0, 0x7, 0x00, 0, 0, 0, 0, 0x1100, 0, 0, 0, 0, 0x061, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, &KyraEngine_v2::buttonInventory },
- { 0, 0x8, 0x00, 0, 0, 0, 0, 0x1100, 0, 0, 0, 0, 0x075, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, &KyraEngine_v2::buttonInventory },
- { 0, 0x9, 0x00, 0, 0, 0, 0, 0x1100, 0, 0, 0, 0, 0x089, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, &KyraEngine_v2::buttonInventory },
- { 0, 0xA, 0x00, 0, 0, 0, 0, 0x1100, 0, 0, 0, 0, 0x09D, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, &KyraEngine_v2::buttonInventory },
- { 0, 0xB, 0x00, 0, 0, 0, 0, 0x1100, 0, 0, 0, 0, 0x04D, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, &KyraEngine_v2::buttonInventory },
- { 0, 0xC, 0x00, 0, 0, 0, 0, 0x1100, 0, 0, 0, 0, 0x061, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, &KyraEngine_v2::buttonInventory },
- { 0, 0xD, 0x00, 0, 0, 0, 0, 0x1100, 0, 0, 0, 0, 0x075, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, &KyraEngine_v2::buttonInventory },
- { 0, 0xE, 0x00, 0, 0, 0, 0, 0x1100, 0, 0, 0, 0, 0x089, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, &KyraEngine_v2::buttonInventory },
- { 0, 0xF, 0x00, 0, 0, 0, 0, 0x1100, 0, 0, 0, 0, 0x09D, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, &KyraEngine_v2::buttonInventory }
- };
+void KyraEngine_v2::initInventoryButtonList() {
+ delete [] _inventoryButtons;
+
+ _inventoryButtons = new Button[15];
+ assert(_inventoryButtons);
+
+ GUI_V2_BUTTON(_inventoryButtons[0], 0x1, 0x4F, 0, 1, 1, 1, 0x4487, 0, 0x00A, 0x95, 0x39, 0x1D, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
+ /*&KyraEngine_v2::sub_C9A1*/
+
+ GUI_V2_BUTTON(_inventoryButtons[1], 0x2, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x104, 0x90, 0x3C, 0x2C, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
+ _inventoryButtons[1].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::cauldronButton);
+
+ GUI_V2_BUTTON(_inventoryButtons[2], 0x5, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x0FA, 0x90, 0x0A, 0x2C, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
+ _inventoryButtons[2].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::cauldronClearButton);
+
+ GUI_V2_BUTTON(_inventoryButtons[3], 0x3, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x0CE, 0x90, 0x2C, 0x2C, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
+ _inventoryButtons[3].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::bookButton);
+
+ GUI_V2_BUTTON(_inventoryButtons[4], 0x4, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x0B6, 0x9D, 0x18, 0x1E, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
+ _inventoryButtons[4].buttonCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::scrollInventory);
+
+ Button::Callback inventoryCallback = BUTTON_FUNCTOR(KyraEngine_v2, this, &KyraEngine_v2::buttonInventory);
+ GUI_V2_BUTTON(_inventoryButtons[5], 0x6, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x04D, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
+ GUI_V2_BUTTON(_inventoryButtons[6], 0x7, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x061, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
+ GUI_V2_BUTTON(_inventoryButtons[7], 0x8, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x075, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
+ GUI_V2_BUTTON(_inventoryButtons[8], 0x9, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x089, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
+ GUI_V2_BUTTON(_inventoryButtons[9], 0xA, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x09D, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
+ GUI_V2_BUTTON(_inventoryButtons[10], 0xB, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x04D, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
+ GUI_V2_BUTTON(_inventoryButtons[11], 0xC, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x061, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
+ GUI_V2_BUTTON(_inventoryButtons[12], 0xD, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x075, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
+ GUI_V2_BUTTON(_inventoryButtons[13], 0xE, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x089, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
+ GUI_V2_BUTTON(_inventoryButtons[14], 0xF, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x09D, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
+
+ for (int i = 5; i <= 14; ++i)
+ _inventoryButtons[i].buttonCallback = inventoryCallback;
switch (_lang) {
case 0:
- mainButtons[0].shapePtr0 = _buttonShapes[6];
- mainButtons[0].shapePtr1 = mainButtons[0].shapePtr2 = _buttonShapes[7];
+ _inventoryButtons[0].data0ShapePtr = _buttonShapes[6];
+ _inventoryButtons[0].data1ShapePtr = _inventoryButtons[0].data2ShapePtr = _buttonShapes[7];
break;
case 1:
- mainButtons[0].shapePtr0 = _buttonShapes[8];
- mainButtons[0].shapePtr1 = mainButtons[0].shapePtr2 = _buttonShapes[9];
+ _inventoryButtons[0].data0ShapePtr = _buttonShapes[8];
+ _inventoryButtons[0].data1ShapePtr = _inventoryButtons[0].data2ShapePtr = _buttonShapes[9];
break;
case 2:
- mainButtons[0].shapePtr0 = _buttonShapes[10];
- mainButtons[0].shapePtr1 = mainButtons[0].shapePtr2 = _buttonShapes[11];
+ _inventoryButtons[0].data0ShapePtr = _buttonShapes[10];
+ _inventoryButtons[0].data1ShapePtr = _inventoryButtons[0].data2ShapePtr = _buttonShapes[11];
break;
default:
- mainButtons[0].shapePtr0 = _buttonShapes[6];
- mainButtons[0].shapePtr1 = mainButtons[0].shapePtr2 = _buttonShapes[7];
+ _inventoryButtons[0].data0ShapePtr = _buttonShapes[6];
+ _inventoryButtons[0].data1ShapePtr = _inventoryButtons[0].data2ShapePtr = _buttonShapes[7];
break;
}
- _buttonList = &mainButtons[0];
- for (size_t i = 1; i < ARRAYSIZE(mainButtons); ++i)
- _buttonList = addButtonToList(_buttonList, &mainButtons[i]);
+ _buttonList = &_inventoryButtons[0];
+ for (size_t i = 1; i < 15; ++i)
+ _buttonList = _gui->addButtonToList(_buttonList, &_inventoryButtons[i]);
}
const uint16 KyraEngine_v2::_itemMagicTable[] = {