diff options
Diffstat (limited to 'engines/dm/menus.cpp')
-rw-r--r-- | engines/dm/menus.cpp | 185 |
1 files changed, 93 insertions, 92 deletions
diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp index faf61393ce..bfe9c35101 100644 --- a/engines/dm/menus.cpp +++ b/engines/dm/menus.cpp @@ -163,12 +163,13 @@ MenuMan::MenuMan(DMEngine *vm) : _vm(vm) { MenuMan::~MenuMan() { delete[] _bitmapSpellAreaLine; + delete[] _bitmapSpellAreaLines; } void MenuMan::drawMovementArrows() { _vm->_eventMan->showMouse(); - _vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(k13_MovementArrowsIndice), - &_vm->_displayMan->_boxMovementArrows, k48_byteWidth, kM1_ColorNoTransparency, 45); + _vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxMovementArrows), + &_vm->_displayMan->_boxMovementArrows, k48_byteWidth, kDMColorNoTransparency, 45); _vm->_eventMan->hideMouse(); } void MenuMan::clearActingChampion() { @@ -191,13 +192,13 @@ void MenuMan::drawActionIcon(ChampionIndex championIndex) { Champion &champion = _vm->_championMan->_champions[championIndex]; Box box; - box._x1 = championIndex * 22 + 233; - box._x2 = box._x1 + 19; - box._y1 = 86; - box._y2 = 120; + box._rect.left = championIndex * 22 + 233; + box._rect.right = box._rect.left + 19; + box._rect.top = 86; + box._rect.bottom = 120; dm._useByteBoxCoordinates = false; if (!champion._currHealth) { - dm.fillScreenBox(box, k0_ColorBlack); + dm.fillScreenBox(box, kDMColorBlack); return; } byte *bitmapIcon = dm._tmpBitmap; @@ -208,21 +209,21 @@ void MenuMan::drawActionIcon(ChampionIndex championIndex) { } else if (_vm->_dungeonMan->_objectInfos[_vm->_dungeonMan->getObjectInfoIndex(thing)]._actionSetIndex) { iconIndex = _vm->_objectMan->getIconIndex(thing); } else { - dm.fillBitmap(bitmapIcon, k4_ColorCyan, 16, 16); + dm.fillBitmap(bitmapIcon, kDMColorCyan, 16, 16); goto T0386006; } _vm->_objectMan->extractIconFromBitmap(iconIndex, bitmapIcon); dm.blitToBitmapShrinkWithPalChange(bitmapIcon, bitmapIcon, 16, 16, 16, 16, palChangesActionAreaObjectIcon); T0386006: - dm.fillScreenBox(box, k4_ColorCyan); + dm.fillScreenBox(box, kDMColorCyan); Box box2; - box2._x1 = box._x1 + 2; - box2._x2 = box._x2 - 2; - box2._y1 = 95; - box2._y2 = 110; - dm.blitToScreen(bitmapIcon, &box2, k8_byteWidth, kM1_ColorNoTransparency, 16); + box2._rect.left = box._rect.left + 2; + box2._rect.right = box._rect.right - 2; + box2._rect.top = 95; + box2._rect.bottom = 110; + dm.blitToScreen(bitmapIcon, &box2, k8_byteWidth, kDMColorNoTransparency, 16); if (champion.getAttributes(kDMAttributeDisableAction) || _vm->_championMan->_candidateChampionOrdinal || _vm->_championMan->_partyIsSleeping) { - _vm->_displayMan->shadeScreenBox(&box, k0_ColorBlack); + _vm->_displayMan->shadeScreenBox(&box, kDMColorBlack); } } @@ -231,14 +232,14 @@ void MenuMan::drawDisabledMenu() { _vm->_eventMan->highlightBoxDisable(); _vm->_displayMan->_useByteBoxCoordinates = false; if (_vm->_inventoryMan->_inventoryChampionOrdinal) { - if (_vm->_inventoryMan->_panelContent == k4_PanelContentChest) { + if (_vm->_inventoryMan->_panelContent == kDMPanelContentChest) { _vm->_inventoryMan->closeChest(); } } else { - _vm->_displayMan->shadeScreenBox(&_vm->_displayMan->_boxMovementArrows, k0_ColorBlack); + _vm->_displayMan->shadeScreenBox(&_vm->_displayMan->_boxMovementArrows, kDMColorBlack); } - _vm->_displayMan->shadeScreenBox(&_boxSpellArea, k0_ColorBlack); - _vm->_displayMan->shadeScreenBox(&_boxActionArea, k0_ColorBlack); + _vm->_displayMan->shadeScreenBox(&_boxSpellArea, kDMColorBlack); + _vm->_displayMan->shadeScreenBox(&_boxActionArea, kDMColorBlack); _vm->_eventMan->setMousePointerToNormal(k0_pointerArrow); } } @@ -305,7 +306,7 @@ void MenuMan::drawActionArea() { _vm->_eventMan->hideMouse(); dispMan._useByteBoxCoordinates = false; - dispMan.fillScreenBox(_boxActionArea, k0_ColorBlack); + dispMan.fillScreenBox(_boxActionArea, kDMColorBlack); if (_actionAreaContainsIcons) { for (uint16 champIndex = kDMChampionFirst; champIndex < champMan._partyChampionCount; ++champIndex) drawActionIcon((ChampionIndex)champIndex); @@ -315,13 +316,13 @@ void MenuMan::drawActionArea() { box = _boxActionArea2ActionMenu; if (_actionList._actionIndices[1] == kDMActionNone) box = _boxActionArea1ActionMenu; - dispMan.blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(k10_MenuActionAreaIndice), - &box, k48_byteWidth, kM1_ColorNoTransparency, 45); + dispMan.blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxMenuActionArea), + &box, k48_byteWidth, kDMColorNoTransparency, 45); textMan.printWithTrailingSpaces(dispMan._bitmapScreen, k160_byteWidthScreen, - 235, 83, k0_ColorBlack, k4_ColorCyan, champMan._champions[_vm->ordinalToIndex(champMan._actingChampionOrdinal)]._name, + 235, 83, kDMColorBlack, kDMColorCyan, champMan._champions[_vm->ordinalToIndex(champMan._actingChampionOrdinal)]._name, k7_ChampionNameMaximumLength, k200_heightScreen); for (uint16 actionListIndex = 0; actionListIndex < 3; actionListIndex++) { - textMan.printWithTrailingSpaces(dispMan._bitmapScreen, k160_byteWidthScreen, 241, 93 + actionListIndex * 12, k4_ColorCyan, k0_ColorBlack, + textMan.printWithTrailingSpaces(dispMan._bitmapScreen, k160_byteWidthScreen, 241, 93 + actionListIndex * 12, kDMColorCyan, kDMColorBlack, getActionName(_actionList._actionIndices[actionListIndex]), k12_ActionNameMaximumLength, k200_heightScreen); } @@ -355,12 +356,12 @@ void MenuMan::drawSpellAreaControls(ChampionIndex champIndex) { int16 champHP2 = _vm->_championMan->_champions[2]._currHealth; int16 champHP3 = _vm->_championMan->_champions[3]._currHealth; _vm->_eventMan->showMouse(); - _vm->_displayMan->fillScreenBox(boxSpellAreaControls, k0_ColorBlack); + _vm->_displayMan->fillScreenBox(boxSpellAreaControls, kDMColorBlack); switch (champIndex) { case 0: _vm->_eventMan->highlightScreenBox(233, 277, 42, 49); - _vm->_textMan->printToLogicalScreen(235, 48, k0_ColorBlack, k4_ColorCyan, champ->_name); + _vm->_textMan->printToLogicalScreen(235, 48, kDMColorBlack, kDMColorCyan, champ->_name); if (_vm->_championMan->_partyChampionCount > 1) { if (champHP1) _vm->_eventMan->highlightScreenBox(280, 291, 42, 48); @@ -379,7 +380,7 @@ void MenuMan::drawSpellAreaControls(ChampionIndex champIndex) { _vm->_eventMan->highlightScreenBox(233, 244, 42, 48); _vm->_eventMan->highlightScreenBox(247, 291, 42, 49); - _vm->_textMan->printToLogicalScreen(249, 48, k0_ColorBlack, k4_ColorCyan, champ->_name); + _vm->_textMan->printToLogicalScreen(249, 48, kDMColorBlack, kDMColorCyan, champ->_name); if (_vm->_championMan->_partyChampionCount > 2) { if (champHP2) _vm->_eventMan->highlightScreenBox(294, 305, 42, 48); @@ -396,7 +397,7 @@ void MenuMan::drawSpellAreaControls(ChampionIndex champIndex) { _vm->_eventMan->highlightScreenBox(247, 258, 42, 48); _vm->_eventMan->highlightScreenBox(261, 305, 42, 49); - _vm->_textMan->printToLogicalScreen(263, 48, k0_ColorBlack, k4_ColorCyan, champ->_name); + _vm->_textMan->printToLogicalScreen(263, 48, kDMColorBlack, kDMColorCyan, champ->_name); if ((_vm->_championMan->_partyChampionCount > 3) && champHP3) _vm->_eventMan->highlightScreenBox(308, 319, 42, 48); break; @@ -412,7 +413,7 @@ void MenuMan::drawSpellAreaControls(ChampionIndex champIndex) { _vm->_eventMan->highlightScreenBox(261, 272, 42, 48); _vm->_eventMan->highlightScreenBox(275, 319, 42, 49); - _vm->_textMan->printToLogicalScreen(277, 48, k0_ColorBlack, k4_ColorCyan, champ->_name); + _vm->_textMan->printToLogicalScreen(277, 48, kDMColorBlack, kDMColorCyan, champ->_name); break; default: break; @@ -425,25 +426,25 @@ void MenuMan::buildSpellAreaLine(int16 spellAreaBitmapLine) { char spellSymbolString[2] = {'\0', '\0'}; Champion *magicChampion = &_vm->_championMan->_champions[_vm->_championMan->_magicCasterChampionIndex]; - if (spellAreaBitmapLine == k2_SpellAreaAvailableSymbols) { + if (spellAreaBitmapLine == kDMSpellAreaAvailableSymbols) { _vm->_displayMan->_useByteBoxCoordinates = false; - _vm->_displayMan->blitToBitmap(_bitmapSpellAreaLines, _bitmapSpellAreaLine, boxSpellAreaLine, 0, 12, k48_byteWidth, k48_byteWidth, kM1_ColorNoTransparency, 36, 12); + _vm->_displayMan->blitToBitmap(_bitmapSpellAreaLines, _bitmapSpellAreaLine, boxSpellAreaLine, 0, 12, k48_byteWidth, k48_byteWidth, kDMColorNoTransparency, 36, 12); int16 x = 1; char character = 96 + (6 * magicChampion->_symbolStep); for (uint16 symbolIndex = 0; symbolIndex < 6; symbolIndex++) { spellSymbolString[0] = character++; x += 14; - _vm->_textMan->printTextToBitmap(_bitmapSpellAreaLine, 48, x, 8, k4_ColorCyan, k0_ColorBlack, spellSymbolString, 12); + _vm->_textMan->printTextToBitmap(_bitmapSpellAreaLine, 48, x, 8, kDMColorCyan, kDMColorBlack, spellSymbolString, 12); } - } else if (spellAreaBitmapLine == k3_SpellAreaChampionSymbols) { + } else if (spellAreaBitmapLine == kDMSpellAreaChampionSymbols) { _vm->_displayMan->_useByteBoxCoordinates = false; - _vm->_displayMan->blitToBitmap(_bitmapSpellAreaLines, _bitmapSpellAreaLine, boxSpellAreaLine, 0, 24, k48_byteWidth, k48_byteWidth, kM1_ColorNoTransparency, 36, 12); + _vm->_displayMan->blitToBitmap(_bitmapSpellAreaLines, _bitmapSpellAreaLine, boxSpellAreaLine, 0, 24, k48_byteWidth, k48_byteWidth, kDMColorNoTransparency, 36, 12); int16 x = 8; for (uint16 symbolIndex = 0; symbolIndex < 4; symbolIndex++) { if ((spellSymbolString[0] = magicChampion->_symbols[symbolIndex]) == '\0') break; x += 9; - _vm->_textMan->printTextToBitmap(_bitmapSpellAreaLine, 48, x, 8, k4_ColorCyan, k0_ColorBlack, spellSymbolString, 12); + _vm->_textMan->printTextToBitmap(_bitmapSpellAreaLine, 48, x, 8, kDMColorCyan, kDMColorBlack, spellSymbolString, 12); } } } @@ -458,24 +459,24 @@ void MenuMan::setMagicCasterAndDrawSpellArea(ChampionIndex champIndex) { if (_vm->_championMan->_magicCasterChampionIndex == kDMChampionNone) { _vm->_eventMan->showMouse(); - _vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(k9_MenuSpellAreaBackground), &_boxSpellArea, k48_byteWidth, kM1_ColorNoTransparency, 33); + _vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxMenuSpellAreaBackground), &_boxSpellArea, k48_byteWidth, kDMColorNoTransparency, 33); _vm->_eventMan->hideMouse(); } if (champIndex == kDMChampionNone) { _vm->_championMan->_magicCasterChampionIndex = kDMChampionNone; _vm->_eventMan->showMouse(); _vm->_displayMan->_useByteBoxCoordinates = false; - _vm->_displayMan->fillScreenBox(_boxSpellArea, k0_ColorBlack); + _vm->_displayMan->fillScreenBox(_boxSpellArea, kDMColorBlack); _vm->_eventMan->hideMouse(); return; } _vm->_championMan->_magicCasterChampionIndex = champIndex; - buildSpellAreaLine(k2_SpellAreaAvailableSymbols); + buildSpellAreaLine(kDMSpellAreaAvailableSymbols); _vm->_eventMan->showMouse(); drawSpellAreaControls(champIndex); - _vm->_displayMan->blitToScreen(_bitmapSpellAreaLine, &boxSpellAreaLine2, k48_byteWidth, kM1_ColorNoTransparency, 12); - buildSpellAreaLine(k3_SpellAreaChampionSymbols); - _vm->_displayMan->blitToScreen(_bitmapSpellAreaLine, &boxSpellAreaLine3, k48_byteWidth, kM1_ColorNoTransparency, 12); + _vm->_displayMan->blitToScreen(_bitmapSpellAreaLine, &boxSpellAreaLine2, k48_byteWidth, kDMColorNoTransparency, 12); + buildSpellAreaLine(kDMSpellAreaChampionSymbols); + _vm->_displayMan->blitToScreen(_bitmapSpellAreaLine, &boxSpellAreaLine3, k48_byteWidth, kDMColorNoTransparency, 12); _vm->_eventMan->hideMouse(); } @@ -606,24 +607,24 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) { } break; case kDMSpellTypeOtherThievesEye: { - newEvent._type = k73_TMEventTypeThievesEye; + newEvent._type = kDMEventTypeThievesEye; _vm->_championMan->_party._event73Count_ThievesEye++; spellPower = (spellPower >> 1); uint16 spellTicks = spellPower * spellPower; - _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + spellTicks); + newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + spellTicks); _vm->_timeline->addEventGetEventIndex(&newEvent); } break; case kDMSpellTypeOtherInvisibility: { - newEvent._type = k71_TMEventTypeInvisibility; + newEvent._type = kDMEventTypeInvisibility; _vm->_championMan->_party._event71Count_Invisibility++; uint16 spellTicks = spellPower; - _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + spellTicks); + newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + spellTicks); _vm->_timeline->addEventGetEventIndex(&newEvent); } break; case kDMSpellTypeOtherPartyShield: { - newEvent._type = k74_TMEventTypePartyShield; + newEvent._type = kDMEventTypePartyShield; newEvent._Bu._defense = spellPower; if (_vm->_championMan->_party._shieldDefense > 50) newEvent._Bu._defense >>= 2; @@ -631,12 +632,12 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) { _vm->_championMan->_party._shieldDefense += newEvent._Bu._defense; _vm->_timeline->refreshAllChampionStatusBoxes(); uint16 spellTicks = spellPower * spellPower; - _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + spellTicks); + newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + spellTicks); _vm->_timeline->addEventGetEventIndex(&newEvent); } break; case kDMSpellTypeOtherFootprints: { - newEvent._type = k79_TMEventTypeFootprints; + newEvent._type = kDMEventTypeFootprints; _vm->_championMan->_party._event79Count_Footprints++; _vm->_championMan->_party._firstScentIndex = _vm->_championMan->_party._scentCount; if (powerSymbolOrdinal < 3) @@ -645,7 +646,7 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) { _vm->_championMan->_party._lastScentIndex = 0; uint16 spellTicks = spellPower * spellPower; - _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + spellTicks); + newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + spellTicks); _vm->_timeline->addEventGetEventIndex(&newEvent); } break; @@ -762,7 +763,7 @@ void MenuMan::menusPrintSpellFailureMessage(Champion *champ, uint16 failureType, skillIndex = (skillIndex - 4) / 4; _vm->_textMan->printLineFeed(); - _vm->_textMan->printMessage(k4_ColorCyan, champ->_name); + _vm->_textMan->printMessage(kDMColorCyan, champ->_name); Common::String *messages; switch (_vm->getGameLanguage()) { // localized @@ -780,8 +781,8 @@ void MenuMan::menusPrintSpellFailureMessage(Champion *champ, uint16 failureType, Common::String message; switch (failureType) { case kDMFailureNeedsMorePractice: - _vm->_textMan->printMessage(k4_ColorCyan, messages[0].c_str()); - _vm->_textMan->printMessage(k4_ColorCyan, _vm->_championMan->_baseSkillName[skillIndex]); + _vm->_textMan->printMessage(kDMColorCyan, messages[0].c_str()); + _vm->_textMan->printMessage(kDMColorCyan, _vm->_championMan->_baseSkillName[skillIndex]); if (_vm->getGameLanguage() != Common::FR_FRA || skillIndex == kDMSkillWizard) message = messages[1]; else @@ -797,7 +798,7 @@ void MenuMan::menusPrintSpellFailureMessage(Champion *champ, uint16 failureType, default: break; } - _vm->_textMan->printMessage(k4_ColorCyan, message.c_str()); + _vm->_textMan->printMessage(kDMColorCyan, message.c_str()); } Potion *MenuMan::getEmptyFlaskInHand(Champion *champ, Thing *potionThing) { @@ -813,9 +814,9 @@ Potion *MenuMan::getEmptyFlaskInHand(Champion *champ, Thing *potionThing) { void MenuMan::createEvent70_light(int16 lightPower, int16 ticks) { TimelineEvent newEvent; - newEvent._type = k70_TMEventTypeLight; + newEvent._type = kDMEventTypeLight; newEvent._Bu._lightPower = lightPower; - _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + ticks); + newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + ticks); newEvent._priority = 0; _vm->_timeline->addEventGetEventIndex(&newEvent); _vm->_inventoryMan->setDungeonViewPalette(); @@ -837,20 +838,20 @@ bool MenuMan::isPartySpellOrFireShieldSuccessful(Champion *champ, bool spellShie TimelineEvent newEvent; newEvent._Bu._defense = ticks >> 5; if (spellShield) { - newEvent._type = k77_TMEventTypeSpellShield; + newEvent._type = kDMEventTypeSpellShield; if (_vm->_championMan->_party._spellShieldDefense > 50) newEvent._Bu._defense >>= 2; _vm->_championMan->_party._spellShieldDefense += newEvent._Bu._defense; } else { - newEvent._type = k78_TMEventTypeFireShield; + newEvent._type = kDMEventTypeFireShield; if (_vm->_championMan->_party._fireShieldDefense > 50) newEvent._Bu._defense >>= 2; _vm->_championMan->_party._fireShieldDefense += newEvent._Bu._defense; } newEvent._priority = 0; - _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + ticks); + newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + ticks); _vm->_timeline->addEventGetEventIndex(&newEvent); _vm->_timeline->refreshAllChampionStatusBoxes(); @@ -865,7 +866,7 @@ void MenuMan::drawAvailableSymbols(uint16 symbolStep) { for (uint16 L1214_ui_Counter = 0; L1214_ui_Counter < 6; L1214_ui_Counter++) { displayBuffer[0] = curCharacter++; textPosX += 14; - _vm->_textMan->printToLogicalScreen(textPosX, 58, k4_ColorCyan, k0_ColorBlack, displayBuffer); + _vm->_textMan->printToLogicalScreen(textPosX, 58, kDMColorCyan, kDMColorBlack, displayBuffer); } } @@ -882,7 +883,7 @@ void MenuMan::drawChampionSymbols(Champion *champ) { displayBuffer[0] = champ->_symbols[symbolIndex]; textPosX += 9; - _vm->_textMan->printToLogicalScreen(textPosX, 70, k4_ColorCyan, k0_ColorBlack, displayBuffer); + _vm->_textMan->printToLogicalScreen(textPosX, 70, kDMColorCyan, kDMColorBlack, displayBuffer); } } @@ -1106,10 +1107,10 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) { case kDMActionSwing: case kDMActionChop: if ((Square(targetSquare).getType() == kDMElementTypeDoor) && (Square(targetSquare).getDoorState() == kDMDoorStateClosed)) { - _vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized); + _vm->_sound->requestPlay(kDMSoundIndexAttackSkelettonAnimatedArmorDethKnight, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized); actionDisabledTicks = 6; _vm->_groupMan->groupIsDoorDestoryedByAttack(nextMapX, nextMapY, _vm->_championMan->getStrength(champIndex, kDMSlotActionHand), false, 2); - _vm->_sound->requestPlay(k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayOneTickLater); + _vm->_sound->requestPlay(kDMSoundIndexWoodenThudAttackTrolinAntmanStoneGolem, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayOneTickLater); break; } case kDMActionDisrupt: @@ -1136,15 +1137,15 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) { case kDMActionBrandish: case kDMActionBlowHorn: if (actionIndex == kDMActionWarCry) - _vm->_sound->requestPlay(k28_soundWAR_CRY, nextMapX, nextMapY, kDMSoundModePlayImmediately); + _vm->_sound->requestPlay(kDMSoundIndexWarCry, nextMapX, nextMapY, kDMSoundModePlayImmediately); else if (actionIndex == kDMActionBlowHorn) - _vm->_sound->requestPlay(k25_soundBLOW_HORN, nextMapX, nextMapY, kDMSoundModePlayImmediately); + _vm->_sound->requestPlay(kDMSoundIndexBlowHorn, nextMapX, nextMapY, kDMSoundModePlayImmediately); actionPerformed = isGroupFrightenedByAction(champIndex, actionIndex, nextMapX, nextMapY); break; case kDMActionShoot: { if (Thing(curChampion->_slots[kDMSlotReadyHand]).getType() != kDMThingTypeWeapon) { - _actionDamage = kM2_damageNoAmmunition; + _actionDamage = kDMDamageNoAmmunition; actionExperienceGain = 0; actionPerformed = false; break; @@ -1157,7 +1158,7 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) { int16 stepEnergy = actionHandWeaponClass; if ((actionHandWeaponClass >= kDMWeaponClassFirstBow) && (actionHandWeaponClass <= kDMWeaponClassLastBow)) { if (readyHandWeaponClass != kDMWeaponClassBowAmmunition) { - _actionDamage = kM2_damageNoAmmunition; + _actionDamage = kDMDamageNoAmmunition; actionExperienceGain = 0; actionPerformed = false; break; @@ -1165,7 +1166,7 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) { stepEnergy -= kDMWeaponClassFirstBow; } else if ((actionHandWeaponClass >= kDMWeaponClassFirstSling) && (actionHandWeaponClass <= kDMWeaponClassLastSling)) { if (readyHandWeaponClass != kDMWeaponClassSlingAmmunition) { - _actionDamage = kM2_damageNoAmmunition; + _actionDamage = kDMDamageNoAmmunition; actionExperienceGain = 0; actionPerformed = false; break; @@ -1175,7 +1176,7 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) { setChampionDirectionToPartyDirection(curChampion); Thing removedObject = _vm->_championMan->getObjectRemovedFromSlot(champIndex, kDMSlotReadyHand); - _vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized); + _vm->_sound->requestPlay(kDMSoundIndexAttackSkelettonAnimatedArmorDethKnight, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized); _vm->_championMan->championShootProjectile(curChampion, removedObject, weaponInfoActionHand->_kineticEnergy + weaponInfoReadyHand->_kineticEnergy, (weaponInfoActionHand->getShootAttack() + _vm->_championMan->getSkillLevel(champIndex, kDMSkillShoot)) << 1, stepEnergy); } break; @@ -1274,8 +1275,8 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) { int16 windowTicks = _vm->getRandomNumber(_vm->_championMan->getSkillLevel(champIndex, actionSkillIndex) + 8) + 5; TimelineEvent newEvent; newEvent._priority = 0; - newEvent._type = k73_TMEventTypeThievesEye; - _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + windowTicks); + newEvent._type = kDMEventTypeThievesEye; + newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + windowTicks); _vm->_timeline->addEventGetEventIndex(&newEvent); _vm->_championMan->_party._event73Count_ThievesEye++; decrementCharges(curChampion); @@ -1482,7 +1483,7 @@ bool MenuMan::isMeleeActionPerformed(int16 champIndex, Champion *champ, int16 ac 0 /* FUSE */ }; - _vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized); + _vm->_sound->requestPlay(kDMSoundIndexAttackSkelettonAnimatedArmorDethKnight, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized); if (_actionTargetGroupThing == Thing::_endOfList) return false; @@ -1491,24 +1492,24 @@ bool MenuMan::isMeleeActionPerformed(int16 champIndex, Champion *champ, int16 ac if (targetCreatureOrdinal) { uint16 viewCell = _vm->normalizeModulo4(championCell + 4 - champ->_dir); switch (viewCell) { - case k2_ViewCellBackRight: /* Champion is on the back right of the square and tries to attack a creature in the front right of its square */ - case k3_ViewCellBackLeft: /* Champion is on the back left of the square and tries to attack a creature in the front left of its square */ - uint16 cellDelta = (viewCell == k2_ViewCellBackRight) ? 3 : 1; + case kDMViewCellBackRight: /* Champion is on the back right of the square and tries to attack a creature in the front right of its square */ + case kDMViewCellBackLeft: /* Champion is on the back left of the square and tries to attack a creature in the front left of its square */ + uint16 cellDelta = (viewCell == kDMViewCellBackRight) ? 3 : 1; /* Check if there is another champion in front */ if (_vm->_championMan->getIndexInCell(_vm->normalizeModulo4(championCell + cellDelta)) != kDMChampionNone) { - _actionDamage = kM1_damageCantReach; + _actionDamage = kDMDamageCantReach; return false; } break; } - if ((actionIndex == kDMActionDisrupt) && !getFlag(_vm->_dungeonMan->getCreatureAttributes(_actionTargetGroupThing), k0x0040_MaskCreatureInfo_nonMaterial)) + if ((actionIndex == kDMActionDisrupt) && !getFlag(_vm->_dungeonMan->getCreatureAttributes(_actionTargetGroupThing), kDMCreatureMaskNonMaterial)) return false; uint16 actionHitProbability = actionHitProbabilityArray[actionIndex]; uint16 actionDamageFactor = actionDamageFactorArray[actionIndex]; if ((_vm->_objectMan->getIconIndex(champ->_slots[kDMSlotActionHand]) == kDMIconIndiceWeaponVorpalBlade) || (actionIndex == kDMActionDisrupt)) { - setFlag(actionHitProbability, k0x8000_hitNonMaterialCreatures); + setFlag(actionHitProbability, kDMActionMaskHitNonMaterialCreatures); } _actionDamage = _vm->_groupMan->getMeleeActionDamage(champ, champIndex, (Group *)_vm->_dungeonMan->getThingData(_actionTargetGroupThing), _vm->ordinalToIndex(targetCreatureOrdinal), targetMapX, targetMapY, actionHitProbability, actionDamageFactor, skillIndex); return true; @@ -1551,15 +1552,15 @@ bool MenuMan::isGroupFrightenedByAction(int16 champIndex, uint16 actionIndex, in Group *targetGroup = (Group *)_vm->_dungeonMan->getThingData(_actionTargetGroupThing); CreatureInfo *creatureInfo = &_vm->_dungeonMan->_creatureInfos[targetGroup->_type]; uint16 fearResistance = creatureInfo->getFearResistance(); - if ((fearResistance > _vm->getRandomNumber(frightAmount)) || (fearResistance == k15_immuneToFear)) { + if ((fearResistance > _vm->getRandomNumber(frightAmount)) || (fearResistance == kDMImmuneToFear)) { experience >>= 1; } else { ActiveGroup *activeGroup = &_vm->_groupMan->_activeGroups[targetGroup->getActiveGroupIndex()]; - if (targetGroup->getBehaviour() == k6_behavior_ATTACK) { + if (targetGroup->getBehaviour() == kDMBehaviorAttack) { _vm->_groupMan->stopAttacking(activeGroup, mapX, mapY); _vm->_groupMan->startWandering(mapX, mapY); } - targetGroup->setBehaviour(k5_behavior_FLEE); + targetGroup->setBehaviour(kDMBehaviorFlee); activeGroup->_delayFleeingFromTarget = ((16 - fearResistance) << 2) / creatureInfo->_movementTicks; retVal = true; } @@ -1593,7 +1594,7 @@ void MenuMan::printMessageAfterReplacements(const char *str) { *curCharacter = '\0'; if (outputString[1]) /* If the string is not empty (the first character is a new line \n) */ - _vm->_textMan->printMessage(k4_ColorCyan, outputString); + _vm->_textMan->printMessage(kDMColorCyan, outputString); } void MenuMan::processCommands116To119_setActingChampion(uint16 champIndex) { @@ -1681,10 +1682,10 @@ void MenuMan::setActionList(ActionSet *actionSet) { continue; uint16 minimumSkillLevel = actionSet->_actionProperties[idx - 1]; - if (getFlag(minimumSkillLevel, k0x0080_actionRequiresCharge) && !getActionObjectChargeCount()) + if (getFlag(minimumSkillLevel, kDMActionMaskRequiresCharge) && !getActionObjectChargeCount()) continue; - clearFlag(minimumSkillLevel, k0x0080_actionRequiresCharge); + clearFlag(minimumSkillLevel, kDMActionMaskRequiresCharge); if (_vm->_championMan->getSkillLevel(_vm->ordinalToIndex(_vm->_championMan->_actingChampionOrdinal), _actionSkillIndex[actionIndex]) >= minimumSkillLevel) { _actionList._actionIndices[nextAvailableActionListIndex] = (ChampionAction)actionIndex; _actionList._minimumSkillLevel[nextAvailableActionListIndex] = minimumSkillLevel; @@ -1718,7 +1719,7 @@ void MenuMan::drawActionDamage(int16 damage) { _vm->_eventMan->showMouse(); _vm->_displayMan->_useByteBoxCoordinates = false; - _vm->_displayMan->fillScreenBox(_boxActionArea, k0_ColorBlack); + _vm->_displayMan->fillScreenBox(_boxActionArea, kDMColorBlack); if (damage < 0) { static const char *messagesEN[2] = {"CAN'T REACH", "NEED AMMO"}; static const char *messagesDE[2] = {"ZU WEIT WEG", "MEHR MUNITION"}; @@ -1745,14 +1746,14 @@ void MenuMan::drawActionDamage(int16 damage) { const char *displayString; int16 textPosX; - if (damage == kM1_damageCantReach) { + if (damage == kDMDamageCantReach) { textPosX = pos[0]; displayString = message[0]; } else { textPosX = pos[1]; displayString = message[1]; } - _vm->_textMan->printToLogicalScreen(textPosX, 100, k4_ColorCyan, k0_ColorBlack, displayString); + _vm->_textMan->printToLogicalScreen(textPosX, 100, kDMColorCyan, kDMColorBlack, displayString); } else { int16 byteWidth; byte *blitBitmap; @@ -1760,26 +1761,26 @@ void MenuMan::drawActionDamage(int16 damage) { int16 displayHeight; if (damage > 40) { blitBox = &_boxActionArea3ActionMenu; - blitBitmap = _vm->_displayMan->getNativeBitmapOrGraphic(k14_damageToCreatureIndice); + blitBitmap = _vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxDamageToCreature); byteWidth = k48_byteWidth; displayHeight = 45; } else { uint16 derivedBitmapIndex; int16 destPixelWidth; if (damage > 15) { - derivedBitmapIndex = k2_DerivedBitmapDamageToCreatureMedium; + derivedBitmapIndex = kDMDerivedBitmapDamageToCreatureMedium; destPixelWidth = 64; byteWidth = k32_byteWidth; blitBox = &actionAreaMediumDamage; } else { - derivedBitmapIndex = k3_DerivedBitmapDamageToCreatureSmall; + derivedBitmapIndex = kDMDerivedBitmapDamageToCreatureSmall; destPixelWidth = 42; byteWidth = k24_byteWidth; blitBox = &actionAreaSmallDamage; } displayHeight = 37; if (!_vm->_displayMan->isDerivedBitmapInCache(derivedBitmapIndex)) { - byte *nativeBitmap = _vm->_displayMan->getNativeBitmapOrGraphic(k14_damageToCreatureIndice); + byte *nativeBitmap = _vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxDamageToCreature); blitBitmap = _vm->_displayMan->getDerivedBitmap(derivedBitmapIndex); _vm->_displayMan->blitToBitmapShrinkWithPalChange(nativeBitmap, blitBitmap, 96, 45, destPixelWidth, 37, _vm->_displayMan->_palChangesNoChanges); _vm->_displayMan->addDerivedBitmap(derivedBitmapIndex); @@ -1787,7 +1788,7 @@ void MenuMan::drawActionDamage(int16 damage) { blitBitmap = _vm->_displayMan->getDerivedBitmap(derivedBitmapIndex); } } - _vm->_displayMan->blitToScreen(blitBitmap, blitBox, byteWidth, kM1_ColorNoTransparency, displayHeight); + _vm->_displayMan->blitToScreen(blitBitmap, blitBox, byteWidth, kDMColorNoTransparency, displayHeight); /* Convert damage value to string */ uint16 charIndex = 5; int16 textPosX = 274; @@ -1797,7 +1798,7 @@ void MenuMan::drawActionDamage(int16 damage) { scoreString[--charIndex] = '0' + (damage % 10); textPosX -= 3; } while (damage /= 10); - _vm->_textMan->printToLogicalScreen(textPosX, 100, k4_ColorCyan, k0_ColorBlack, &scoreString[charIndex]); + _vm->_textMan->printToLogicalScreen(textPosX, 100, kDMColorCyan, kDMColorBlack, &scoreString[charIndex]); } _vm->_eventMan->hideMouse(); } |