diff options
-rw-r--r-- | engines/kyra/eob1.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/eob2.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/eobcommon.cpp | 6 | ||||
-rw-r--r-- | engines/kyra/eobcommon.h | 2 | ||||
-rw-r--r-- | engines/kyra/gui_eob.cpp | 28 | ||||
-rw-r--r-- | engines/kyra/gui_eob.h | 2 | ||||
-rw-r--r-- | engines/kyra/saveload_eob.cpp | 2 |
7 files changed, 18 insertions, 26 deletions
diff --git a/engines/kyra/eob1.cpp b/engines/kyra/eob1.cpp index cdccd65414..69071d3aef 100644 --- a/engines/kyra/eob1.cpp +++ b/engines/kyra/eob1.cpp @@ -78,7 +78,7 @@ void EobEngine::startupNew() { } void EobEngine::startupLoad() { - updateHandItemCursor(); + setHandItem(_itemInHand); loadLevel(_currentLevel, _currentSub); _saveLoadMode = 0; } diff --git a/engines/kyra/eob2.cpp b/engines/kyra/eob2.cpp index de8e90c80f..56ef838e54 100644 --- a/engines/kyra/eob2.cpp +++ b/engines/kyra/eob2.cpp @@ -78,7 +78,7 @@ void DarkMoonEngine::startupNew() { } void DarkMoonEngine::startupLoad() { - updateHandItemCursor(); + setHandItem(_itemInHand); loadLevel(_currentLevel, _currentSub); _saveLoadMode = 0; } diff --git a/engines/kyra/eobcommon.cpp b/engines/kyra/eobcommon.cpp index 83a57cd66f..7ec988ef1e 100644 --- a/engines/kyra/eobcommon.cpp +++ b/engines/kyra/eobcommon.cpp @@ -46,7 +46,6 @@ EobCoreEngine::EobCoreEngine(OSystem *system, const GameFlags &flags) : LolEobBa _playFinale = false; _runFlag = true; _saveLoadMode = 0; - _updateHandItemCursor = false; _configMouse = true; _resting = false; @@ -441,11 +440,6 @@ void EobCoreEngine::runLoop() { checkInput(_activeButtons, true, 0); removeInputTop(); - if (_updateHandItemCursor) { - _updateHandItemCursor = false; - setHandItem(_itemInHand); - } - _timer->update(); updateScriptTimers(); diff --git a/engines/kyra/eobcommon.h b/engines/kyra/eobcommon.h index 2e4df6aa1c..8b97ab361d 100644 --- a/engines/kyra/eobcommon.h +++ b/engines/kyra/eobcommon.h @@ -351,8 +351,6 @@ protected: // Mouse void setHandItem(Item itemIndex); - void updateHandItemCursor() { _updateHandItemCursor = true; } - bool _updateHandItemCursor; // Characters int getDexterityArmorClassModifier(int dexterity); diff --git a/engines/kyra/gui_eob.cpp b/engines/kyra/gui_eob.cpp index 4d5a1bf438..4fe5b6bed9 100644 --- a/engines/kyra/gui_eob.cpp +++ b/engines/kyra/gui_eob.cpp @@ -1951,17 +1951,17 @@ int GUI_Eob::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8 return result; } -void GUI_Eob::simpleMenu_setup(int sd, int maxItem, const char *const *strings, int32 menuItemsMask, int unk, int lineSpacing) { - simpleMenu_initMenuItemsMask(sd, maxItem, menuItemsMask, unk); +void GUI_Eob::simpleMenu_setup(int sd, int maxItem, const char *const *strings, int32 menuItemsMask, int itemOffset, int lineSpacing) { + simpleMenu_initMenuItemsMask(sd, maxItem, menuItemsMask, itemOffset); const ScreenDim *dm = _screen->getScreenDim(19 + sd); int x = (_screen->_curDim->sx + dm->sx) << 3; int y = _screen->_curDim->sy + dm->sy; - int v = simpleMenu_getMenuItem(_menuCur, menuItemsMask, unk); + int v = simpleMenu_getMenuItem(_menuCur, menuItemsMask, itemOffset); for (int i = 0; i < _menuNumItems; i++) { - int item = simpleMenu_getMenuItem(i, menuItemsMask, unk); + int item = simpleMenu_getMenuItem(i, menuItemsMask, itemOffset); int ty = y + i * (lineSpacing + _screen->getFontHeight()); _screen->printShadedText(strings[item], x, ty, dm->unkA, 0); if (item == v) @@ -1975,7 +1975,7 @@ void GUI_Eob::simpleMenu_setup(int sd, int maxItem, const char *const *strings, _vm->removeInputTop(); } -int GUI_Eob::simpleMenu_process(int sd, const char *const *strings, void *b, int32 menuItemsMask, int unk) { +int GUI_Eob::simpleMenu_process(int sd, const char *const *strings, void *b, int32 menuItemsMask, int itemOffset) { const ScreenDim *dm = _screen->getScreenDim(19 + sd); int h = _menuNumItems - 1; int currentItem = _menuCur % _menuNumItems; @@ -2017,13 +2017,13 @@ int GUI_Eob::simpleMenu_process(int sd, const char *const *strings, void *b, int } if (newItem != currentItem) { - _screen->printText(strings[simpleMenu_getMenuItem(currentItem, menuItemsMask, unk)], x, y + currentItem * lineH , dm->unkA, 0); - _screen->printText(strings[simpleMenu_getMenuItem(newItem, menuItemsMask, unk)], x, y + newItem * lineH , dm->unkC, 0); + _screen->printText(strings[simpleMenu_getMenuItem(currentItem, menuItemsMask, itemOffset)], x, y + currentItem * lineH , dm->unkA, 0); + _screen->printText(strings[simpleMenu_getMenuItem(newItem, menuItemsMask, itemOffset)], x, y + newItem * lineH , dm->unkC, 0); _screen->updateScreen(); } if (result != -1) { - result = simpleMenu_getMenuItem(result, menuItemsMask, unk); + result = simpleMenu_getMenuItem(result, menuItemsMask, itemOffset); simpleMenu_flashSelection(strings[result], x, y + newItem * lineH, dm->unkA, dm->unkC, 0); } @@ -2032,7 +2032,7 @@ int GUI_Eob::simpleMenu_process(int sd, const char *const *strings, void *b, int return result; } -int GUI_Eob::simpleMenu_getMenuItem(int index, int32 menuItemsMask, int unk) { +int GUI_Eob::simpleMenu_getMenuItem(int index, int32 menuItemsMask, int itemOffset) { if (menuItemsMask == -1) return index; @@ -2040,11 +2040,11 @@ int GUI_Eob::simpleMenu_getMenuItem(int index, int32 menuItemsMask, int unk) { int i = index; for (; i; res++) { - if (menuItemsMask & (1 << (res + unk))) + if (menuItemsMask & (1 << (res + itemOffset))) i--; } - while (!(menuItemsMask & (1 << (res + unk)))) + while (!(menuItemsMask & (1 << (res + itemOffset)))) res++; return res; @@ -2436,7 +2436,7 @@ int GUI_Eob::getTextInput(char *dest, int x, int y, int destMaxLen, int textColo return _keyPressed.keycode == Common::KEYCODE_ESCAPE ? -1 : len; } -void GUI_Eob::simpleMenu_initMenuItemsMask(int menuId, int maxItem, int32 menuItemsMask, int unk) { +void GUI_Eob::simpleMenu_initMenuItemsMask(int menuId, int maxItem, int32 menuItemsMask, int itemOffset) { if (menuItemsMask == -1) { _menuNumItems = _screen->getScreenDim(19 + menuId)->h; _menuCur = _screen->getScreenDim(19 + menuId)->unk8; @@ -2446,7 +2446,7 @@ void GUI_Eob::simpleMenu_initMenuItemsMask(int menuId, int maxItem, int32 menuIt _menuNumItems = 0; for (int i = 0; i < maxItem; i++) { - if (menuItemsMask & (1 << (i + unk))) + if (menuItemsMask & (1 << (i + itemOffset))) _menuNumItems++; } @@ -2462,7 +2462,7 @@ void GUI_Eob::runMemorizePrayMenu(int charIndex, int spellType) { } void GUI_Eob::scribeScrollDialogue() { - + } bool GUI_Eob::confirmDialogue(int id) { diff --git a/engines/kyra/gui_eob.h b/engines/kyra/gui_eob.h index 64f1c1979a..bb446f75a0 100644 --- a/engines/kyra/gui_eob.h +++ b/engines/kyra/gui_eob.h @@ -74,7 +74,7 @@ public: int redrawButtonCallback(Button *button) { return 0; } private: - int simpleMenu_getMenuItem(int index, int32 menuItemsMask, int unk); + int simpleMenu_getMenuItem(int index, int32 menuItemsMask, int itemOffset); void simpleMenu_flashSelection(const char *str, int x, int y, int color1, int color2, int color3); void simpleMenu_initMenuItemsMask(int menuId, int maxItem, int32 menuItemsMask, int unk); diff --git a/engines/kyra/saveload_eob.cpp b/engines/kyra/saveload_eob.cpp index 18dddddd83..85b94cd3d4 100644 --- a/engines/kyra/saveload_eob.cpp +++ b/engines/kyra/saveload_eob.cpp @@ -374,7 +374,7 @@ Common::Error EobCoreEngine::loadGameState(int slot) { } gui_toggleButtons(); - updateHandItemCursor(); + setHandItem(_itemInHand); while (!_screen->isMouseVisible()) _screen->showMouse(); |