diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp index f9adcc71395..9edd1463b34 100644 --- a/engines/dm/champion.cpp +++ b/engines/dm/champion.cpp @@ -442,7 +442,7 @@ bool ChampionMan::hasObjectIconInSlotBoxChanged(int16 slotBoxIndex, Thing thing) if (newIconIndex != currIconIndex) { if ((slotBoxIndex < k8_SlotBoxInventoryFirstSlot) && !_mousePointerHiddenToDrawChangedObjIconOnScreen) { _mousePointerHiddenToDrawChangedObjIconOnScreen = true; - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); } objMan.f38_drawIconInSlotBox(slotBoxIndex, newIconIndex); return true; @@ -470,9 +470,9 @@ void ChampionMan::drawChangedObjectIcons() { IconIndice iconIndex = objMan.f33_getIconIndex(_leaderHandObject); if (iconIndex != leaderHandObjIconIndex) { _mousePointerHiddenToDrawChangedObjIconOnScreen = true; - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); objMan.f36_extractIconFromBitmap(iconIndex, objMan._g412_objectIconForMousePointer); - _vm->_eventMan->f68_setPointerToObject(_vm->_objectMan->_g412_objectIconForMousePointer); + _vm->_eventMan->setPointerToObject(_vm->_objectMan->_g412_objectIconForMousePointer); _leaderHandObjectIconIndex = iconIndex; objMan.f34_drawLeaderObjectName(_leaderHandObject); } @@ -517,7 +517,7 @@ void ChampionMan::drawChangedObjectIcons() { } if (_mousePointerHiddenToDrawChangedObjIconOnScreen) - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); } void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, ChampionSlot slotIndex) { @@ -607,10 +607,10 @@ Thing ChampionMan::getObjectRemovedFromLeaderHand() { if (leaderHandObject != Thing::_none) { _leaderHandObject = Thing::_none; _leaderHandObjectIconIndex = kM1_IconIndiceNone; - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); _vm->_objectMan->f35_clearLeaderObjectName(); - _vm->_eventMan->f69_setMousePointer(); - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->setMousePointer(); + _vm->_eventMan->hideMouse(); if (_leaderIndex != kM1_ChampionNone) { _champions[_leaderIndex]._load -= _vm->_dungeonMan->getObjectWeight(leaderHandObject); setFlag(_champions[_leaderIndex]._attributes, k0x0200_ChampionAttributeLoad); @@ -902,11 +902,11 @@ void ChampionMan::wakeUp() { _vm->_waitForInputMaxVerticalBlankCount = 10; _vm->delay(10); _vm->_displayMan->f98_drawFloorAndCeiling(); - _vm->_eventMan->_g441_primaryMouseInput = _vm->_eventMan->_primaryMouseInputInterface; - _vm->_eventMan->_g442_secondaryMouseInput = _vm->_eventMan->_secondaryMouseInputMovement; - _vm->_eventMan->_g443_primaryKeyboardInput = _vm->_eventMan->_primaryKeyboardInputInterface; - _vm->_eventMan->_g444_secondaryKeyboardInput = _vm->_eventMan->_secondaryKeyboardInputMovement; - _vm->_eventMan->f357_discardAllInput(); + _vm->_eventMan->_primaryMouseInput = _vm->_eventMan->_primaryMouseInputInterface; + _vm->_eventMan->_secondaryMouseInput = _vm->_eventMan->_secondaryMouseInputMovement; + _vm->_eventMan->_primaryKeyboardInput = _vm->_eventMan->_primaryKeyboardInputInterface; + _vm->_eventMan->_secondaryKeyboardInput = _vm->_eventMan->_secondaryKeyboardInputMovement; + _vm->_eventMan->discardAllInput(); _vm->_menuMan->f457_drawEnabledMenus(); } @@ -1197,15 +1197,15 @@ void ChampionMan::putObjectInLeaderHand(Thing thing, bool setMousePointer) { _leaderEmptyHanded = false; _vm->_objectMan->f36_extractIconFromBitmap(_leaderHandObjectIconIndex = _vm->_objectMan->f33_getIconIndex(_leaderHandObject = thing), _vm->_objectMan->_g412_objectIconForMousePointer); - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); _vm->_objectMan->f34_drawLeaderObjectName(thing); if (setMousePointer) _vm->_setMousePointerToObjectInMainLoop = true; else - _vm->_eventMan->f68_setPointerToObject(_vm->_objectMan->_g412_objectIconForMousePointer); + _vm->_eventMan->setPointerToObject(_vm->_objectMan->_g412_objectIconForMousePointer); - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); if (_leaderIndex != kM1_ChampionNone) { _champions[_leaderIndex]._load += _vm->_dungeonMan->getObjectWeight(thing); setFlag(_champions[_leaderIndex]._attributes, k0x0200_ChampionAttributeLoad); @@ -1322,7 +1322,7 @@ void ChampionMan::clickOnSlotBox(uint16 slotBoxIndex) { if ((leaderHandObject != Thing::_none) && (!(_vm->_dungeonMan->_objectInfo[_vm->_dungeonMan->getObjectInfoIndex(leaderHandObject)]._allowedSlots & _slotMasks[slotIndex]))) return; - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); if (leaderHandObject != Thing::_none) getObjectRemovedFromLeaderHand(); @@ -1335,7 +1335,7 @@ void ChampionMan::clickOnSlotBox(uint16 slotBoxIndex) { addObjectInSlot((ChampionIndex)champIndex, leaderHandObject, (ChampionSlot)slotIndex); drawChampionState((ChampionIndex)champIndex); - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); } bool ChampionMan::isProjectileSpellCast(uint16 champIndex, Thing thing, int16 kineticEnergy, uint16 requiredManaAmount) { @@ -1395,7 +1395,7 @@ void ChampionMan::applyAndDrawPendingDamageAndWounds() { Box blitBox; blitBox._y1 = 0; - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); if (_vm->indexToOrdinal(championIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) { blitBox._y2 = 28; @@ -1441,7 +1441,7 @@ void ChampionMan::applyAndDrawPendingDamageAndWounds() { _vm->_timeline->f236_fixChronology(_vm->_timeline->f235_getIndex(eventIndex)); } drawChampionState((ChampionIndex)championIndex); - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); } } } @@ -1453,17 +1453,17 @@ void ChampionMan::championKill(uint16 champIndex) { if (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) { if (_vm->_pressingEye) { _vm->_pressingEye = false; - _vm->_eventMan->_g597_ignoreMouseMovements = false; + _vm->_eventMan->_ignoreMouseMovements = false; if (!_leaderEmptyHanded) { _vm->_objectMan->f34_drawLeaderObjectName(_leaderHandObject); } - _vm->_eventMan->_g587_hideMousePointerRequestCount = 1; - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->_hideMousePointerRequestCount = 1; + _vm->_eventMan->hideMouse(); } else if (_vm->_pressingMouth) { _vm->_pressingMouth = false; - _vm->_eventMan->_g597_ignoreMouseMovements = false; - _vm->_eventMan->_g587_hideMousePointerRequestCount = 1; - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->_ignoreMouseMovements = false; + _vm->_eventMan->_hideMousePointerRequestCount = 1; + _vm->_eventMan->hideMouse(); } _vm->_inventoryMan->f355_toggleInventory(k4_ChampionCloseInventory); } @@ -1483,9 +1483,9 @@ void ChampionMan::championKill(uint16 champIndex) { curChampion->_dir = _vm->_dungeonMan->_partyDir; curChampion->_maximumDamageReceived = 0; uint16 curChampionIconIndex = getChampionIconIndex(curCell, _vm->_dungeonMan->_partyDir); - if (_vm->indexToOrdinal(curChampionIconIndex) == _vm->_eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap) { - _vm->_eventMan->_g598_mousePointerBitmapUpdated = true; - _vm->_eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(kM1_ChampionNone); + if (_vm->indexToOrdinal(curChampionIconIndex) == _vm->_eventMan->_useChampionIconOrdinalAsMousePointerBitmap) { + _vm->_eventMan->_mousePointerBitmapUpdated = true; + _vm->_eventMan->_useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(kM1_ChampionNone); } if (curChampion->_poisonEventCount) @@ -1507,7 +1507,7 @@ void ChampionMan::championKill(uint16 champIndex) { } if (champIndex == _leaderIndex) - _vm->_eventMan->f368_commandSetLeader((ChampionIndex)aliveChampionIndex); + _vm->_eventMan->commandSetLeader((ChampionIndex)aliveChampionIndex); if (champIndex == _magicCasterChampionIndex) _vm->_menuMan->f394_setMagicCasterAndDrawSpellArea(aliveChampionIndex); @@ -1833,7 +1833,7 @@ void ChampionMan::resetDataToStartGame() { if ((L0787_T_Thing = _leaderHandObject) == Thing::_none) { _leaderEmptyHanded = true; _leaderHandObjectIconIndex = kM1_IconIndiceNone; - _vm->_eventMan->f69_setMousePointer(); + _vm->_eventMan->setMousePointer(); } else { putObjectInLeaderHand(L0787_T_Thing, true); /* This call will add the weight of the leader hand object to the Load of the leader a first time */ } @@ -1846,7 +1846,7 @@ void ChampionMan::resetDataToStartGame() { drawAllChampionStates(); if ((L0785_i_ChampionIndex = _leaderIndex) != kM1_ChampionNone) { _leaderIndex = kM1_ChampionNone; - _vm->_eventMan->f368_commandSetLeader((ChampionIndex)L0785_i_ChampionIndex); + _vm->_eventMan->commandSetLeader((ChampionIndex)L0785_i_ChampionIndex); } if ((L0785_i_ChampionIndex = _magicCasterChampionIndex) != kM1_ChampionNone) { _magicCasterChampionIndex = kM1_ChampionNone; @@ -1948,7 +1948,7 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) { } _candidateChampionOrdinal = previousPartyChampionCount + 1; if (++_partyChampionCount == 1) { - _vm->_eventMan->f368_commandSetLeader(k0_ChampionFirst); + _vm->_eventMan->commandSetLeader(k0_ChampionFirst); _vm->_menuMan->_g508_refreshActionArea = true; } else { _vm->_menuMan->f388_clearActingChampion(); @@ -2057,7 +2057,7 @@ void ChampionMan::drawChampionBarGraphs(ChampionIndex champIndex) { } else { barGraphHeights[barGraphIdx] = 0; } - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); // Strangerke - TO CHECK: if portraits, maybe the old (assembly) code is required for older versions Box box; @@ -2080,7 +2080,7 @@ void ChampionMan::drawChampionBarGraphs(ChampionIndex champIndex) { box._x1 += 7; box._x2 += 7; } - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); } @@ -2121,7 +2121,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) { bool isInventoryChampion = (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal); _vm->_displayMan->_g578_useByteBoxCoordinates = false; - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); if (getFlag(championAttributes, k0x1000_ChampionAttributeStatusBox)) { Box box; box._y1 = 0; @@ -2158,13 +2158,13 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) { _vm->_menuMan->f386_drawActionIcon(champIndex); clearFlag(curChampion->_attributes, k0x0080_ChampionAttributeNameTitle | k0x0100_ChampionAttributeStatistics | k0x0200_ChampionAttributeLoad | k0x0400_ChampionAttributeIcon | k0x0800_ChampionAttributePanel | k0x1000_ChampionAttributeStatusBox | k0x2000_ChampionAttributeWounds | k0x4000_ChampionAttributeViewport | k0x8000_ChampionAttributeActionHand); - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); return; } } if (!(curChampion->_currHealth)) { clearFlag(curChampion->_attributes, k0x0080_ChampionAttributeNameTitle | k0x0100_ChampionAttributeStatistics | k0x0200_ChampionAttributeLoad | k0x0400_ChampionAttributeIcon | k0x0800_ChampionAttributePanel | k0x1000_ChampionAttributeStatusBox | k0x2000_ChampionAttributeWounds | k0x4000_ChampionAttributeViewport | k0x8000_ChampionAttributeActionHand); - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); return; } @@ -2256,7 +2256,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) { setFlag(championAttributes, k0x4000_ChampionAttributeViewport); } uint16 championIconIndex = getChampionIconIndex(curChampion->_cell, _vm->_dungeonMan->_partyDir); - if (getFlag(championAttributes, k0x0400_ChampionAttributeIcon) && (_vm->_eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap != _vm->indexToOrdinal(championIconIndex))) { + if (getFlag(championAttributes, k0x0400_ChampionAttributeIcon) && (_vm->_eventMan->_useChampionIconOrdinalAsMousePointerBitmap != _vm->indexToOrdinal(championIconIndex))) { _vm->_displayMan->D24_fillScreenBox(_boxChampionIcons[championIconIndex], _championColor[champIndex]); _vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->f489_getNativeBitmapOrGraphic(k28_ChampionIcons), _vm->_displayMan->_g348_bitmapScreen, _boxChampionIcons[championIconIndex], getChampionIconIndex(curChampion->_dir, _vm->_dungeonMan->_partyDir) * 19, 0, k40_byteWidth, k160_byteWidthScreen, k12_ColorDarkestGray, 14, k200_heightScreen); } @@ -2281,7 +2281,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) { _vm->_displayMan->f97_drawViewport(k0_viewportNotDungeonView); clearFlag(curChampion->_attributes, k0x0080_ChampionAttributeNameTitle | k0x0100_ChampionAttributeStatistics | k0x0200_ChampionAttributeLoad | k0x0400_ChampionAttributeIcon | k0x0800_ChampionAttributePanel | k0x1000_ChampionAttributeStatusBox | k0x2000_ChampionAttributeWounds | k0x4000_ChampionAttributeViewport | k0x8000_ChampionAttributeActionHand); - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); } uint16 ChampionMan::getChampionIconIndex(int16 val, Direction dir) { @@ -2322,7 +2322,7 @@ void ChampionMan::drawSlot(uint16 champIndex, int16 slotIndex) { box._y2 = box._y1 + 17; if (!isInventoryChamp) - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); int16 iconIndex; if (thing == Thing::_none) { @@ -2371,7 +2371,7 @@ void ChampionMan::drawSlot(uint16 champIndex, int16 slotIndex) { _vm->_objectMan->f38_drawIconInSlotBox(slotBoxIndex, iconIndex); if (!isInventoryChamp) - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); } void ChampionMan::renameChampion(Champion* champ) { @@ -2391,10 +2391,10 @@ void ChampionMan::renameChampion(Champion* champ) { _vm->_displayMan->f20_blitToViewport(_vm->_displayMan->f489_getNativeBitmapOrGraphic(k27_PanelRenameChampionIndice), _vm->_inventoryMan->g32_BoxPanel, k72_byteWidth, k4_ColorCyan, 73); _vm->_textMan->f52_printToViewport(177, 58, k13_ColorLightestGray, "_______"); _vm->_textMan->f52_printToViewport(105, 76, k13_ColorLightestGray, "___________________"); - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); _vm->_displayMan->f97_drawViewport(k0_viewportNotDungeonView); - _vm->_eventMan->f67_setMousePointerToNormal(k0_pointerArrow); - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->setMousePointerToNormal(k0_pointerArrow); + _vm->_eventMan->hideMouse(); uint16 curCharacterIndex = 0; champ->_name[curCharacterIndex] = '\0'; champ->_title[0] = '\0'; @@ -2406,9 +2406,9 @@ void ChampionMan::renameChampion(Champion* champ) { for (;;) { /*_Infinite loop_*/ bool championTitleIsFull = ((renamedChampionStringMode == k2_RENAME_CHAMPION_TITLE) && (curCharacterIndex == 19)); if (!championTitleIsFull) { - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); _vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_g348_bitmapScreen, k160_byteWidthScreen, textPosX, textPosY, k9_ColorGold, k12_ColorDarkestGray, underscoreCharacterString, k200_heightScreen); - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); } int16 curCharacter = 256; @@ -2491,9 +2491,9 @@ void ChampionMan::renameChampion(Champion* champ) { if ((curCharacter != ' ') || curCharacterIndex != 0) { if (!championTitleIsFull) { renameChampionInputCharacterString[0] = curCharacter; - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); _vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_g348_bitmapScreen, k160_byteWidthScreen, textPosX, textPosY, k13_ColorLightestGray, k12_ColorDarkestGray, renameChampionInputCharacterString, k200_heightScreen); - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); renamedChampionString[curCharacterIndex++] = curCharacter; renamedChampionString[curCharacterIndex] = '\0'; textPosX += 6; @@ -2508,9 +2508,9 @@ void ChampionMan::renameChampion(Champion* champ) { } } else if (curCharacter == '\r') { // Carriage return if ((renamedChampionStringMode == k1_RENAME_CHAMPION_NAME) && (curCharacterIndex > 0)) { - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); _vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_g348_bitmapScreen, k160_byteWidthScreen, textPosX, textPosY, k13_ColorLightestGray, k12_ColorDarkestGray, underscoreCharacterString, k200_heightScreen); - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); renamedChampionStringMode = k2_RENAME_CHAMPION_TITLE; renamedChampionString = champ->_title; textPosX = 105; @@ -2522,9 +2522,9 @@ void ChampionMan::renameChampion(Champion* champ) { continue; if (!championTitleIsFull) { - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); _vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_g348_bitmapScreen, k160_byteWidthScreen, textPosX, textPosY, k13_ColorLightestGray, k12_ColorDarkestGray, underscoreCharacterString, k200_heightScreen); - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); } if (curCharacterIndex == 0) { renamedChampionString = champ->_name; diff --git a/engines/dm/dialog.cpp b/engines/dm/dialog.cpp index bf9ea5524a6..ae58b759e70 100644 --- a/engines/dm/dialog.cpp +++ b/engines/dm/dialog.cpp @@ -125,9 +125,9 @@ void DialogMan::dialogDraw(const char *msg1, const char *msg2, const char *choic displayBox._y2 = 168; displayBox._x1 = 47; displayBox._x2 = 270; - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); _vm->_displayMan->f21_blitToScreen(_vm->_displayMan->_g296_bitmapViewport, &displayBox, k112_byteWidthViewport, kM1_ColorNoTransparency, k136_heightViewport); - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); } else { _vm->_displayMan->f97_drawViewport(k0_viewportNotDungeonView); _vm->delay(1); @@ -170,21 +170,21 @@ int16 DialogMan::getChoice(uint16 choiceCount, uint16 dialogSetIndex, int16 driv Box L1303_s_BoxB; Box L1304_s_BoxA; - _vm->_eventMan->f77_hideMouse(); - L1298_ps_PrimaryMouseInputBackup = _vm->_eventMan->_g441_primaryMouseInput; - L1299_ps_SecondaryMouseInputBackup = _vm->_eventMan->_g442_secondaryMouseInput; - L1300_ps_PrimaryKeyboardInputBackup = _vm->_eventMan->_g443_primaryKeyboardInput; - L1301_ps_SecondaryKeyboardInputBackup = _vm->_eventMan->_g444_secondaryKeyboardInput; - _vm->_eventMan->_g442_secondaryMouseInput = nullptr; - _vm->_eventMan->_g443_primaryKeyboardInput = nullptr; - _vm->_eventMan->_g444_secondaryKeyboardInput = nullptr; - _vm->_eventMan->_g441_primaryMouseInput = _vm->_eventMan->_primaryMouseInputDialogSets[dialogSetIndex][choiceCount - 1]; - _vm->_eventMan->f357_discardAllInput(); + _vm->_eventMan->hideMouse(); + L1298_ps_PrimaryMouseInputBackup = _vm->_eventMan->_primaryMouseInput; + L1299_ps_SecondaryMouseInputBackup = _vm->_eventMan->_secondaryMouseInput; + L1300_ps_PrimaryKeyboardInputBackup = _vm->_eventMan->_primaryKeyboardInput; + L1301_ps_SecondaryKeyboardInputBackup = _vm->_eventMan->_secondaryKeyboardInput; + _vm->_eventMan->_secondaryMouseInput = nullptr; + _vm->_eventMan->_primaryKeyboardInput = nullptr; + _vm->_eventMan->_secondaryKeyboardInput = nullptr; + _vm->_eventMan->_primaryMouseInput = _vm->_eventMan->_primaryMouseInputDialogSets[dialogSetIndex][choiceCount - 1]; + _vm->_eventMan->discardAllInput(); _selectedDialogChoice = 99; do { Common::Event key; Common::EventType eventType = _vm->_eventMan->processInput(&key); - _vm->_eventMan->f380_processCommandQueue(); + _vm->_eventMan->processCommandQueue(); _vm->delay(1); _vm->_displayMan->updateScreen(); if ((_selectedDialogChoice == 99) && (choiceCount == 1) @@ -194,12 +194,12 @@ int16 DialogMan::getChoice(uint16 choiceCount, uint16 dialogSetIndex, int16 driv } } while (_selectedDialogChoice == 99); _vm->_displayMan->_g578_useByteBoxCoordinates = false; - L1304_s_BoxA = _vm->_eventMan->_g441_primaryMouseInput[_selectedDialogChoice - 1]._hitbox; + L1304_s_BoxA = _vm->_eventMan->_primaryMouseInput[_selectedDialogChoice - 1]._hitbox; L1304_s_BoxA._x1 -= 3; L1304_s_BoxA._x2 += 3; L1304_s_BoxA._y1 -= 3; L1304_s_BoxA._y2 += 4; - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); _vm->_displayMan->_g297_drawFloorAndCeilingRequested = true; L1303_s_BoxB._x1 = 0; L1303_s_BoxB._y1 = 0; @@ -256,13 +256,13 @@ int16 DialogMan::getChoice(uint16 choiceCount, uint16 dialogSetIndex, int16 driv L1304_s_BoxA._y2 += 3; _vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->_g296_bitmapViewport, _vm->_displayMan->_g348_bitmapScreen, L1304_s_BoxA, 0, 0, k160_byteWidthScreen, k160_byteWidthScreen, kM1_ColorNoTransparency, 25, k200_heightScreen); - _vm->_eventMan->f77_hideMouse(); - _vm->_eventMan->_g441_primaryMouseInput = L1298_ps_PrimaryMouseInputBackup; - _vm->_eventMan->_g442_secondaryMouseInput = L1299_ps_SecondaryMouseInputBackup; - _vm->_eventMan->_g443_primaryKeyboardInput = L1300_ps_PrimaryKeyboardInputBackup; - _vm->_eventMan->_g444_secondaryKeyboardInput = L1301_ps_SecondaryKeyboardInputBackup; - _vm->_eventMan->f357_discardAllInput(); - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->hideMouse(); + _vm->_eventMan->_primaryMouseInput = L1298_ps_PrimaryMouseInputBackup; + _vm->_eventMan->_secondaryMouseInput = L1299_ps_SecondaryMouseInputBackup; + _vm->_eventMan->_primaryKeyboardInput = L1300_ps_PrimaryKeyboardInputBackup; + _vm->_eventMan->_secondaryKeyboardInput = L1301_ps_SecondaryKeyboardInputBackup; + _vm->_eventMan->discardAllInput(); + _vm->_eventMan->showMouse(); return _selectedDialogChoice; } } diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp index 0c225a7999d..a51132c92c9 100644 --- a/engines/dm/dm.cpp +++ b/engines/dm/dm.cpp @@ -241,8 +241,8 @@ Common::Error DMEngine::loadGameState(int slot) { startGame(); _restartGameRequest = false; - _eventMan->f77_hideMouse(); - _eventMan->f357_discardAllInput(); + _eventMan->hideMouse(); + _eventMan->discardAllInput(); return Common::kNoError; } @@ -307,8 +307,8 @@ void DMEngine::initializeGame() { startGame(); if (_newGameFl) _moveSens->f267_getMoveResult(Thing::_party, kM1_MapXNotOnASquare, 0, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY); - _eventMan->f78_showMouse(); - _eventMan->f357_discardAllInput(); + _eventMan->showMouse(); + _eventMan->discardAllInput(); } void DMEngine::initMemoryManager() { @@ -331,16 +331,16 @@ void DMEngine::startGame() { _pressingMouth = false; _stopPressingMouth = false; _highlightBoxInversionRequested = false; - _eventMan->_g341_highlightBoxEnabled = false; + _eventMan->_highlightBoxEnabled = false; _championMan->_partyIsSleeping = false; _championMan->_actingChampionOrdinal = indexToOrdinal(kM1_ChampionNone); _menuMan->_g509_actionAreaContainsIcons = true; - _eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap = indexToOrdinal(kM1_ChampionNone); + _eventMan->_useChampionIconOrdinalAsMousePointerBitmap = indexToOrdinal(kM1_ChampionNone); - _eventMan->_g441_primaryMouseInput = _eventMan->_primaryMouseInputInterface; - _eventMan->_g442_secondaryMouseInput = _eventMan->_secondaryMouseInputMovement; - _eventMan->_g443_primaryKeyboardInput = _eventMan->_primaryKeyboardInputInterface; - _eventMan->_g444_secondaryKeyboardInput = _eventMan->_secondaryKeyboardInputMovement; + _eventMan->_primaryMouseInput = _eventMan->_primaryMouseInputInterface; + _eventMan->_secondaryMouseInput = _eventMan->_secondaryMouseInputMovement; + _eventMan->_primaryKeyboardInput = _eventMan->_primaryKeyboardInputInterface; + _eventMan->_secondaryKeyboardInput = _eventMan->_secondaryKeyboardInputMovement; processNewPartyMap(_dungeonMan->_partyMapIndex); @@ -441,7 +441,7 @@ void DMEngine::gameloop() { processNewPartyMap(_newPartyMapIndex); _moveSens->f267_getMoveResult(Thing::_party, kM1_MapXNotOnASquare, 0, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY); _newPartyMapIndex = kM1_mapIndexNone; - _eventMan->f357_discardAllInput(); + _eventMan->discardAllInput(); } _timeline->f261_processTimeline(); @@ -455,19 +455,19 @@ void DMEngine::gameloop() { _displayMan->f128_drawDungeon(_dungeonMan->_partyDir, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY); if (_setMousePointerToObjectInMainLoop) { _setMousePointerToObjectInMainLoop = false; - _eventMan->f78_showMouse(); - _eventMan->f68_setPointerToObject(_objectMan->_g412_objectIconForMousePointer); - _eventMan->f77_hideMouse(); + _eventMan->showMouse(); + _eventMan->setPointerToObject(_objectMan->_g412_objectIconForMousePointer); + _eventMan->hideMouse(); } - if (_eventMan->_g326_refreshMousePointerInMainLoop) { - _eventMan->_g326_refreshMousePointerInMainLoop = false; - _eventMan->_g598_mousePointerBitmapUpdated = true; - _eventMan->f78_showMouse(); - _eventMan->f77_hideMouse(); + if (_eventMan->_refreshMousePointerInMainLoop) { + _eventMan->_refreshMousePointerInMainLoop = false; + _eventMan->_mousePointerBitmapUpdated = true; + _eventMan->showMouse(); + _eventMan->hideMouse(); } } - _eventMan->f363_highlightBoxDisable(); + _eventMan->highlightBoxDisable(); _sound->f65_playPendingSound(); _championMan->applyAndDrawPendingDamageAndWounds(); if (_championMan->_partyDead) @@ -508,14 +508,14 @@ void DMEngine::gameloop() { _inventoryMan->f350_drawStopPressingMouth(); } - _eventMan->f380_processCommandQueue(); + _eventMan->processCommandQueue(); if (_engineShouldQuit || _loadSaveSlotAtRuntime != -1) { _canLoadFromGMM = false; return; } _displayMan->updateScreen(); if (!_stopWaitingForPlayerInput) { - _eventMan->f363_highlightBoxDisable(); + _eventMan->highlightBoxDisable(); } _system->delayMillis(2); @@ -536,10 +536,10 @@ int16 DMEngine::indexToOrdinal(int16 val) { } void DMEngine::processEntrance() { - _eventMan->_g441_primaryMouseInput = _eventMan->_primaryMouseInputEntrance; - _eventMan->_g442_secondaryMouseInput = nullptr; - _eventMan->_g443_primaryKeyboardInput = nullptr; - _eventMan->_g444_secondaryKeyboardInput = nullptr; + _eventMan->_primaryMouseInput = _eventMan->_primaryMouseInputEntrance; + _eventMan->_secondaryMouseInput = nullptr; + _eventMan->_primaryKeyboardInput = nullptr; + _eventMan->_secondaryKeyboardInput = nullptr; _entranceDoorAnimSteps[0] = new byte[128 * 161 * 12]; for (uint16 idx = 1; idx < 8; idx++) _entranceDoorAnimSteps[idx] = _entranceDoorAnimSteps[idx - 1] + 128 * 161; @@ -568,14 +568,14 @@ void DMEngine::processEntrance() { do { drawEntrance(); - _eventMan->f78_showMouse(); - _eventMan->f357_discardAllInput(); + _eventMan->showMouse(); + _eventMan->discardAllInput(); _newGameFl = k99_modeWaitingOnEntrance; do { _eventMan->processInput(); if (_engineShouldQuit) return; - _eventMan->f380_processCommandQueue(); + _eventMan->processCommandQueue(); _displayMan->updateScreen(); } while (_newGameFl == k99_modeWaitingOnEntrance); } while (_newGameFl == k202_CommandEntranceDrawCredits); @@ -583,7 +583,7 @@ void DMEngine::processEntrance() { //Strangerke: CHECKME: Earlier versions were using G0566_puc_Graphic534_Sound01Switch _sound->f060_SOUND_Play(k01_soundSWITCH, 112, 0x40, 0x40); delay(20); - _eventMan->f78_showMouse(); + _eventMan->showMouse(); if (_newGameFl) openEntranceDoors(); @@ -627,12 +627,12 @@ void DMEngine::endGame(bool doNotDrawCreditsOnly) { bool waitBeforeDrawingRestart = true; - _eventMan->f67_setMousePointerToNormal(k0_pointerArrow); - _eventMan->f78_showMouse(); - _eventMan->_g441_primaryMouseInput = nullptr; - _eventMan->_g442_secondaryMouseInput = nullptr; - _eventMan->_g443_primaryKeyboardInput = nullptr; - _eventMan->_g444_secondaryKeyboardInput = nullptr; + _eventMan->setMousePointerToNormal(k0_pointerArrow); + _eventMan->showMouse(); + _eventMan->_primaryMouseInput = nullptr; + _eventMan->_secondaryMouseInput = nullptr; + _eventMan->_primaryKeyboardInput = nullptr; + _eventMan->_secondaryKeyboardInput = nullptr; if (doNotDrawCreditsOnly && !_gameWon) { _sound->f064_SOUND_RequestPlay_CPSD(k06_soundSCREAM, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY, k0_soundModePlayImmediately); delay(240); @@ -721,14 +721,14 @@ T0444017: curPalette[1] = D03_RGB_PINK; curPalette[4] = D09_RGB_WHITE; - _eventMan->_g441_primaryMouseInput = _eventMan->_primaryMouseInputRestartGame; - _eventMan->f357_discardAllInput(); - _eventMan->f77_hideMouse(); + _eventMan->_primaryMouseInput = _eventMan->_primaryMouseInputRestartGame; + _eventMan->discardAllInput(); + _eventMan->hideMouse(); _displayMan->f436_STARTEND_FadeToPalette(curPalette); for (int16 verticalBlankCount = 900; --verticalBlankCount && !_restartGameRequest; delay(1)) - _eventMan->f380_processCommandQueue(); + _eventMan->processCommandQueue(); - _eventMan->f78_showMouse(); + _eventMan->showMouse(); if (_restartGameRequest) { _displayMan->f436_STARTEND_FadeToPalette(darkBluePalette); _displayMan->fillScreen(k0_ColorBlack); @@ -737,8 +737,8 @@ T0444017: if (loadgame(1) != kM1_LoadgameFailure) { startGame(); _restartGameRequest = false; - _eventMan->f77_hideMouse(); - _eventMan->f357_discardAllInput(); + _eventMan->hideMouse(); + _eventMan->discardAllInput(); return; } } @@ -750,7 +750,7 @@ T0444017: _displayMan->f21_blitToScreen(_displayMan->f489_getNativeBitmapOrGraphic(k5_creditsGraphicIndice), &box, k160_byteWidthScreen, kM1_ColorNoTransparency, k200_heightScreen); _displayMan->f436_STARTEND_FadeToPalette(_displayMan->_palCredits); - _eventMan->f541_waitForMouseOrKeyActivity(); + _eventMan->waitForMouseOrKeyActivity(); if (_engineShouldQuit) return; @@ -830,7 +830,7 @@ void DMEngine::openEntranceDoors() { kM1_ColorNoTransparency, 161, k200_heightScreen); _displayMan->f132_blitToBitmap(rightDoorBitmap, _displayMan->_g348_bitmapScreen, rightDoorBox, 0, 0, 64, k160_byteWidthScreen, kM1_ColorNoTransparency, 161, k200_heightScreen); - _eventMan->f357_discardAllInput(); + _eventMan->discardAllInput(); _displayMan->updateScreen(); leftDoorBox._x2 -= 4; @@ -922,12 +922,12 @@ void DMEngine::drawTittle() { } void DMEngine::entranceDrawCredits() { - _eventMan->f78_showMouse(); + _eventMan->showMouse(); _displayMan->f436_STARTEND_FadeToPalette(_displayMan->_g345_aui_BlankBuffer); _displayMan->f466_loadIntoBitmap(k5_creditsGraphicIndice, _displayMan->_g348_bitmapScreen); _displayMan->f436_STARTEND_FadeToPalette(_displayMan->_palCredits); delay(50); - _eventMan->f541_waitForMouseOrKeyActivity(); + _eventMan->waitForMouseOrKeyActivity(); _newGameFl = k202_modeEntranceDrawCredits; } @@ -963,7 +963,7 @@ void DMEngine::fuseSequnce() { if (_inventoryMan->_g432_inventoryChampionOrdinal) { _inventoryMan->f355_toggleInventory(k4_ChampionCloseInventory); } - _eventMan->f363_highlightBoxDisable(); + _eventMan->highlightBoxDisable(); _championMan->_party._magicalLightAmount = 200; _inventoryMan->f337_setDungeonViewPalette(); _championMan->_party._fireShieldDefense = _championMan->_party._spellShieldDefense = _championMan->_party._shieldDefense = 100; @@ -1074,7 +1074,7 @@ void DMEngine::fuseSequenceUpdate() { _timeline->f261_processTimeline(); _displayMan->f128_drawDungeon(_dungeonMan->_partyDir, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY); _sound->f65_playPendingSound(); - _eventMan->f357_discardAllInput(); + _eventMan->discardAllInput(); _displayMan->updateScreen(); delay(2); _gameTime++; /* BUG0_71 Some timings are too short on fast computers. diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp index b5dfcccf58f..77a9b5b0cb7 100644 --- a/engines/dm/eventman.cpp +++ b/engines/dm/eventman.cpp @@ -369,53 +369,53 @@ void EventManager::initArrays() { EventManager::EventManager(DMEngine *vm) : _vm(vm) { _mousePos = Common::Point(0, 0); _dummyMapIndex = 0; - _g436_pendingClickPresent = false; - _g437_pendingClickPos = Common::Point(0, 0); - _g615_mousePointerOriginalColorsObject = nullptr; - _g613_mousePointerOriginalColorsChampionIcon = nullptr; - _gK190_mousePointerTempBuffer = nullptr; - _g435_isCommandQueueLocked = true; - _gK104_mousePointerType = 0; - _gK105_previousMousePointerType = 0; - _g441_primaryMouseInput = nullptr; - _g442_secondaryMouseInput = nullptr; - _g598_mousePointerBitmapUpdated = true; - _g326_refreshMousePointerInMainLoop = false; - _g341_highlightBoxEnabled = false; - _g599_useChampionIconOrdinalAsMousePointerBitmap = 0; - _g439_pendingClickButton = k0_NoneMouseButton; - _g600_useObjectAsMousePointerBitmap = false; - _g601_useHandAsMousePointerBitmap = false; - _gK100_preventBuildPointerScreenArea = false; - _g443_primaryKeyboardInput = nullptr; - _g444_secondaryKeyboardInput = nullptr; - _g597_ignoreMouseMovements = false; + _pendingClickPresent = false; + _pendingClickPos = Common::Point(0, 0); + _mousePointerOriginalColorsObject = nullptr; + _mousePointerOriginalColorsChampionIcon = nullptr; + _mousePointerTempBuffer = nullptr; + _isCommandQueueLocked = true; + _mousePointerType = 0; + _previousMousePointerType = 0; + _primaryMouseInput = nullptr; + _secondaryMouseInput = nullptr; + _mousePointerBitmapUpdated = true; + _refreshMousePointerInMainLoop = false; + _highlightBoxEnabled = false; + _useChampionIconOrdinalAsMousePointerBitmap = 0; + _pendingClickButton = k0_NoneMouseButton; + _useObjectAsMousePointerBitmap = false; + _useHandAsMousePointerBitmap = false; + _preventBuildPointerScreenArea = false; + _primaryKeyboardInput = nullptr; + _secondaryKeyboardInput = nullptr; + _ignoreMouseMovements = false; warning(false, "_g587_hideMousePointerRequestCount should start with value 1"); - _g587_hideMousePointerRequestCount = 0; - _g558_mouseButtonStatus = 0; + _hideMousePointerRequestCount = 0; + _mouseButtonStatus = 0; _highlightScreenBox.setToZero(); initArrays(); } EventManager::~EventManager() { - delete[] _g615_mousePointerOriginalColorsObject; - delete[] _gK190_mousePointerTempBuffer; - delete[] _g613_mousePointerOriginalColorsChampionIcon; + delete[] _mousePointerOriginalColorsObject; + delete[] _mousePointerTempBuffer; + delete[] _mousePointerOriginalColorsChampionIcon; } void EventManager::initMouse() { static uint16 gK150_PalMousePointer[16] = {0x000, 0x666, 0x888, 0x620, 0x0CC, 0x840, 0x080, 0x0C0, 0xF00, 0xFA0, 0xC86, 0xFF0, 0x000, 0xAAA, 0x00F, 0xFFF}; // @ K0150_aui_Palette_MousePointer - if (!_g615_mousePointerOriginalColorsObject) - _g615_mousePointerOriginalColorsObject = new byte[32 * 18]; - if (!_gK190_mousePointerTempBuffer) - _gK190_mousePointerTempBuffer = new byte[32 * 18]; - if (!_g613_mousePointerOriginalColorsChampionIcon) - _g613_mousePointerOriginalColorsChampionIcon = new byte[32 * 18]; + if (!_mousePointerOriginalColorsObject) + _mousePointerOriginalColorsObject = new byte[32 * 18]; + if (!_mousePointerTempBuffer) + _mousePointerTempBuffer = new byte[32 * 18]; + if (!_mousePointerOriginalColorsChampionIcon) + _mousePointerOriginalColorsChampionIcon = new byte[32 * 18]; - _gK104_mousePointerType = k0_pointerArrow; - _gK105_previousMousePointerType = k1_pointerHand; + _mousePointerType = k0_pointerArrow; + _previousMousePointerType = k1_pointerHand; byte mousePalette[16 * 3]; for (int i = 0; i < 16; ++i) { @@ -426,22 +426,22 @@ void EventManager::initMouse() { CursorMan.pushCursorPalette(mousePalette, 0, 16); _mousePos = Common::Point(0, 0); - f73_buildpointerScreenArea(_mousePos.x, _mousePos.y); + buildpointerScreenArea(_mousePos.x, _mousePos.y); CursorMan.showMouse(false); setMousePos(Common::Point(320 / 2, 200 / 2)); } -void EventManager::f67_setMousePointerToNormal(int16 mousePointer) { - _gK100_preventBuildPointerScreenArea = true; - _g600_useObjectAsMousePointerBitmap = false; - _g601_useHandAsMousePointerBitmap = (mousePointer == k1_pointerHand); - _g598_mousePointerBitmapUpdated = true; - _gK100_preventBuildPointerScreenArea = false; - f73_buildpointerScreenArea(_mousePos.x, _mousePos.y); +void EventManager::setMousePointerToNormal(int16 mousePointer) { + _preventBuildPointerScreenArea = true; + _useObjectAsMousePointerBitmap = false; + _useHandAsMousePointerBitmap = (mousePointer == k1_pointerHand); + _mousePointerBitmapUpdated = true; + _preventBuildPointerScreenArea = false; + buildpointerScreenArea(_mousePos.x, _mousePos.y); } -void EventManager::f68_setPointerToObject(byte* bitmap) { +void EventManager::setPointerToObject(byte* bitmap) { static byte palChangesMousepointerOjbectIconShadow[16] = {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 0, 120, 120, 120}; // @ K0027_auc_PaletteChanges_MousePointerObjectIconShadow static byte palChangesMousePointerIcon[16] = {120, 10, 20, 30, 40, 50, 60, 70, 80, 90, @@ -449,35 +449,35 @@ void EventManager::f68_setPointerToObject(byte* bitmap) { static Box boxMousePointerObjectShadow(2, 17, 2, 17); // @ G0619_s_Box_MousePointer_ObjectShadow static Box boxMousePointerObject(0, 15, 0, 15); // @ G0620_s_Box_MousePointer_Object - _gK100_preventBuildPointerScreenArea = true; - _g600_useObjectAsMousePointerBitmap = true; - _g601_useHandAsMousePointerBitmap = false; - _g598_mousePointerBitmapUpdated = true; + _preventBuildPointerScreenArea = true; + _useObjectAsMousePointerBitmap = true; + _useHandAsMousePointerBitmap = false; + _mousePointerBitmapUpdated = true; _vm->_displayMan->_g578_useByteBoxCoordinates = true; - byte *L0051_puc_Bitmap = _g615_mousePointerOriginalColorsObject; + byte *L0051_puc_Bitmap = _mousePointerOriginalColorsObject; memset(L0051_puc_Bitmap, 0, 32 * 18); - _vm->_displayMan->f129_blitToBitmapShrinkWithPalChange(bitmap, _gK190_mousePointerTempBuffer, 16, 16, 16, 16, palChangesMousepointerOjbectIconShadow); - _vm->_displayMan->f132_blitToBitmap(_gK190_mousePointerTempBuffer, L0051_puc_Bitmap, boxMousePointerObjectShadow, 0, 0, 8, 16, kM1_ColorNoTransparency, 16, 18); - _vm->_displayMan->f129_blitToBitmapShrinkWithPalChange(bitmap, _gK190_mousePointerTempBuffer, 16, 16, 16, 16, palChangesMousePointerIcon); - _vm->_displayMan->f132_blitToBitmap(_gK190_mousePointerTempBuffer, L0051_puc_Bitmap, boxMousePointerObject, 0, 0, 8, 16, k0_ColorBlack, 16, 18); + _vm->_displayMan->f129_blitToBitmapShrinkWithPalChange(bitmap, _mousePointerTempBuffer, 16, 16, 16, 16, palChangesMousepointerOjbectIconShadow); + _vm->_displayMan->f132_blitToBitmap(_mousePointerTempBuffer, L0051_puc_Bitmap, boxMousePointerObjectShadow, 0, 0, 8, 16, kM1_ColorNoTransparency, 16, 18); + _vm->_displayMan->f129_blitToBitmapShrinkWithPalChange(bitmap, _mousePointerTempBuffer, 16, 16, 16, 16, palChangesMousePointerIcon); + _vm->_displayMan->f132_blitToBitmap(_mousePointerTempBuffer, L0051_puc_Bitmap, boxMousePointerObject, 0, 0, 8, 16, k0_ColorBlack, 16, 18); - _gK100_preventBuildPointerScreenArea = false; - f73_buildpointerScreenArea(_mousePos.x, _mousePos.y); + _preventBuildPointerScreenArea = false; + buildpointerScreenArea(_mousePos.x, _mousePos.y); } -void EventManager::f71_mouseDropChampionIcon() { - _gK100_preventBuildPointerScreenArea = true; - uint16 championIconIndex = _vm->ordinalToIndex(_g599_useChampionIconOrdinalAsMousePointerBitmap); - _g599_useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(kM1_ChampionNone); - _g598_mousePointerBitmapUpdated = true; +void EventManager::mouseDropChampionIcon() { + _preventBuildPointerScreenArea = true; + uint16 championIconIndex = _vm->ordinalToIndex(_useChampionIconOrdinalAsMousePointerBitmap); + _useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(kM1_ChampionNone); + _mousePointerBitmapUpdated = true; bool useByteBoxCoordinatesBackup = _vm->_displayMan->_g578_useByteBoxCoordinates; - _vm->_displayMan->f21_blitToScreen(_g613_mousePointerOriginalColorsChampionIcon, &_vm->_championMan->_boxChampionIcons[championIconIndex << 2], 16, k12_ColorDarkestGray, 18); + _vm->_displayMan->f21_blitToScreen(_mousePointerOriginalColorsChampionIcon, &_vm->_championMan->_boxChampionIcons[championIconIndex << 2], 16, k12_ColorDarkestGray, 18); _vm->_displayMan->_g578_useByteBoxCoordinates = useByteBoxCoordinatesBackup; - _gK100_preventBuildPointerScreenArea = false; + _preventBuildPointerScreenArea = false; } -void EventManager::f73_buildpointerScreenArea(int16 mousePosX, int16 mousePosY) { +void EventManager::buildpointerScreenArea(int16 mousePosX, int16 mousePosY) { static unsigned char bitmapArrowPointer[288] = { // @ G0042_auc_Graphic562_Bitmap_ArrowPointer 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, @@ -519,81 +519,81 @@ void EventManager::f73_buildpointerScreenArea(int16 mousePosX, int16 mousePosY) 0x07, 0xFF, 0x00, 0x00, 0x01, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - _gK100_preventBuildPointerScreenArea = true; - if (_g599_useChampionIconOrdinalAsMousePointerBitmap) { + _preventBuildPointerScreenArea = true; + if (_useChampionIconOrdinalAsMousePointerBitmap) { if ((mousePosY > 28) || (mousePosX < 274)) { - _gK104_mousePointerType = k4_pointerTypeAutoselect; - f71_mouseDropChampionIcon(); + _mousePointerType = k4_pointerTypeAutoselect; + mouseDropChampionIcon(); } else - _gK104_mousePointerType = k2_pointerTypeChampionIcon; + _mousePointerType = k2_pointerTypeChampionIcon; } else if (mousePosY >= 169) - _gK104_mousePointerType = k0_pointerTypeArrow; + _mousePointerType = k0_pointerTypeArrow; else if (mousePosX >= 274) - _gK104_mousePointerType = k0_pointerTypeArrow; + _mousePointerType = k0_pointerTypeArrow; else if (mousePosY <= 28) { uint16 championIdx = mousePosX / 69; uint16 xOverChampionStatusBox = mousePosX % 69; if (championIdx >= _vm->_championMan->_partyChampionCount) - _gK104_mousePointerType = k4_pointerTypeAutoselect; + _mousePointerType = k4_pointerTypeAutoselect; else if (xOverChampionStatusBox > 42) - _gK104_mousePointerType = k4_pointerTypeAutoselect; + _mousePointerType = k4_pointerTypeAutoselect; else { championIdx++; if (championIdx == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) - _gK104_mousePointerType = k0_pointerTypeArrow; + _mousePointerType = k0_pointerTypeArrow; else if (mousePosY <= 6) - _gK104_mousePointerType = k0_pointerTypeArrow; + _mousePointerType = k0_pointerTypeArrow; else - _gK104_mousePointerType = k4_pointerTypeAutoselect; + _mousePointerType = k4_pointerTypeAutoselect; } } else if (mousePosX >= 224) - _gK104_mousePointerType = k0_pointerTypeArrow; + _mousePointerType = k0_pointerTypeArrow; else - _gK104_mousePointerType = k4_pointerTypeAutoselect; + _mousePointerType = k4_pointerTypeAutoselect; - if (_gK104_mousePointerType == k4_pointerTypeAutoselect) - _gK104_mousePointerType = (_g600_useObjectAsMousePointerBitmap) ? k1_pointerTypeObjectIcon : (_g601_useHandAsMousePointerBitmap) ? k3_pointerTypeHand : k0_pointerTypeArrow; + if (_mousePointerType == k4_pointerTypeAutoselect) + _mousePointerType = (_useObjectAsMousePointerBitmap) ? k1_pointerTypeObjectIcon : (_useHandAsMousePointerBitmap) ? k3_pointerTypeHand : k0_pointerTypeArrow; - if (_g598_mousePointerBitmapUpdated || (_gK104_mousePointerType != _gK105_previousMousePointerType)) { - _g598_mousePointerBitmapUpdated = false; - switch (_gK104_mousePointerType) { + if (_mousePointerBitmapUpdated || (_mousePointerType != _previousMousePointerType)) { + _mousePointerBitmapUpdated = false; + switch (_mousePointerType) { case k0_pointerTypeArrow: setMousePointerFromSpriteData(bitmapArrowPointer); break; case k1_pointerTypeObjectIcon: - CursorMan.replaceCursor(_g615_mousePointerOriginalColorsObject, 32, 18, 0, 0, 0); + CursorMan.replaceCursor(_mousePointerOriginalColorsObject, 32, 18, 0, 0, 0); break; case k2_pointerTypeChampionIcon: - CursorMan.replaceCursor(_g613_mousePointerOriginalColorsChampionIcon, 32, 18, 0, 0, 0); + CursorMan.replaceCursor(_mousePointerOriginalColorsChampionIcon, 32, 18, 0, 0, 0); break; case k3_pointerTypeHand: setMousePointerFromSpriteData(bitmapHanPointer); break; } } - _gK105_previousMousePointerType = _gK104_mousePointerType; - _gK100_preventBuildPointerScreenArea = false; + _previousMousePointerType = _mousePointerType; + _preventBuildPointerScreenArea = false; } -void EventManager::f69_setMousePointer() { +void EventManager::setMousePointer() { if (_vm->_championMan->_leaderEmptyHanded) - f67_setMousePointerToNormal((_vm->_championMan->_leaderIndex == kM1_ChampionNone) ? k0_pointerArrow : k1_pointerHand); + setMousePointerToNormal((_vm->_championMan->_leaderIndex == kM1_ChampionNone) ? k0_pointerArrow : k1_pointerHand); else - f68_setPointerToObject(_vm->_objectMan->_g412_objectIconForMousePointer); + setPointerToObject(_vm->_objectMan->_g412_objectIconForMousePointer); } -void EventManager::f78_showMouse() { - if (_g587_hideMousePointerRequestCount++ == 0) +void EventManager::showMouse() { + if (_hideMousePointerRequestCount++ == 0) CursorMan.showMouse(true); } -void EventManager::f77_hideMouse() { - if (_g587_hideMousePointerRequestCount-- == 1) +void EventManager::hideMouse() { + if (_hideMousePointerRequestCount-- == 1) CursorMan.showMouse(false); } bool EventManager::isMouseButtonDown(MouseButton button) { - return (button != k0_NoneMouseButton) ? (_g558_mouseButtonStatus & button) : (_g558_mouseButtonStatus == 0); + return (button != k0_NoneMouseButton) ? (_mouseButtonStatus & button) : (_mouseButtonStatus == 0); } void EventManager::setMousePos(Common::Point pos) { @@ -618,11 +618,11 @@ Common::EventType EventManager::processInput(Common::Event *grabKey, Common::Eve return event.type; } - if (_g443_primaryKeyboardInput) { - KeyboardInput *input = _g443_primaryKeyboardInput; + if (_primaryKeyboardInput) { + KeyboardInput *input = _primaryKeyboardInput; while (input->_commandToIssue != k0_CommandNone) { if ((input->_key == event.kbd.keycode) && (input->_modifiers == (event.kbd.flags & input->_modifiers))) { - f360_processPendingClick(); // possible fix to BUG0_73 + processPendingClick(); // possible fix to BUG0_73 _commandQueue.push(Command(Common::Point(-1, -1), input->_commandToIssue)); break; } @@ -630,11 +630,11 @@ Common::EventType EventManager::processInput(Common::Event *grabKey, Common::Eve } } - if (_g444_secondaryKeyboardInput) { - KeyboardInput *input = _g444_secondaryKeyboardInput; + if (_secondaryKeyboardInput) { + KeyboardInput *input = _secondaryKeyboardInput; while (input->_commandToIssue != k0_CommandNone) { if ((input->_key == event.kbd.keycode) && (input->_modifiers == (event.kbd.flags & input->_modifiers))) { - f360_processPendingClick(); // possible fix to BUG0_73 + processPendingClick(); // possible fix to BUG0_73 _commandQueue.push(Command(Common::Point(-1, -1), input->_commandToIssue)); break; } @@ -644,27 +644,27 @@ Common::EventType EventManager::processInput(Common::Event *grabKey, Common::Eve break; } case Common::EVENT_MOUSEMOVE: - if (!_g597_ignoreMouseMovements) + if (!_ignoreMouseMovements) _mousePos = event.mouse; break; case Common::EVENT_LBUTTONDOWN: case Common::EVENT_RBUTTONDOWN: { MouseButton button = (event.type == Common::EVENT_LBUTTONDOWN) ? k1_LeftMouseButton : k2_RightMouseButton; - _g558_mouseButtonStatus |= button; + _mouseButtonStatus |= button; if (grabMouseClick) { *grabMouseClick = event; return event.type; } - _g436_pendingClickPresent = true; - _g437_pendingClickPos = _mousePos; - _g439_pendingClickButton = button; + _pendingClickPresent = true; + _pendingClickPos = _mousePos; + _pendingClickButton = button; break; } case Common::EVENT_LBUTTONUP: case Common::EVENT_RBUTTONUP: { MouseButton button = (event.type == Common::EVENT_LBUTTONDOWN) ? k1_LeftMouseButton : k2_RightMouseButton; - _g558_mouseButtonStatus &= ~button; - f544_resetPressingEyeOrMouth(); + _mouseButtonStatus &= ~button; + resetPressingEyeOrMouth(); break; } case Common::EVENT_QUIT: @@ -674,33 +674,33 @@ Common::EventType EventManager::processInput(Common::Event *grabKey, Common::Eve break; } } - if (_g597_ignoreMouseMovements) + if (_ignoreMouseMovements) setMousePos(_mousePos); return Common::EVENT_INVALID; } -void EventManager::f360_processPendingClick() { - if (_g436_pendingClickPresent) { - _g436_pendingClickPresent = false; - f359_processClick(_g437_pendingClickPos, _g439_pendingClickButton); +void EventManager::processPendingClick() { + if (_pendingClickPresent) { + _pendingClickPresent = false; + processClick(_pendingClickPos, _pendingClickButton); } } -void EventManager::f359_processClick(Common::Point mousePos, MouseButton button) { +void EventManager::processClick(Common::Point mousePos, MouseButton button) { CommandType commandType; - commandType = f358_getCommandTypeFromMouseInput(_g441_primaryMouseInput, mousePos, button); + commandType = getCommandTypeFromMouseInput(_primaryMouseInput, mousePos, button); if (commandType == k0_CommandNone) - commandType = f358_getCommandTypeFromMouseInput(_g442_secondaryMouseInput, mousePos, button); + commandType = getCommandTypeFromMouseInput(_secondaryMouseInput, mousePos, button); if (commandType != k0_CommandNone) _commandQueue.push(Command(mousePos, commandType)); - _g435_isCommandQueueLocked = false; + _isCommandQueueLocked = false; } -CommandType EventManager::f358_getCommandTypeFromMouseInput(MouseInput *input, Common::Point mousePos, MouseButton button) { +CommandType EventManager::getCommandTypeFromMouseInput(MouseInput *input, Common::Point mousePos, MouseButton button) { if (!input) return k0_CommandNone; @@ -713,51 +713,51 @@ CommandType EventManager::f358_getCommandTypeFromMouseInput(MouseInput *input, C return commandType; } -void EventManager::f380_processCommandQueue() { +void EventManager::processCommandQueue() { static KeyboardInput *primaryKeyboardInputBackup; static KeyboardInput *secondaryKeyboardInputBackup; static MouseInput *primaryMouseInputBackup; static MouseInput *secondaryMouseInputBackup; - _g435_isCommandQueueLocked = true; + _isCommandQueueLocked = true; if (_commandQueue.empty()) { /* If the command queue is empty */ - _g435_isCommandQueueLocked = false; - f360_processPendingClick(); + _isCommandQueueLocked = false; + processPendingClick(); return; } Command cmd = _commandQueue.pop(); CommandType cmdType = cmd._type; if ((cmdType >= k3_CommandMoveForward) && (cmdType <= k6_CommandMoveLeft) && (_vm->_disabledMovementTicks || (_vm->_projectileDisableMovementTicks && (_vm->_lastProjectileDisabledMovementDirection == (normalizeModulo4(_vm->_dungeonMan->_partyDir + cmdType - k3_CommandMoveForward)))))) { /* If movement is disabled */ - _g435_isCommandQueueLocked = false; - f360_processPendingClick(); + _isCommandQueueLocked = false; + processPendingClick(); return; } int16 commandX = cmd._pos.x; int16 commandY = cmd._pos.y; - _g435_isCommandQueueLocked = false; - f360_processPendingClick(); + _isCommandQueueLocked = false; + processPendingClick(); if ((cmdType == k2_CommandTurnRight) || (cmdType == k1_CommandTurnLeft)) { - f365_commandTurnParty(cmdType); + commandTurnParty(cmdType); return; } if ((cmdType >= k3_CommandMoveForward) && (cmdType <= k6_CommandMoveLeft)) { - f366_commandMoveParty(cmdType); + commandMoveParty(cmdType); return; } if ((cmdType >= k12_CommandClickInChampion_0_StatusBox) && (cmdType <= k15_CommandClickInChampion_3_StatusBox)) { int16 championIdx = cmdType - k12_CommandClickInChampion_0_StatusBox; if ((championIdx < _vm->_championMan->_partyChampionCount) && !_vm->_championMan->_candidateChampionOrdinal) - f367_commandProcessTypes12to27_clickInChampionStatusBox(championIdx, commandX, commandY); + commandProcessTypes12to27_clickInChampionStatusBox(championIdx, commandX, commandY); return; } if ((cmdType >= k125_CommandClickOnChamptionIcon_Top_Left) && (cmdType <= k128_CommandClickOnChamptionIcon_Lower_Left)) { - f70_mouseProcessCommands125To128_clickOnChampionIcon(cmdType - k125_CommandClickOnChamptionIcon_Top_Left); + mouseProcessCommands125To128_clickOnChampionIcon(cmdType - k125_CommandClickOnChamptionIcon_Top_Left); return; } @@ -794,14 +794,14 @@ void EventManager::f380_processCommandQueue() { if (cmdType == k100_CommandClickInSpellArea) { if ((!_vm->_championMan->_candidateChampionOrdinal) && (_vm->_championMan->_magicCasterChampionIndex != kM1_ChampionNone)) - f370_commandProcessType100_clickInSpellArea(commandX, commandY); + commandProcessType100_clickInSpellArea(commandX, commandY); return; } if (cmdType == k111_CommandClickInActionArea) { if (!_vm->_championMan->_candidateChampionOrdinal) - f371_commandProcessType111To115_ClickInActionArea(commandX, commandY); + commandProcessType111To115_ClickInActionArea(commandX, commandY); return; } @@ -817,11 +817,11 @@ void EventManager::f380_processCommandQueue() { } if (cmdType == k80_CommandClickInDungeonView) { - f377_commandProcessType80ClickInDungeonView(commandX, commandY); + commandProcessType80ClickInDungeonView(commandX, commandY); return; } if (cmdType == k81_CommandClickInPanel) { - f378_commandProcess81ClickInPanel(commandX, commandY); + commandProcess81ClickInPanel(commandX, commandY); return; } @@ -835,14 +835,14 @@ void EventManager::f380_processCommandQueue() { _vm->_menuMan->f456_drawDisabledMenu(); _vm->_championMan->_partyIsSleeping = true; - f379_drawSleepScreen(); + drawSleepScreen(); _vm->_displayMan->f97_drawViewport(k2_viewportAsBeforeSleepOrFreezeGame); _vm->_waitForInputMaxVerticalBlankCount = 0; - _g441_primaryMouseInput = _primaryMouseInputPartySleeping; - _g442_secondaryMouseInput = 0; - _g443_primaryKeyboardInput = _primaryKeyboardInputPartySleeping; - _g444_secondaryKeyboardInput = nullptr; - f357_discardAllInput(); + _primaryMouseInput = _primaryMouseInputPartySleeping; + _secondaryMouseInput = 0; + _primaryKeyboardInput = _primaryKeyboardInputPartySleeping; + _secondaryKeyboardInput = nullptr; + discardAllInput(); } return; } @@ -880,26 +880,26 @@ void EventManager::f380_processCommandQueue() { break; } _vm->_displayMan->f97_drawViewport(k2_viewportAsBeforeSleepOrFreezeGame); - primaryMouseInputBackup = _g441_primaryMouseInput; - secondaryMouseInputBackup = _g442_secondaryMouseInput; - primaryKeyboardInputBackup = _g443_primaryKeyboardInput; - secondaryKeyboardInputBackup = _g444_secondaryKeyboardInput; - _g441_primaryMouseInput = _primaryMouseInputFrozenGame; - _g442_secondaryMouseInput = 0; - _g443_primaryKeyboardInput = _primaryKeyboardInputFrozenGame; - _g444_secondaryKeyboardInput = nullptr; - f357_discardAllInput(); + primaryMouseInputBackup = _primaryMouseInput; + secondaryMouseInputBackup = _secondaryMouseInput; + primaryKeyboardInputBackup = _primaryKeyboardInput; + secondaryKeyboardInputBackup = _secondaryKeyboardInput; + _primaryMouseInput = _primaryMouseInputFrozenGame; + _secondaryMouseInput = 0; + _primaryKeyboardInput = _primaryKeyboardInputFrozenGame; + _secondaryKeyboardInput = nullptr; + discardAllInput(); return; } if (cmdType == k148_CommandUnfreezeGame) { _vm->_gameTimeTicking = true; _vm->_menuMan->f457_drawEnabledMenus(); - _g441_primaryMouseInput = primaryMouseInputBackup; - _g442_secondaryMouseInput = secondaryMouseInputBackup; - _g443_primaryKeyboardInput = primaryKeyboardInputBackup; - _g444_secondaryKeyboardInput = secondaryKeyboardInputBackup; - f357_discardAllInput(); + _primaryMouseInput = primaryMouseInputBackup; + _secondaryMouseInput = secondaryMouseInputBackup; + _primaryKeyboardInput = primaryKeyboardInputBackup; + _secondaryKeyboardInput = secondaryKeyboardInputBackup; + discardAllInput(); return; } @@ -927,16 +927,16 @@ void EventManager::f380_processCommandQueue() { _vm->_restartGameRequest = true; } -void EventManager::f365_commandTurnParty(CommandType cmdType) { +void EventManager::commandTurnParty(CommandType cmdType) { _vm->_stopWaitingForPlayerInput = true; if (cmdType == k1_CommandTurnLeft) - f362_commandHighlightBoxEnable(234, 261, 125, 145); + commandHighlightBoxEnable(234, 261, 125, 145); else - f362_commandHighlightBoxEnable(291, 318, 125, 145); + commandHighlightBoxEnable(291, 318, 125, 145); uint16 partySquare = _vm->_dungeonMan->getSquare(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY).toByte(); if (Square(partySquare).getType() == k3_StairsElemType) { - f364_commandTakeStairs(getFlag(partySquare, k0x0004_StairsUp)); + commandTakeStairs(getFlag(partySquare, k0x0004_StairsUp)); return; } @@ -945,7 +945,7 @@ void EventManager::f365_commandTurnParty(CommandType cmdType) { _vm->_moveSens->f276_sensorProcessThingAdditionOrRemoval(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, Thing::_party, true, true); } -void EventManager::f366_commandMoveParty(CommandType cmdType) { +void EventManager::commandMoveParty(CommandType cmdType) { static Box boxMovementArrows[4] = { // @ G0463_as_Graphic561_Box_MovementArrows /* { X1, X2, Y1, Y2 } */ Box(263, 289, 125, 145), /* Forward */ @@ -976,13 +976,13 @@ void EventManager::f366_commandMoveParty(CommandType cmdType) { } uint16 movementArrowIdx = cmdType - k3_CommandMoveForward; Box *highlightBox = &boxMovementArrows[movementArrowIdx]; - f362_commandHighlightBoxEnable(highlightBox->_x1, highlightBox->_x2, highlightBox->_y1, highlightBox->_y2); + commandHighlightBoxEnable(highlightBox->_x1, highlightBox->_x2, highlightBox->_y1, highlightBox->_y2); int16 partyMapX = _vm->_dungeonMan->_partyMapX; int16 partyMapY = _vm->_dungeonMan->_partyMapY; uint16 AL1115_ui_Square = _vm->_dungeonMan->getSquare(partyMapX, partyMapY).toByte(); bool isStairsSquare = (Square(AL1115_ui_Square).getType() == k3_StairsElemType); if (isStairsSquare && (movementArrowIdx == 2)) { /* If moving backward while in stairs */ - f364_commandTakeStairs(getFlag(AL1115_ui_Square, k0x0004_StairsUp)); + commandTakeStairs(getFlag(AL1115_ui_Square, k0x0004_StairsUp)); return; } _vm->_dungeonMan->mapCoordsAfterRelMovement(_vm->_dungeonMan->_partyDir, movementArrowToStepForwardCount[movementArrowIdx], movementArrowToSepRightCount[movementArrowIdx], partyMapX, partyMapY); @@ -991,7 +991,7 @@ void EventManager::f366_commandMoveParty(CommandType cmdType) { _vm->_moveSens->f267_getMoveResult(Thing::_party, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kM1_MapXNotOnASquare, 0); _vm->_dungeonMan->_partyMapX = partyMapX; _vm->_dungeonMan->_partyMapY = partyMapY; - f364_commandTakeStairs(getFlag(AL1115_ui_Square, k0x0004_StairsUp)); + commandTakeStairs(getFlag(AL1115_ui_Square, k0x0004_StairsUp)); return; } @@ -1024,7 +1024,7 @@ void EventManager::f366_commandMoveParty(CommandType cmdType) { // DEBUG CODE: check for Console flag if (isMovementBlocked && !_vm->_console->_debugNoclip) { - f357_discardAllInput(); + discardAllInput(); _vm->_stopWaitingForPlayerInput = false; return; } @@ -1046,7 +1046,7 @@ void EventManager::f366_commandMoveParty(CommandType cmdType) { _vm->_projectileDisableMovementTicks = 0; } -bool EventManager::f375_processType80_clickDungeonView_isLeaderHandObjThrown(int16 posX, int16 posY) { +bool EventManager::isLeaderHandObjThrown(int16 posX, int16 posY) { #define k0_sideLeft 0 // @ C0_SIDE_LEFT #define k1_sideRight 1 // @ C0_SIDE_LEFT @@ -1101,7 +1101,7 @@ void EventManager::setMousePointerFromSpriteData(byte* mouseSprite) { CursorMan.replaceCursor(bitmap, 16, 18, 0, 0, 0); } -void EventManager::f368_commandSetLeader(ChampionIndex champIndex) { +void EventManager::commandSetLeader(ChampionIndex champIndex) { ChampionMan &cm = *_vm->_championMan; ChampionIndex leaderIndex; @@ -1131,7 +1131,7 @@ void EventManager::f368_commandSetLeader(ChampionIndex champIndex) { } } -void EventManager::f372_commandProcessType80ClickInDungeonViewTouchFrontWall() { +void EventManager::commandProcessType80ClickInDungeonViewTouchFrontWall() { uint16 mapX = _vm->_dungeonMan->_partyMapX + _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir]; uint16 mapY = _vm->_dungeonMan->_partyMapY + _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_partyDir]; @@ -1140,7 +1140,7 @@ void EventManager::f372_commandProcessType80ClickInDungeonViewTouchFrontWall() { _vm->_stopWaitingForPlayerInput = _vm->_moveSens->f275_sensorIsTriggeredByClickOnWall(mapX, mapY, returnOppositeDir(_vm->_dungeonMan->_partyDir)); } -void EventManager::f377_commandProcessType80ClickInDungeonView(int16 posX, int16 posY) { +void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY) { Box boxObjectPiles[4] = { // @ G0462_as_Graphic561_Box_ObjectPiles /* { X1, X2, Y1, Y2 } */ Box(24, 111, 148, 168), /* Front left */ @@ -1164,7 +1164,7 @@ void EventManager::f377_commandProcessType80ClickInDungeonView(int16 posX, int16 _vm->_moveSens->f268_addEvent(k10_TMEventTypeDoor, L1155_i_MapX, L1156_i_MapY, 0, k2_SensorEffToggle, _vm->_gameTime + 1); return; } - } else if (f375_processType80_clickDungeonView_isLeaderHandObjThrown(posX, posY)) + } else if (isLeaderHandObjThrown(posX, posY)) return; } @@ -1173,9 +1173,9 @@ void EventManager::f377_commandProcessType80ClickInDungeonView(int16 posX, int16 if (_vm->_dungeonMan->_dungeonViewClickableBoxes[currViewCell].isPointInside(posX, posY - 33)) { if (currViewCell == k5_ViewCellDoorButtonOrWallOrn) { if (!_vm->_dungeonMan->_isFacingAlcove) - f372_commandProcessType80ClickInDungeonViewTouchFrontWall(); + commandProcessType80ClickInDungeonViewTouchFrontWall(); } else - f373_processType80_clickInDungeonView_grabLeaderHandObject(currViewCell); + processType80_clickInDungeonView_grabLeaderHandObject(currViewCell); return; } @@ -1186,13 +1186,13 @@ void EventManager::f377_commandProcessType80ClickInDungeonView(int16 posX, int16 if (_vm->_dungeonMan->_squareAheadElement == k0_ElementTypeWall) { for (uint16 currViewCell = k0_ViewCellFronLeft; currViewCell < k1_ViewCellFrontRight + 1; currViewCell++) { if (boxObjectPiles[currViewCell].isPointInside(posX, posY)) { - f374_processType80_clickInDungeonViewDropLeaderHandObject(currViewCell); + processType80_clickInDungeonViewDropLeaderHandObject(currViewCell); return; } } if (_vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn].isPointInside(posX, posY - 33)) { if (_vm->_dungeonMan->_isFacingAlcove) - f374_processType80_clickInDungeonViewDropLeaderHandObject(k4_ViewCellAlcove); + processType80_clickInDungeonViewDropLeaderHandObject(k4_ViewCellAlcove); else { if (_vm->_dungeonMan->_isFacingFountain) { uint16 iconIdx = _vm->_objectMan->f33_getIconIndex(thingHandObject); @@ -1202,22 +1202,22 @@ void EventManager::f377_commandProcessType80ClickInDungeonView(int16 posX, int16 else if (iconIdx == k195_IconIndicePotionEmptyFlask) ((Potion*)junkPtr)->setType(k15_PotionTypeWaterFlask); else { - f372_commandProcessType80ClickInDungeonViewTouchFrontWall(); + commandProcessType80ClickInDungeonViewTouchFrontWall(); return; } _vm->_championMan->drawChangedObjectIcons(); _vm->_championMan->_champions[_vm->_championMan->_leaderIndex]._load += _vm->_dungeonMan->getObjectWeight(thingHandObject) - weight; } - f372_commandProcessType80ClickInDungeonViewTouchFrontWall(); + commandProcessType80ClickInDungeonViewTouchFrontWall(); } } } else { - if (f375_processType80_clickDungeonView_isLeaderHandObjThrown(posX, posY)) + if (isLeaderHandObjThrown(posX, posY)) return; for (uint16 currViewCell = k0_ViewCellFronLeft; currViewCell < k3_ViewCellBackLeft + 1; currViewCell++) { if (boxObjectPiles[currViewCell].isPointInside(posX, posY)) { - f374_processType80_clickInDungeonViewDropLeaderHandObject(currViewCell); + processType80_clickInDungeonViewDropLeaderHandObject(currViewCell); return; } } @@ -1225,7 +1225,7 @@ void EventManager::f377_commandProcessType80ClickInDungeonView(int16 posX, int16 } } -void EventManager::f282_commandProcessCommands160To162ClickInResurrectReincarnatePanel(CommandType commandType) { +void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePanel(CommandType commandType) { ChampionMan &champMan = *_vm->_championMan; InventoryMan &invMan = *_vm->_inventoryMan; DisplayMan &dispMan = *_vm->_displayMan; @@ -1237,7 +1237,7 @@ void EventManager::f282_commandProcessCommands160To162ClickInResurrectReincarnat invMan.f355_toggleInventory(k4_ChampionCloseInventory); champMan._candidateChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone); if (champMan._partyChampionCount == 1) { - f368_commandSetLeader(kM1_ChampionNone); + commandSetLeader(kM1_ChampionNone); } champMan._partyChampionCount--; Box box; @@ -1249,7 +1249,7 @@ void EventManager::f282_commandProcessCommands160To162ClickInResurrectReincarnat dispMan.D24_fillScreenBox(box, k0_ColorBlack); dispMan.D24_fillScreenBox(_vm->_championMan->_boxChampionIcons[champMan.getChampionIconIndex(champ->_cell, dunMan._partyDir) * 2], k0_ColorBlack); _vm->_menuMan->f457_drawEnabledMenus(); - f78_showMouse(); + showMouse(); return; } @@ -1287,7 +1287,7 @@ void EventManager::f282_commandProcessCommands160To162ClickInResurrectReincarnat if (champMan._partyChampionCount == 1) { _vm->_projexpl->_g362_lastPartyMovementTime = _vm->_gameTime; - f368_commandSetLeader(k0_ChampionFirst); + commandSetLeader(k0_ChampionFirst); _vm->_menuMan->f394_setMagicCasterAndDrawSpellArea(k0_ChampionFirst); } else _vm->_menuMan->f393_drawSpellAreaControls(champMan._magicCasterChampionIndex); @@ -1311,10 +1311,10 @@ void EventManager::f282_commandProcessCommands160To162ClickInResurrectReincarnat invMan.f355_toggleInventory(k4_ChampionCloseInventory); _vm->_menuMan->f457_drawEnabledMenus(); - f67_setMousePointerToNormal((_vm->_championMan->_leaderIndex == kM1_ChampionNone) ? k0_pointerArrow : k1_pointerHand); + setMousePointerToNormal((_vm->_championMan->_leaderIndex == kM1_ChampionNone) ? k0_pointerArrow : k1_pointerHand); } -void EventManager::f378_commandProcess81ClickInPanel(int16 x, int16 y) { +void EventManager::commandProcess81ClickInPanel(int16 x, int16 y) { ChampionMan &champMan = *_vm->_championMan; InventoryMan &invMan = *_vm->_inventoryMan; @@ -1323,23 +1323,23 @@ void EventManager::f378_commandProcess81ClickInPanel(int16 x, int16 y) { case k4_PanelContentChest: if (champMan._leaderIndex == kM1_ChampionNone) // if no leader return; - commandType = f358_getCommandTypeFromMouseInput(_mouseInputPanelChest, Common::Point(x, y), k1_LeftMouseButton); + commandType = getCommandTypeFromMouseInput(_mouseInputPanelChest, Common::Point(x, y), k1_LeftMouseButton); if (commandType != k0_CommandNone) _vm->_championMan->clickOnSlotBox(commandType - k20_CommandClickOnSlotBoxChampion_0_StatusBoxReadyHand); break; case k5_PanelContentResurrectReincarnate: if (!champMan._leaderEmptyHanded) break; - commandType = f358_getCommandTypeFromMouseInput(_mouseInputPanelResurrectReincarnateCancel, Common::Point(x, y), k1_LeftMouseButton); + commandType = getCommandTypeFromMouseInput(_mouseInputPanelResurrectReincarnateCancel, Common::Point(x, y), k1_LeftMouseButton); if (commandType != k0_CommandNone) - f282_commandProcessCommands160To162ClickInResurrectReincarnatePanel(commandType); + commandProcessCommands160To162ClickInResurrectReincarnatePanel(commandType); break; default: break; } } -void EventManager::f373_processType80_clickInDungeonView_grabLeaderHandObject(uint16 viewCell) { +void EventManager::processType80_clickInDungeonView_grabLeaderHandObject(uint16 viewCell) { if (_vm->_championMan->_leaderIndex == kM1_ChampionNone) return; @@ -1364,7 +1364,7 @@ void EventManager::f373_processType80_clickInDungeonView_grabLeaderHandObject(ui _vm->_stopWaitingForPlayerInput = true; } -void EventManager::f374_processType80_clickInDungeonViewDropLeaderHandObject(uint16 viewCell) { +void EventManager::processType80_clickInDungeonViewDropLeaderHandObject(uint16 viewCell) { if (_vm->_championMan->_leaderIndex == kM1_ChampionNone) return; @@ -1395,14 +1395,14 @@ void EventManager::f374_processType80_clickInDungeonViewDropLeaderHandObject(uin _vm->_stopWaitingForPlayerInput = true; } -bool EventManager::f360_hasPendingClick(Common::Point& point, MouseButton button) { - if (_g439_pendingClickButton && button == _g439_pendingClickButton) - point = _g437_pendingClickPos; +bool EventManager::hasPendingClick(Common::Point& point, MouseButton button) { + if (_pendingClickButton && button == _pendingClickButton) + point = _pendingClickPos; - return _g436_pendingClickPresent; + return _pendingClickPresent; } -void EventManager::f379_drawSleepScreen() { +void EventManager::drawSleepScreen() { _vm->_displayMan->f134_fillBitmap(_vm->_displayMan->_g296_bitmapViewport, k0_ColorBlack, 112, 136); switch (_vm->getGameLanguage()) { // localized default: @@ -1418,7 +1418,7 @@ void EventManager::f379_drawSleepScreen() { } } -void EventManager::f357_discardAllInput() { +void EventManager::discardAllInput() { Common::Event event; while (_vm->_system->getEventManager()->pollEvent(event) && !_vm->_engineShouldQuit) { if (event.type == Common::EVENT_QUIT) @@ -1427,7 +1427,7 @@ void EventManager::f357_discardAllInput() { _commandQueue.clear(); } -void EventManager::f364_commandTakeStairs(bool stairsGoDown) { +void EventManager::commandTakeStairs(bool stairsGoDown) { _vm->_moveSens->f267_getMoveResult(Thing::_party, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kM1_MapXNotOnASquare, 0); _vm->_newPartyMapIndex = _vm->_dungeonMan->getLocationAfterLevelChange(_vm->_dungeonMan->_partyMapIndex, stairsGoDown ? -1 : 1, &_vm->_dungeonMan->_partyMapX, &_vm->_dungeonMan->_partyMapY); _vm->_dungeonMan->setCurrentMap(_vm->_newPartyMapIndex); @@ -1435,45 +1435,45 @@ void EventManager::f364_commandTakeStairs(bool stairsGoDown) { _vm->_dungeonMan->setCurrentMap(_vm->_dungeonMan->_partyMapIndex); } -void EventManager::f367_commandProcessTypes12to27_clickInChampionStatusBox(uint16 champIndex, int16 posX, int16 posY) { +void EventManager::commandProcessTypes12to27_clickInChampionStatusBox(uint16 champIndex, int16 posX, int16 posY) { if (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) { - f368_commandSetLeader((ChampionIndex)champIndex); + commandSetLeader((ChampionIndex)champIndex); } else { - uint16 commandType = f358_getCommandTypeFromMouseInput(_mouseInputChampionNamesHands, Common::Point(posX, posY), k1_LeftMouseButton); + uint16 commandType = getCommandTypeFromMouseInput(_mouseInputChampionNamesHands, Common::Point(posX, posY), k1_LeftMouseButton); if ((commandType >= k16_CommandSetLeaderChampion_0) && (commandType <= k19_CommandSetLeaderChampion_3)) - f368_commandSetLeader((ChampionIndex)(commandType - k16_CommandSetLeaderChampion_0)); + commandSetLeader((ChampionIndex)(commandType - k16_CommandSetLeaderChampion_0)); else if ((commandType >= k20_CommandClickOnSlotBoxChampion_0_StatusBoxReadyHand) && (commandType <= k27_CommandClickOnSlotBoxChampion_3_StatusBoxActionHand)) _vm->_championMan->clickOnSlotBox(commandType - k20_CommandClickOnSlotBoxChampion_0_StatusBoxReadyHand); } } -void EventManager::f70_mouseProcessCommands125To128_clickOnChampionIcon(uint16 champIconIndex) { +void EventManager::mouseProcessCommands125To128_clickOnChampionIcon(uint16 champIconIndex) { static Box championIconShadowBox = Box(2, 20, 2, 15); static Box championIconBox = Box(0, 18, 0, 13); static byte mousePointerIconShadowBox[16] = {0, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 0, 120, 120, 120}; - _gK100_preventBuildPointerScreenArea = true; - if (!_g599_useChampionIconOrdinalAsMousePointerBitmap) { + _preventBuildPointerScreenArea = true; + if (!_useChampionIconOrdinalAsMousePointerBitmap) { if (_vm->_championMan->getIndexInCell(normalizeModulo4(champIconIndex + _vm->_dungeonMan->_partyDir)) == kM1_ChampionNone) { - _gK100_preventBuildPointerScreenArea = false; + _preventBuildPointerScreenArea = false; return; } - _g598_mousePointerBitmapUpdated = true; - _g599_useChampionIconOrdinalAsMousePointerBitmap = true; + _mousePointerBitmapUpdated = true; + _useChampionIconOrdinalAsMousePointerBitmap = true; _vm->_displayMan->_g578_useByteBoxCoordinates = false; - byte *tmpBitmap = _gK190_mousePointerTempBuffer; + byte *tmpBitmap = _mousePointerTempBuffer; memset(tmpBitmap, 0, 32 * 18); Box *curChampionIconBox = &_vm->_championMan->_boxChampionIcons[champIconIndex]; _vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->_g348_bitmapScreen, tmpBitmap, championIconShadowBox, curChampionIconBox->_x1, curChampionIconBox->_y1, k160_byteWidthScreen, k16_byteWidth, k0_ColorBlack, 200, 18); - _vm->_displayMan->f129_blitToBitmapShrinkWithPalChange(tmpBitmap, _g613_mousePointerOriginalColorsChampionIcon, 32, 18, 32, 18, mousePointerIconShadowBox); - _vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->_g348_bitmapScreen, _g613_mousePointerOriginalColorsChampionIcon, championIconBox, curChampionIconBox->_x1, curChampionIconBox->_y1, k160_byteWidthScreen, k16_byteWidth, k0_ColorBlack, 200, 18); + _vm->_displayMan->f129_blitToBitmapShrinkWithPalChange(tmpBitmap, _mousePointerOriginalColorsChampionIcon, 32, 18, 32, 18, mousePointerIconShadowBox); + _vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->_g348_bitmapScreen, _mousePointerOriginalColorsChampionIcon, championIconBox, curChampionIconBox->_x1, curChampionIconBox->_y1, k160_byteWidthScreen, k16_byteWidth, k0_ColorBlack, 200, 18); _vm->_displayMan->D24_fillScreenBox(*curChampionIconBox, k0_ColorBlack); - _g599_useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(champIconIndex); + _useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(champIconIndex); } else { - _g598_mousePointerBitmapUpdated = true; - uint16 championIconIndex = _vm->ordinalToIndex(_g599_useChampionIconOrdinalAsMousePointerBitmap); - _g599_useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(kM1_ChampionNone); + _mousePointerBitmapUpdated = true; + uint16 championIconIndex = _vm->ordinalToIndex(_useChampionIconOrdinalAsMousePointerBitmap); + _useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(kM1_ChampionNone); int16 championCellIndex = _vm->_championMan->getIndexInCell(normalizeModulo4(championIconIndex + _vm->_dungeonMan->_partyDir)); if (championIconIndex == champIconIndex) { setFlag(_vm->_championMan->_champions[championCellIndex]._attributes, k0x0400_ChampionAttributeIcon); @@ -1492,11 +1492,11 @@ void EventManager::f70_mouseProcessCommands125To128_clickOnChampionIcon(uint16 c _vm->_championMan->drawChampionState((ChampionIndex)championCellIndex); } } - _gK100_preventBuildPointerScreenArea = false; - f73_buildpointerScreenArea(_mousePos.x, _mousePos.y); + _preventBuildPointerScreenArea = false; + buildpointerScreenArea(_mousePos.x, _mousePos.y); } -void EventManager::f370_commandProcessType100_clickInSpellArea(uint16 posX, uint16 posY) { +void EventManager::commandProcessType100_clickInSpellArea(uint16 posX, uint16 posY) { int16 championIndex = kM1_ChampionNone; if (posY <= 48) { switch (_vm->_championMan->_magicCasterChampionIndex) { @@ -1545,12 +1545,12 @@ void EventManager::f370_commandProcessType100_clickInSpellArea(uint16 posX, uint return; } - CommandType newCommand = f358_getCommandTypeFromMouseInput(_mouseInputSpellArea, Common::Point(posX, posY), k1_LeftMouseButton); + CommandType newCommand = getCommandTypeFromMouseInput(_mouseInputSpellArea, Common::Point(posX, posY), k1_LeftMouseButton); if (newCommand != k0_CommandNone) - f369_commandProcessTypes101To108_clickInSpellSymbolsArea(newCommand); + commandProcessTypes101To108_clickInSpellSymbolsArea(newCommand); } -void EventManager::f369_commandProcessTypes101To108_clickInSpellSymbolsArea(CommandType cmdType) { +void EventManager::commandProcessTypes101To108_clickInSpellSymbolsArea(CommandType cmdType) { static Box spellSymbolsAndDelete[7] = { /* { X1, X2, Y1, Y2 } */ Box(235, 247, 51, 61), /* Symbol 1 */ @@ -1565,16 +1565,16 @@ void EventManager::f369_commandProcessTypes101To108_clickInSpellSymbolsArea(Comm if (_vm->_championMan->_champions[_vm->_championMan->_magicCasterChampionIndex]._symbols[0] == '\0') return; - f362_commandHighlightBoxEnable(234, 303, 63, 73); + commandHighlightBoxEnable(234, 303, 63, 73); _vm->_stopWaitingForPlayerInput = _vm->_menuMan->f408_getClickOnSpellCastResult(); return; } uint16 symbolIndex = cmdType - k101_CommandClickInSpellAreaSymbol_1; Box *highlightBox = &spellSymbolsAndDelete[symbolIndex]; - f362_commandHighlightBoxEnable(highlightBox->_x1, highlightBox->_x2, highlightBox->_y1, highlightBox->_y2); + commandHighlightBoxEnable(highlightBox->_x1, highlightBox->_x2, highlightBox->_y1, highlightBox->_y2); _vm->delay(1); - f363_highlightBoxDisable(); + highlightBoxDisable(); if (symbolIndex < 6) _vm->_menuMan->f399_addChampionSymbol(symbolIndex); @@ -1582,26 +1582,26 @@ void EventManager::f369_commandProcessTypes101To108_clickInSpellSymbolsArea(Comm _vm->_menuMan->f400_deleteChampionSymbol(); } -void EventManager::f371_commandProcessType111To115_ClickInActionArea(int16 posX, int16 posY) { +void EventManager::commandProcessType111To115_ClickInActionArea(int16 posX, int16 posY) { if (_vm->_championMan->_actingChampionOrdinal) { - uint16 mouseCommand = f358_getCommandTypeFromMouseInput(_mouseInputActionAreaNames, Common::Point(posX, posY), k1_LeftMouseButton); + uint16 mouseCommand = getCommandTypeFromMouseInput(_mouseInputActionAreaNames, Common::Point(posX, posY), k1_LeftMouseButton); if (mouseCommand != k0_CommandNone) { if (mouseCommand == k112_CommandClickInActionAreaPass) { - f362_commandHighlightBoxEnable(285, 319, 77, 83); + commandHighlightBoxEnable(285, 319, 77, 83); _vm->_menuMan->f391_didClickTriggerAction(-1); } else if ((mouseCommand - k112_CommandClickInActionAreaPass) <= _vm->_menuMan->_g507_actionCount) { if (mouseCommand == k113_CommandClickInActionAreaAction_0) - f362_commandHighlightBoxEnable(234, 318, 86, 96); + commandHighlightBoxEnable(234, 318, 86, 96); else if (mouseCommand == k114_CommandClickInActionAreaAction_1) - f362_commandHighlightBoxEnable(234, 318, 98, 108); + commandHighlightBoxEnable(234, 318, 98, 108); else - f362_commandHighlightBoxEnable(234, 318, 110, 120); + commandHighlightBoxEnable(234, 318, 110, 120); _vm->_stopWaitingForPlayerInput = _vm->_menuMan->f391_didClickTriggerAction(mouseCommand - k113_CommandClickInActionAreaAction_0); } } } else if (_vm->_menuMan->_g509_actionAreaContainsIcons) { - uint16 mouseCommand = f358_getCommandTypeFromMouseInput(_mouseInputActionAreaIcons, Common::Point(posX, posY), k1_LeftMouseButton); + uint16 mouseCommand = getCommandTypeFromMouseInput(_mouseInputActionAreaIcons, Common::Point(posX, posY), k1_LeftMouseButton); if (mouseCommand != k0_CommandNone) { mouseCommand -= k116_CommandClickInActionAreaChampion_0_Action; if (mouseCommand < _vm->_championMan->_partyChampionCount) @@ -1610,19 +1610,19 @@ void EventManager::f371_commandProcessType111To115_ClickInActionArea(int16 posX, } } -void EventManager::f544_resetPressingEyeOrMouth() { +void EventManager::resetPressingEyeOrMouth() { if (_vm->_pressingEye) { - _g597_ignoreMouseMovements = false; + _ignoreMouseMovements = false; _vm->_stopPressingEye = true; } if (_vm->_pressingMouth) { - _g597_ignoreMouseMovements = false; + _ignoreMouseMovements = false; _vm->_stopPressingMouth = true; } } -void EventManager::f541_waitForMouseOrKeyActivity() { - f357_discardAllInput(); +void EventManager::waitForMouseOrKeyActivity() { + discardAllInput(); Common::Event event; while (true) { if (_vm->_system->getEventManager()->pollEvent(event)) { @@ -1642,16 +1642,16 @@ void EventManager::f541_waitForMouseOrKeyActivity() { } } -void EventManager::f362_commandHighlightBoxEnable(int16 x1, int16 x2, int16 y1, int16 y2) { +void EventManager::commandHighlightBoxEnable(int16 x1, int16 x2, int16 y1, int16 y2) { _highlightScreenBox = Box(x1, x2, y1, y2); - f6_highlightScreenBox(x1, x2, y1, y2); - _g341_highlightBoxEnabled = true; + highlightScreenBox(x1, x2, y1, y2); + _highlightBoxEnabled = true; } -void EventManager::f363_highlightBoxDisable() { - if (_g341_highlightBoxEnabled == true) { - f6_highlightScreenBox(_highlightScreenBox._x1, _highlightScreenBox._x2, _highlightScreenBox._y1, _highlightScreenBox._y2); - _g341_highlightBoxEnabled = false; +void EventManager::highlightBoxDisable() { + if (_highlightBoxEnabled == true) { + highlightScreenBox(_highlightScreenBox._x1, _highlightScreenBox._x2, _highlightScreenBox._y1, _highlightScreenBox._y2); + _highlightBoxEnabled = false; } } diff --git a/engines/dm/eventman.h b/engines/dm/eventman.h index 1066f35fb68..5686e50be76 100644 --- a/engines/dm/eventman.h +++ b/engines/dm/eventman.h @@ -36,11 +36,8 @@ #include "gfx.h" #include "champion.h" - namespace DM { - - enum MouseButton { k0_NoneMouseButton = 0, // present only because of typesafety k1_LeftMouseButton = 1, @@ -201,35 +198,32 @@ class DMEngine; #define k3_pointerTypeHand 3 // @ C3_POINTER_TYPE_HAND #define k4_pointerTypeAutoselect 4 // @ C4_POINTER_TYPE_AUTOSELECT - - - class EventManager { DMEngine *_vm; Common::Point _mousePos; uint16 _dummyMapIndex; - bool _g436_pendingClickPresent; // G0436_B_PendingClickPresent - Common::Point _g437_pendingClickPos; // @ G0437_i_PendingClickX, G0438_i_PendingClickY - MouseButton _g439_pendingClickButton; // @ G0439_i_PendingClickButtonsStatus - bool _g600_useObjectAsMousePointerBitmap; // @ G0600_B_UseObjectAsMousePointerBitmap - bool _g601_useHandAsMousePointerBitmap; // @ G0601_B_UseHandAsMousePointerBitmap - bool _gK100_preventBuildPointerScreenArea; // @ K0100_B_PreventBuildPointerScreenArea - byte *_g615_mousePointerOriginalColorsObject; // @ G0615_puc_Bitmap_MousePointerOriginalColorsObject - byte *_g613_mousePointerOriginalColorsChampionIcon; // @ G0613_puc_Bitmap_MousePointerOriginalColorsChampionIcon - byte *_gK190_mousePointerTempBuffer; // @ K0190_puc_Bitmap_MousePointerTemporaryBuffer - int16 _gK104_mousePointerType; // @ K0104_i_MousePointerType - int16 _gK105_previousMousePointerType; // @ K0105_i_PreviousMousePointerType - uint16 _g558_mouseButtonStatus;// @ G0588_i_MouseButtonsStatus + bool _pendingClickPresent; // G0436_B_PendingClickPresent + Common::Point _pendingClickPos; // @ G0437_i_PendingClickX, G0438_i_PendingClickY + MouseButton _pendingClickButton; // @ G0439_i_PendingClickButtonsStatus + bool _useObjectAsMousePointerBitmap; // @ G0600_B_UseObjectAsMousePointerBitmap + bool _useHandAsMousePointerBitmap; // @ G0601_B_UseHandAsMousePointerBitmap + bool _preventBuildPointerScreenArea; // @ K0100_B_PreventBuildPointerScreenArea + byte *_mousePointerOriginalColorsObject; // @ G0615_puc_Bitmap_MousePointerOriginalColorsObject + byte *_mousePointerOriginalColorsChampionIcon; // @ G0613_puc_Bitmap_MousePointerOriginalColorsChampionIcon + byte *_mousePointerTempBuffer; // @ K0190_puc_Bitmap_MousePointerTemporaryBuffer + int16 _mousePointerType; // @ K0104_i_MousePointerType + int16 _previousMousePointerType; // @ K0105_i_PreviousMousePointerType + uint16 _mouseButtonStatus;// @ G0588_i_MouseButtonsStatus // this doesn't seem to be used anywhere at all - bool _g435_isCommandQueueLocked; // @ G0435_B_CommandQueueLocked + bool _isCommandQueueLocked; // @ G0435_B_CommandQueueLocked Common::Queue _commandQueue; - void f365_commandTurnParty(CommandType cmdType); // @ F0365_COMMAND_ProcessTypes1To2_TurnParty - void f366_commandMoveParty(CommandType cmdType); // @ F0366_COMMAND_ProcessTypes3To6_MoveParty - bool f375_processType80_clickDungeonView_isLeaderHandObjThrown(int16 posX, int16 posY); // @ F0375_COMMAND_ProcessType80_ClickInDungeonView_IsLeaderHandObjectThrown + void commandTurnParty(CommandType cmdType); // @ F0365_COMMAND_ProcessTypes1To2_TurnParty + void commandMoveParty(CommandType cmdType); // @ F0366_COMMAND_ProcessTypes3To6_MoveParty + bool isLeaderHandObjThrown(int16 posX, int16 posY); // @ F0375_COMMAND_ProcessType80_ClickInDungeonView_IsLeaderHandObjectThrown void setMousePointerFromSpriteData(byte* mouseSprite); Box _highlightScreenBox; // @ G0336_i_HighlightBoxX1 @@ -237,25 +231,25 @@ public: explicit EventManager(DMEngine *vm); ~EventManager(); - MouseInput* _g441_primaryMouseInput;// @ G0441_ps_PrimaryMouseInput - MouseInput* _g442_secondaryMouseInput;// @ G0442_ps_SecondaryMouseInput - bool _g598_mousePointerBitmapUpdated; // @ G0598_B_MousePointerBitmapUpdated - bool _g326_refreshMousePointerInMainLoop; // @ G0326_B_RefreshMousePointerInMainLoop - bool _g341_highlightBoxEnabled; // @ G0341_B_HighlightBoxEnabled - uint16 _g599_useChampionIconOrdinalAsMousePointerBitmap; // @ G0599_ui_UseChampionIconOrdinalAsMousePointerBitmap - KeyboardInput *_g443_primaryKeyboardInput; // @ G0443_ps_PrimaryKeyboardInput - KeyboardInput *_g444_secondaryKeyboardInput; // @ G0444_ps_SecondaryKeyboardInput - bool _g597_ignoreMouseMovements;// @ G0597_B_IgnoreMouseMovements - int16 _g587_hideMousePointerRequestCount; // @ G0587_i_HideMousePointerRequestCount + MouseInput* _primaryMouseInput;// @ G0441_ps_PrimaryMouseInput + MouseInput* _secondaryMouseInput;// @ G0442_ps_SecondaryMouseInput + bool _mousePointerBitmapUpdated; // @ G0598_B_MousePointerBitmapUpdated + bool _refreshMousePointerInMainLoop; // @ G0326_B_RefreshMousePointerInMainLoop + bool _highlightBoxEnabled; // @ G0341_B_HighlightBoxEnabled + uint16 _useChampionIconOrdinalAsMousePointerBitmap; // @ G0599_ui_UseChampionIconOrdinalAsMousePointerBitmap + KeyboardInput *_primaryKeyboardInput; // @ G0443_ps_PrimaryKeyboardInput + KeyboardInput *_secondaryKeyboardInput; // @ G0444_ps_SecondaryKeyboardInput + bool _ignoreMouseMovements;// @ G0597_B_IgnoreMouseMovements + int16 _hideMousePointerRequestCount; // @ G0587_i_HideMousePointerRequestCount void initMouse(); - void f67_setMousePointerToNormal(int16 mousePointer); // @ F0067_MOUSE_SetPointerToNormal - void f68_setPointerToObject(byte *bitmap); // @ F0068_MOUSE_SetPointerToObject - void f71_mouseDropChampionIcon(); // @ F0071_MOUSE_DropChampionIcon - void f73_buildpointerScreenArea(int16 mousePosX, int16 mousePosY); // @ F0073_MOUSE_BuildPointerScreenArea - void f69_setMousePointer(); // @ F0069_MOUSE_SetPointer - void f78_showMouse(); // @ F0077_MOUSE_HidePointer_CPSE - void f77_hideMouse(); // @ F0078_MOUSE_ShowPointer + void setMousePointerToNormal(int16 mousePointer); // @ F0067_MOUSE_SetPointerToNormal + void setPointerToObject(byte *bitmap); // @ F0068_MOUSE_SetPointerToObject + void mouseDropChampionIcon(); // @ F0071_MOUSE_DropChampionIcon + void buildpointerScreenArea(int16 mousePosX, int16 mousePosY); // @ F0073_MOUSE_BuildPointerScreenArea + void setMousePointer(); // @ F0069_MOUSE_SetPointer + void showMouse(); // @ F0077_MOUSE_HidePointer_CPSE + void hideMouse(); // @ F0078_MOUSE_ShowPointer bool isMouseButtonDown(MouseButton button); void setMousePos(Common::Point pos); @@ -267,35 +261,34 @@ public: * If there are no more events, it returns with Common::EVENT_INVALID. */ Common::EventType processInput(Common::Event *grabKey = nullptr, Common::Event *grabMouseClick = nullptr); - void f360_processPendingClick(); // @ F0360_COMMAND_ProcessPendingClick - void f359_processClick(Common::Point mousePos, MouseButton button); // @ F0359_COMMAND_ProcessClick_CPSC - CommandType f358_getCommandTypeFromMouseInput(MouseInput *input, Common::Point mousePos, MouseButton button); // @ F0358_COMMAND_GetCommandFromMouseInput_CPSC - void f380_processCommandQueue(); // @ F0380_COMMAND_ProcessQueue_CPSC + void processPendingClick(); // @ F0360_COMMAND_ProcessPendingClick + void processClick(Common::Point mousePos, MouseButton button); // @ F0359_COMMAND_ProcessClick_CPSC + CommandType getCommandTypeFromMouseInput(MouseInput *input, Common::Point mousePos, MouseButton button); // @ F0358_COMMAND_GetCommandFromMouseInput_CPSC + void processCommandQueue(); // @ F0380_COMMAND_ProcessQueue_CPSC - void f368_commandSetLeader(ChampionIndex index); // @ F0368_COMMAND_SetLeader - void f372_commandProcessType80ClickInDungeonViewTouchFrontWall(); // @ F0372_COMMAND_ProcessType80_ClickInDungeonView_TouchFrontWall - void f377_commandProcessType80ClickInDungeonView(int16 posX, int16 posY); // @ F0377_COMMAND_ProcessType80_ClickInDungeonView - void f282_commandProcessCommands160To162ClickInResurrectReincarnatePanel(CommandType commandType); // @ F0282_CHAMPION_ProcessCommands160To162_ClickInResurrectReincarnatePanel - void f378_commandProcess81ClickInPanel(int16 x, int16 y); // @ F0378_COMMAND_ProcessType81_ClickInPanel - void f373_processType80_clickInDungeonView_grabLeaderHandObject(uint16 viewCell); // @ F0373_COMMAND_ProcessType80_ClickInDungeonView_GrabLeaderHandObject - void f374_processType80_clickInDungeonViewDropLeaderHandObject(uint16 viewCell); // @ F0374_COMMAND_ProcessType80_ClickInDungeonView_DropLeaderHandObject + void commandSetLeader(ChampionIndex index); // @ F0368_COMMAND_SetLeader + void commandProcessType80ClickInDungeonViewTouchFrontWall(); // @ F0372_COMMAND_ProcessType80_ClickInDungeonView_TouchFrontWall + void commandProcessType80ClickInDungeonView(int16 posX, int16 posY); // @ F0377_COMMAND_ProcessType80_ClickInDungeonView + void commandProcessCommands160To162ClickInResurrectReincarnatePanel(CommandType commandType); // @ F0282_CHAMPION_ProcessCommands160To162_ClickInResurrectReincarnatePanel + void commandProcess81ClickInPanel(int16 x, int16 y); // @ F0378_COMMAND_ProcessType81_ClickInPanel + void processType80_clickInDungeonView_grabLeaderHandObject(uint16 viewCell); // @ F0373_COMMAND_ProcessType80_ClickInDungeonView_GrabLeaderHandObject + void processType80_clickInDungeonViewDropLeaderHandObject(uint16 viewCell); // @ F0374_COMMAND_ProcessType80_ClickInDungeonView_DropLeaderHandObject - bool f360_hasPendingClick(Common::Point &point, MouseButton button); // @ F0360_COMMAND_ProcessPendingClick - void f379_drawSleepScreen(); // @ F0379_COMMAND_DrawSleepScreen - void f357_discardAllInput(); // @ F0357_COMMAND_DiscardAllInput - void f364_commandTakeStairs(bool stairsGoDown);// @ F0364_COMMAND_TakeStairs - void f367_commandProcessTypes12to27_clickInChampionStatusBox(uint16 champIndex, int16 posX, + bool hasPendingClick(Common::Point &point, MouseButton button); // @ F0360_COMMAND_ProcessPendingClick + void drawSleepScreen(); // @ F0379_COMMAND_DrawSleepScreen + void discardAllInput(); // @ F0357_COMMAND_DiscardAllInput + void commandTakeStairs(bool stairsGoDown);// @ F0364_COMMAND_TakeStairs + void commandProcessTypes12to27_clickInChampionStatusBox(uint16 champIndex, int16 posX, int16 posY); // @ F0367_COMMAND_ProcessTypes12To27_ClickInChampionStatusBox - void f70_mouseProcessCommands125To128_clickOnChampionIcon(uint16 champIconIndex); // @ F0070_MOUSE_ProcessCommands125To128_ClickOnChampionIcon - void f370_commandProcessType100_clickInSpellArea(uint16 posX, uint16 posY); // @ F0370_COMMAND_ProcessType100_ClickInSpellArea - void f369_commandProcessTypes101To108_clickInSpellSymbolsArea(CommandType cmdType); // @ F0369_COMMAND_ProcessTypes101To108_ClickInSpellSymbolsArea_CPSE - void f371_commandProcessType111To115_ClickInActionArea(int16 posX, int16 posY); // @ F0371_COMMAND_ProcessType111To115_ClickInActionArea_CPSE - void f544_resetPressingEyeOrMouth(); // @ F0544_INPUT_ResetPressingEyeOrMouth - void f541_waitForMouseOrKeyActivity(); // @ F0541_INPUT_WaitForMouseOrKeyboardActivity - void f362_commandHighlightBoxEnable(int16 x1, int16 x2, int16 y1, int16 y2); // @ F0362_COMMAND_HighlightBoxEnable - void f363_highlightBoxDisable(); // @ F0363_COMMAND_HighlightBoxDisable - void f6_highlightScreenBox(int16 x1, int16 x2, int16 y1, int16 y2) { warning(false, "STUB METHOD: f6_highlightScreenBox"); } // @ F0006_MAIN_HighlightScreenBox - + void mouseProcessCommands125To128_clickOnChampionIcon(uint16 champIconIndex); // @ F0070_MOUSE_ProcessCommands125To128_ClickOnChampionIcon + void commandProcessType100_clickInSpellArea(uint16 posX, uint16 posY); // @ F0370_COMMAND_ProcessType100_ClickInSpellArea + void commandProcessTypes101To108_clickInSpellSymbolsArea(CommandType cmdType); // @ F0369_COMMAND_ProcessTypes101To108_ClickInSpellSymbolsArea_CPSE + void commandProcessType111To115_ClickInActionArea(int16 posX, int16 posY); // @ F0371_COMMAND_ProcessType111To115_ClickInActionArea_CPSE + void resetPressingEyeOrMouth(); // @ F0544_INPUT_ResetPressingEyeOrMouth + void waitForMouseOrKeyActivity(); // @ F0541_INPUT_WaitForMouseOrKeyboardActivity + void commandHighlightBoxEnable(int16 x1, int16 x2, int16 y1, int16 y2); // @ F0362_COMMAND_HighlightBoxEnable + void highlightBoxDisable(); // @ F0363_COMMAND_HighlightBoxDisable + void highlightScreenBox(int16 x1, int16 x2, int16 y1, int16 y2) { warning(false, "STUB METHOD: highlightScreenBox"); } // @ F0006_MAIN_HighlightScreenBox KeyboardInput _primaryKeyboardInputInterface[7]; // @ G0458_as_Graphic561_PrimaryKeyboardInput_Interface KeyboardInput _secondaryKeyboardInputMovement[19]; // @ G0459_as_Graphic561_SecondaryKeyboardInput_Movement diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp index 30f5a0cac07..ceeb28507b1 100644 --- a/engines/dm/gfx.cpp +++ b/engines/dm/gfx.cpp @@ -3842,7 +3842,7 @@ void DisplayMan::f436_STARTEND_FadeToPalette(uint16* P0849_pui_Palette) { } } _vm->delay(1); - _vm->_eventMan->f357_discardAllInput(); + _vm->_eventMan->discardAllInput(); f508_buildPaletteChangeCopperList(_gK16_paletteFadeTemporary, _gK16_paletteFadeTemporary); } } diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp index fd132d7fac4..c4c48a03561 100644 --- a/engines/dm/inventory.cpp +++ b/engines/dm/inventory.cpp @@ -104,7 +104,7 @@ void InventoryMan::f355_toggleInventory(ChampionIndex championIndex) { if (_vm->indexToOrdinal(championIndex) == AL1102_ui_InventoryChampionOrdinal) { championIndex = k4_ChampionCloseInventory; } - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); if (AL1102_ui_InventoryChampionOrdinal) { _g432_inventoryChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone); f334_closeChest(); @@ -114,16 +114,16 @@ void InventoryMan::f355_toggleInventory(ChampionIndex championIndex) { _vm->_championMan->drawChampionState((ChampionIndex)_vm->ordinalToIndex(AL1102_ui_InventoryChampionOrdinal)); } if (_vm->_championMan->_partyIsSleeping) { - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); return; } if (championIndex == k4_ChampionCloseInventory) { - _vm->_eventMan->_g326_refreshMousePointerInMainLoop = true; + _vm->_eventMan->_refreshMousePointerInMainLoop = true; _vm->_menuMan->f395_drawMovementArrows(); - _vm->_eventMan->f77_hideMouse(); - _vm->_eventMan->_g442_secondaryMouseInput = _vm->_eventMan->_secondaryMouseInputMovement; - _vm->_eventMan->_g444_secondaryKeyboardInput = _vm->_eventMan->_secondaryKeyboardInputMovement; - _vm->_eventMan->f357_discardAllInput(); + _vm->_eventMan->hideMouse(); + _vm->_eventMan->_secondaryMouseInput = _vm->_eventMan->_secondaryMouseInputMovement; + _vm->_eventMan->_secondaryKeyboardInput = _vm->_eventMan->_secondaryKeyboardInputMovement; + _vm->_eventMan->discardAllInput(); _vm->_displayMan->f98_drawFloorAndCeiling(); return; } @@ -161,11 +161,11 @@ void InventoryMan::f355_toggleInventory(ChampionIndex championIndex) { } setFlag(L1103_ps_Champion->_attributes, k0x4000_ChampionAttributeViewport | k0x1000_ChampionAttributeStatusBox | k0x0800_ChampionAttributePanel | k0x0200_ChampionAttributeLoad | k0x0100_ChampionAttributeStatistics | k0x0080_ChampionAttributeNameTitle); _vm->_championMan->drawChampionState(championIndex); - _vm->_eventMan->_g598_mousePointerBitmapUpdated = true; - _vm->_eventMan->f77_hideMouse(); - _vm->_eventMan->_g442_secondaryMouseInput = _vm->_eventMan->_secondaryMouseInputChampionInventory; - _vm->_eventMan->_g444_secondaryKeyboardInput = nullptr; - _vm->_eventMan->f357_discardAllInput(); + _vm->_eventMan->_mousePointerBitmapUpdated = true; + _vm->_eventMan->hideMouse(); + _vm->_eventMan->_secondaryMouseInput = _vm->_eventMan->_secondaryMouseInputChampionInventory; + _vm->_eventMan->_secondaryKeyboardInput = nullptr; + _vm->_eventMan->discardAllInput(); } void InventoryMan::f354_drawStatusBoxPortrait(ChampionIndex championIndex) { @@ -875,10 +875,10 @@ void InventoryMan::f351_drawChampionSkillsAndStatistics() { void InventoryMan::f350_drawStopPressingMouth() { f347_drawPanel(); _vm->_displayMan->f97_drawViewport(k0_viewportNotDungeonView); - _vm->_eventMan->_g587_hideMousePointerRequestCount = 1; - _vm->_eventMan->f78_showMouse(); - _vm->_eventMan->f78_showMouse(); - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->_hideMousePointerRequestCount = 1; + _vm->_eventMan->showMouse(); + _vm->_eventMan->showMouse(); + _vm->_eventMan->showMouse(); } void InventoryMan::f353_drawStopPressingEye() { @@ -890,9 +890,9 @@ void InventoryMan::f353_drawStopPressingEye() { if ((L1100_T_LeaderHandObject = _vm->_championMan->_leaderHandObject) != Thing::_none) { _vm->_objectMan->f34_drawLeaderObjectName(L1100_T_LeaderHandObject); } - _vm->_eventMan->f78_showMouse(); - _vm->_eventMan->f78_showMouse(); - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); + _vm->_eventMan->showMouse(); + _vm->_eventMan->showMouse(); } void InventoryMan::f349_processCommand70_clickOnMouth() { @@ -930,15 +930,15 @@ void InventoryMan::f349_processCommand70_clickOnMouth() { if (_g424_panelContent == k0_PanelContentFoodWaterPoisoned) { return; } - _vm->_eventMan->_g597_ignoreMouseMovements = true; + _vm->_eventMan->_ignoreMouseMovements = true; _vm->_pressingMouth = true; if (!_vm->_eventMan->isMouseButtonDown(k1_LeftMouseButton)) { - _vm->_eventMan->_g597_ignoreMouseMovements = false; + _vm->_eventMan->_ignoreMouseMovements = false; _vm->_pressingMouth = false; _vm->_stopPressingMouth = false; } else { - _vm->_eventMan->f78_showMouse(); - _vm->_eventMan->_g587_hideMousePointerRequestCount = 1; + _vm->_eventMan->showMouse(); + _vm->_eventMan->_hideMousePointerRequestCount = 1; f345_drawPanelFoodWaterPoisoned(); _vm->_displayMan->f97_drawViewport(k0_viewportNotDungeonView); } @@ -970,7 +970,7 @@ void InventoryMan::f349_processCommand70_clickOnMouth() { L1081_B_RemoveObjectFromLeaderHand = true; } } - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); if (L1081_B_RemoveObjectFromLeaderHand) { _vm->_championMan->getObjectRemovedFromLeaderHand(); } @@ -1052,7 +1052,7 @@ void InventoryMan::f349_processCommand70_clickOnMouth() { if (L1081_B_RemoveObjectFromLeaderHand) { for (L1086_ui_Counter = 5; --L1086_ui_Counter; _vm->delay(8)) { /* Animate mouth icon */ _vm->_objectMan->f37_drawIconToScreen(k205_IconIndiceMouthOpen + !(L1086_ui_Counter & 0x0001), 56, 46); - _vm->_eventMan->f357_discardAllInput(); + _vm->_eventMan->discardAllInput(); if (_vm->_engineShouldQuit) return; _vm->_displayMan->updateScreen(); @@ -1068,7 +1068,7 @@ void InventoryMan::f349_processCommand70_clickOnMouth() { setFlag(L1083_ps_Champion->_attributes, k0x0800_ChampionAttributePanel); } _vm->_championMan->drawChampionState((ChampionIndex)L1080_ui_ChampionIndex); - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); } void InventoryMan::f348_adjustStatisticCurrentValue(Champion* champ, uint16 statIndex, int16 valueDelta) { @@ -1092,18 +1092,18 @@ void InventoryMan::f348_adjustStatisticCurrentValue(Champion* champ, uint16 stat } void InventoryMan::f352_processCommand71_clickOnEye() { - _vm->_eventMan->_g597_ignoreMouseMovements = true; + _vm->_eventMan->_ignoreMouseMovements = true; _vm->_pressingEye = true; if (!_vm->_eventMan->isMouseButtonDown(k1_LeftMouseButton)) { - _vm->_eventMan->_g597_ignoreMouseMovements = false; + _vm->_eventMan->_ignoreMouseMovements = false; _vm->_pressingEye = false; _vm->_stopPressingEye = false; return; } - _vm->_eventMan->f357_discardAllInput(); - _vm->_eventMan->f77_hideMouse(); - _vm->_eventMan->f77_hideMouse(); - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->discardAllInput(); + _vm->_eventMan->hideMouse(); + _vm->_eventMan->hideMouse(); + _vm->_eventMan->hideMouse(); _vm->delay(8); f332_drawIconToViewport(k203_IconIndiceEyeLooking, 12, 13); if (_vm->_championMan->_leaderEmptyHanded) { diff --git a/engines/dm/loadsave.cpp b/engines/dm/loadsave.cpp index a6efc108761..52ba139baff 100644 --- a/engines/dm/loadsave.cpp +++ b/engines/dm/loadsave.cpp @@ -165,7 +165,7 @@ LoadgameResponse DMEngine::loadgame(int16 slot) { void DMEngine::saveGame() { _menuMan->f456_drawDisabledMenu(); - _eventMan->f78_showMouse(); + _eventMan->showMouse(); switch (getGameLanguage()) { // localized default: @@ -242,13 +242,13 @@ void DMEngine::saveGame() { if (saveAndPlayChoice == kSaveAndQuit) { - _eventMan->f77_hideMouse(); + _eventMan->hideMouse(); endGame(false); } _restartGameAllowed = true; _menuMan->f457_drawEnabledMenus(); - _eventMan->f77_hideMouse(); + _eventMan->hideMouse(); } Common::String DMEngine::getSavefileName(uint16 slot) { diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp index cf32fd778b3..ae271fc94d5 100644 --- a/engines/dm/menus.cpp +++ b/engines/dm/menus.cpp @@ -118,10 +118,10 @@ MenuMan::~MenuMan() { } void MenuMan::f395_drawMovementArrows() { - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); _vm->_displayMan->f21_blitToScreen(_vm->_displayMan->f489_getNativeBitmapOrGraphic(k13_MovementArrowsIndice), &_vm->_displayMan->_boxMovementArrows, k48_byteWidth, kM1_ColorNoTransparency, 45); - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); } void MenuMan::f388_clearActingChampion() { ChampionMan &cm = *_vm->_championMan; @@ -180,7 +180,7 @@ T0386006: void MenuMan::f456_drawDisabledMenu() { if (!_vm->_championMan->_partyIsSleeping) { - _vm->_eventMan->f363_highlightBoxDisable(); + _vm->_eventMan->highlightBoxDisable(); _vm->_displayMan->_g578_useByteBoxCoordinates = false; if (_vm->_inventoryMan->_g432_inventoryChampionOrdinal) { if (_vm->_inventoryMan->_g424_panelContent == k4_PanelContentChest) { @@ -191,7 +191,7 @@ void MenuMan::f456_drawDisabledMenu() { } _vm->_displayMan->f136_shadeScreenBox(&boxSpellArea, k0_ColorBlack); _vm->_displayMan->f136_shadeScreenBox(&boxActionArea, k0_ColorBlack); - _vm->_eventMan->f67_setMousePointerToNormal(k0_pointerArrow); + _vm->_eventMan->setMousePointerToNormal(k0_pointerArrow); } } @@ -255,7 +255,7 @@ void MenuMan::f387_drawActionArea() { ChampionMan &champMan = *_vm->_championMan; TextMan &textMan = *_vm->_textMan; - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); dispMan._g578_useByteBoxCoordinates = false; dispMan.D24_fillScreenBox(boxActionArea, k0_ColorBlack); if (_g509_actionAreaContainsIcons) { @@ -278,7 +278,7 @@ void MenuMan::f387_drawActionArea() { k12_ActionNameMaximumLength, k200_heightScreen); } } - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); _g508_refreshActionArea = false; } @@ -306,25 +306,25 @@ void MenuMan::f393_drawSpellAreaControls(ChampionIndex champIndex) { int16 champHP1 = _vm->_championMan->_champions[1]._currHealth; int16 champHP2 = _vm->_championMan->_champions[2]._currHealth; int16 champHP3 = _vm->_championMan->_champions[3]._currHealth; - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); _vm->_displayMan->D24_fillScreenBox(boxSpellAreaControls, k0_ColorBlack); switch (champIndex) { case 0: - _vm->_eventMan->f6_highlightScreenBox(233, 277, 42, 49); + _vm->_eventMan->highlightScreenBox(233, 277, 42, 49); _vm->_textMan->f53_printToLogicalScreen(235, 48, k0_ColorBlack, k4_ColorCyan, champ->_name); if (_vm->_championMan->_partyChampionCount > 1) { if (champHP1) { - _vm->_eventMan->f6_highlightScreenBox(280, 291, 42, 48); + _vm->_eventMan->highlightScreenBox(280, 291, 42, 48); } T0393002: if (_vm->_championMan->_partyChampionCount > 2) { if (champHP2) { - _vm->_eventMan->f6_highlightScreenBox(294, 305, 42, 48); + _vm->_eventMan->highlightScreenBox(294, 305, 42, 48); } T0393003: if (_vm->_championMan->_partyChampionCount > 3) { if (champHP3) { - _vm->_eventMan->f6_highlightScreenBox(308, 319, 42, 48); + _vm->_eventMan->highlightScreenBox(308, 319, 42, 48); } } } @@ -332,38 +332,38 @@ T0393003: break; case 1: if (champHP0) { - _vm->_eventMan->f6_highlightScreenBox(233, 244, 42, 48); + _vm->_eventMan->highlightScreenBox(233, 244, 42, 48); } - _vm->_eventMan->f6_highlightScreenBox(247, 291, 42, 49); + _vm->_eventMan->highlightScreenBox(247, 291, 42, 49); _vm->_textMan->f53_printToLogicalScreen(249, 48, k0_ColorBlack, k4_ColorCyan, champ->_name); goto T0393002; case 2: if (champHP0) { - _vm->_eventMan->f6_highlightScreenBox(233, 244, 42, 48); + _vm->_eventMan->highlightScreenBox(233, 244, 42, 48); } if (champHP1) { - _vm->_eventMan->f6_highlightScreenBox(247, 258, 42, 48); + _vm->_eventMan->highlightScreenBox(247, 258, 42, 48); } - _vm->_eventMan->f6_highlightScreenBox(261, 305, 42, 49); + _vm->_eventMan->highlightScreenBox(261, 305, 42, 49); _vm->_textMan->f53_printToLogicalScreen(263, 48, k0_ColorBlack, k4_ColorCyan, champ->_name); goto T0393003; case 3: if (champHP0) { - _vm->_eventMan->f6_highlightScreenBox(233, 244, 42, 48); + _vm->_eventMan->highlightScreenBox(233, 244, 42, 48); } if (champHP1) { - _vm->_eventMan->f6_highlightScreenBox(247, 258, 42, 48); + _vm->_eventMan->highlightScreenBox(247, 258, 42, 48); } if (champHP2) { - _vm->_eventMan->f6_highlightScreenBox(261, 272, 42, 48); + _vm->_eventMan->highlightScreenBox(261, 272, 42, 48); } - _vm->_eventMan->f6_highlightScreenBox(275, 319, 42, 49); + _vm->_eventMan->highlightScreenBox(275, 319, 42, 49); _vm->_textMan->f53_printToLogicalScreen(277, 48, k0_ColorBlack, k4_ColorCyan, champ->_name); break; default: break; } - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); } #define k2_SpellAreaAvailableSymbols 2 // @ C2_SPELL_AREA_AVAILABLE_SYMBOLS @@ -405,26 +405,26 @@ void MenuMan::f394_setMagicCasterAndDrawSpellArea(int16 champIndex) { return; } if (_vm->_championMan->_magicCasterChampionIndex == kM1_ChampionNone) { - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); _vm->_displayMan->f21_blitToScreen(_vm->_displayMan->f489_getNativeBitmapOrGraphic(k9_MenuSpellAreaBackground), &boxSpellArea, k48_byteWidth, kM1_ColorNoTransparency, 33); - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); } if (champIndex == kM1_ChampionNone) { _vm->_championMan->_magicCasterChampionIndex = kM1_ChampionNone; - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); _vm->_displayMan->_g578_useByteBoxCoordinates = false; _vm->_displayMan->D24_fillScreenBox(boxSpellArea, k0_ColorBlack); - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); return; } L1213_ps_Champion = &_vm->_championMan->_champions[_vm->_championMan->_magicCasterChampionIndex = (ChampionIndex)champIndex]; f392_buildSpellAreaLine(k2_SpellAreaAvailableSymbols); - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); f393_drawSpellAreaControls((ChampionIndex)champIndex); _vm->_displayMan->f21_blitToScreen(_gK72_bitmapSpellAreaLine, &boxSpellAreaLine2, k48_byteWidth, kM1_ColorNoTransparency, 12); f392_buildSpellAreaLine(k3_SpellAreaChampionSymbols); _vm->_displayMan->f21_blitToScreen(_gK72_bitmapSpellAreaLine, &boxSpellAreaLine3, k48_byteWidth, kM1_ColorNoTransparency, 12); - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); } void MenuMan::f457_drawEnabledMenus() { @@ -434,7 +434,7 @@ void MenuMan::f457_drawEnabledMenus() { if (_vm->_championMan->_partyIsSleeping) { - _vm->_eventMan->f379_drawSleepScreen(); + _vm->_eventMan->drawSleepScreen(); _vm->_displayMan->f97_drawViewport(k0_viewportNotDungeonView); } else { AL1462_i_MagicCasterChampionIndex = _vm->_championMan->_magicCasterChampionIndex; @@ -452,7 +452,7 @@ void MenuMan::f457_drawEnabledMenus() { _vm->_displayMan->f98_drawFloorAndCeiling(); f395_drawMovementArrows(); } - _vm->_eventMan->f69_setMousePointer(); + _vm->_eventMan->setMousePointer(); } } @@ -462,8 +462,8 @@ int16 MenuMan::f408_getClickOnSpellCastResult() { L1260_ps_Champion = &_vm->_championMan->_champions[_vm->_championMan->_magicCasterChampionIndex]; - _vm->_eventMan->f78_showMouse(); - _vm->_eventMan->f363_highlightBoxDisable(); + _vm->_eventMan->showMouse(); + _vm->_eventMan->highlightBoxDisable(); if ((L1259_i_SpellCastResult = f412_getChampionSpellCastResult(_vm->_championMan->_magicCasterChampionIndex)) != k3_spellCastFailureNeedsFlask) { L1260_ps_Champion->_symbols[0] = '\0'; f397_drawAvailableSymbols(L1260_ps_Champion->_symbolStep = 0); @@ -471,7 +471,7 @@ int16 MenuMan::f408_getClickOnSpellCastResult() { } else { L1259_i_SpellCastResult = k0_spellCastFailure; } - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); return L1259_i_SpellCastResult; } @@ -857,11 +857,11 @@ void MenuMan::f399_addChampionSymbol(int16 symbolIndex) { L1225_ps_Champion->_symbols[L1222_ui_SymbolStep] = 96 + (L1222_ui_SymbolStep * 6) + symbolIndex; L1225_ps_Champion->_symbols[L1222_ui_SymbolStep + 1] = '\0'; L1225_ps_Champion->_symbolStep = L1222_ui_SymbolStep = returnNextVal(L1222_ui_SymbolStep); - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); f397_drawAvailableSymbols(L1222_ui_SymbolStep); f398_drawChampionSymbols(L1225_ps_Champion); _vm->_championMan->drawChampionState(_vm->_championMan->_magicCasterChampionIndex); - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); } } @@ -875,10 +875,10 @@ void MenuMan::f400_deleteChampionSymbol() { } L1228_ps_Champion->_symbolStep = L1226_ui_SymbolStep = returnPrevVal(L1228_ps_Champion->_symbolStep); L1228_ps_Champion->_symbols[L1226_ui_SymbolStep] = '\0'; - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); f397_drawAvailableSymbols(L1226_ui_SymbolStep); f398_drawChampionSymbols(L1228_ps_Champion); - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); } bool MenuMan::f391_didClickTriggerAction(int16 actionListIndex) { @@ -1725,7 +1725,7 @@ void MenuMan::f385_drawActionDamage(int16 damage) { const Box* L1180_ps_Box; int16 L1643_i_Width; - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); _vm->_displayMan->_g578_useByteBoxCoordinates = false; _vm->_displayMan->D24_fillScreenBox(boxActionArea, k0_ColorBlack); if (damage < 0) { @@ -1791,6 +1791,6 @@ void MenuMan::f385_drawActionDamage(int16 damage) { } while (damage /= 10); _vm->_textMan->f53_printToLogicalScreen(AL1176_i_X, 100, k4_ColorCyan, k0_ColorBlack, &L1179_ac_String[AL1174_ui_CharacterIndex]); } - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); } } diff --git a/engines/dm/timeline.cpp b/engines/dm/timeline.cpp index 3f414c87c90..b1a60daf53d 100644 --- a/engines/dm/timeline.cpp +++ b/engines/dm/timeline.cpp @@ -993,9 +993,9 @@ void Timeline::f254_timelineProcessEvent12_hideDamageReceived(uint16 champIndex) return; } if (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) { - _vm->_eventMan->f78_showMouse(); + _vm->_eventMan->showMouse(); _vm->_inventoryMan->f354_drawStatusBoxPortrait((ChampionIndex)champIndex); - _vm->_eventMan->f77_hideMouse(); + _vm->_eventMan->hideMouse(); } else { setFlag(L0663_ps_Champion->_attributes, k0x0080_ChampionAttributeNameTitle); _vm->_championMan->drawChampionState((ChampionIndex)champIndex);