From d69236e67430ffe1e5ac07abc2015f6bbf36d580 Mon Sep 17 00:00:00 2001 From: Bendegúz Nagy Date: Fri, 26 Aug 2016 22:47:44 +0200 Subject: DM: Rename functions --- engines/dm/champion.cpp | 258 ++++++++++----------- engines/dm/champion.h | 50 ++--- engines/dm/dm.cpp | 50 ++--- engines/dm/dm.h | 12 +- engines/dm/dungeonman.cpp | 134 +++++------ engines/dm/dungeonman.h | 50 ++--- engines/dm/eventman.cpp | 136 +++++------ engines/dm/eventman.h | 24 +- engines/dm/gfx.cpp | 558 +++++++++++++++++++++++----------------------- engines/dm/gfx.h | 90 ++++---- engines/dm/group.cpp | 24 +- engines/dm/group.h | 10 +- engines/dm/inventory.cpp | 178 +++++++-------- engines/dm/inventory.h | 32 +-- engines/dm/loadsave.cpp | 12 +- engines/dm/loadsave.h | 2 +- engines/dm/menus.cpp | 104 ++++----- engines/dm/menus.h | 20 +- engines/dm/movesens.cpp | 24 +- engines/dm/movesens.h | 2 +- engines/dm/objectman.cpp | 36 +-- engines/dm/objectman.h | 12 +- engines/dm/text.cpp | 16 +- engines/dm/text.h | 6 +- engines/dm/timeline.cpp | 2 +- engines/dm/timeline.h | 2 +- 26 files changed, 922 insertions(+), 922 deletions(-) (limited to 'engines/dm') diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp index 62fff7f7b3..7986650644 100644 --- a/engines/dm/champion.cpp +++ b/engines/dm/champion.cpp @@ -93,22 +93,22 @@ Box gBoxChampionPortrait = Box(0, 31, 0, 28); // @ G0047_s_Graphic562_Box_Champi ChampionMan::ChampionMan(DMEngine *vm) : _vm(vm) { _g411_leaderIndex = kM1_ChampionNone; - _303_partyDead = false; + _g303_partyDead = false; _g300_partyIsSleeping = false; _g413_leaderHandObjectIconIndex = kM1_IconIndiceNone; _g415_leaderEmptyHanded = true; _g514_magicCasterChampionIndex = kM1_ChampionNone; } -uint16 ChampionMan::getChampionPortraitX(uint16 index) { +uint16 ChampionMan::M27_getChampionPortraitX(uint16 index) { return ((index) & 0x7) << 5; } -uint16 ChampionMan::getChampionPortraitY(uint16 index) { +uint16 ChampionMan::M28_getChampionPortraitY(uint16 index) { return ((index) >> 3) * 29; } -int16 ChampionMan::getDecodedValue(char *string, uint16 characterCount) { +int16 ChampionMan::f279_getDecodedValue(char *string, uint16 characterCount) { int val = 0; for (uint16 i = 0; i < characterCount; ++i) { val = (val << 4) + (string[i] - 'A'); @@ -116,19 +116,19 @@ int16 ChampionMan::getDecodedValue(char *string, uint16 characterCount) { return val; } -void ChampionMan::drawHealthOrStaminaOrManaValue(int16 posY, int16 currVal, int16 maxVal) { - Common::String tmp = getStringFromInteger(currVal, true, 3).c_str(); - _vm->_textMan->printToViewport(55, posY, k13_ColorLightestGray, tmp.c_str()); - _vm->_textMan->printToViewport(73, posY, k13_ColorLightestGray, "/"); - tmp = getStringFromInteger(maxVal, true, 3); - _vm->_textMan->printToViewport(79, posY, k13_ColorLightestGray, tmp.c_str()); +void ChampionMan::f289_drawHealthOrStaminaOrManaValue(int16 posY, int16 currVal, int16 maxVal) { + Common::String tmp = f288_getStringFromInteger(currVal, true, 3).c_str(); + _vm->_textMan->f52_printToViewport(55, posY, k13_ColorLightestGray, tmp.c_str()); + _vm->_textMan->f52_printToViewport(73, posY, k13_ColorLightestGray, "/"); + tmp = f288_getStringFromInteger(maxVal, true, 3); + _vm->_textMan->f52_printToViewport(79, posY, k13_ColorLightestGray, tmp.c_str()); } -uint16 ChampionMan::handSlotIndex(uint16 slotBoxIndex) { +uint16 ChampionMan::M70_handSlotIndex(uint16 slotBoxIndex) { return slotBoxIndex & 0x1; } -Common::String ChampionMan::getStringFromInteger(uint16 val, bool padding, uint16 paddingCharCount) { +Common::String ChampionMan::f288_getStringFromInteger(uint16 val, bool padding, uint16 paddingCharCount) { using namespace Common; String valToStr = String::format("%d", val); String result; @@ -138,15 +138,15 @@ Common::String ChampionMan::getStringFromInteger(uint16 val, bool padding, uint1 return result += valToStr; } -void ChampionMan::applyModifiersToStatistics(Champion* champ, ChampionSlot slotIndex, IconIndice iconIndex, int16 modifierFactor, Thing thing) { +void ChampionMan::f299_pplyModifiersToStatistics(Champion* champ, ChampionSlot slotIndex, IconIndice iconIndex, int16 modifierFactor, Thing thing) { int16 statIndex; int16 modifier = 0; ThingType thingType = thing.getType(); if (((thingType == k5_WeaponThingType) || (thingType == k6_ArmourThingType)) && (slotIndex >= k0_ChampionSlotReadyHand) && (slotIndex <= k12_ChampionSlotQuiverLine_1_1)) { - Weapon *weapon = (Weapon*)_vm->_dungeonMan->getThingData(thing); - Armour *armour = (Armour*)_vm->_dungeonMan->getThingData(thing); + Weapon *weapon = (Weapon*)_vm->_dungeonMan->f156_getThingData(thing); + Armour *armour = (Armour*)_vm->_dungeonMan->f156_getThingData(thing); if (((thingType == k5_WeaponThingType) && weapon->getCursed()) || ((thingType == k6_ArmourThingType) && armour->getCursed())) { statIndex = k0_ChampionStatLuck; @@ -273,20 +273,20 @@ T0299044_ApplyModifier: } -bool ChampionMan::hasObjectIconInSlotBoxChanged(int16 slotBoxIndex, Thing thing) { +bool ChampionMan::f295_hasObjectIconInSlotBoxChanged(int16 slotBoxIndex, Thing thing) { ObjectMan &objMan = *_vm->_objectMan; - IconIndice currIconIndex = objMan.getIconIndexInSlotBox(slotBoxIndex); + IconIndice currIconIndex = objMan.f39_getIconIndexInSlotBox(slotBoxIndex); if (((currIconIndex < k32_IconIndiceWeaponDagger) && (currIconIndex >= k0_IconIndiceJunkCompassNorth)) || ((currIconIndex >= k148_IconIndicePotionMaPotionMonPotion) && (currIconIndex <= k163_IconIndicePotionWaterFlask)) || (currIconIndex == k195_IconIndicePotionEmptyFlask)) { - IconIndice newIconIndex = objMan.getIconIndex(thing); + IconIndice newIconIndex = objMan.f33_getIconIndex(thing); if (newIconIndex != currIconIndex) { if ((slotBoxIndex < k8_SlotBoxInventoryFirstSlot) && !_g420_mousePointerHiddenToDrawChangedObjIconOnScreen) { _g420_mousePointerHiddenToDrawChangedObjIconOnScreen = true; warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE"); } - objMan.drawIconInSlotBox(slotBoxIndex, newIconIndex); + objMan.f38_drawIconInSlotBox(slotBoxIndex, newIconIndex); return true; } } @@ -294,7 +294,7 @@ bool ChampionMan::hasObjectIconInSlotBoxChanged(int16 slotBoxIndex, Thing thing) return false; } -void ChampionMan::drawChangedObjectIcons() { +void ChampionMan::f296_drawChangedObjectIcons() { InventoryMan &invMan = *_vm->_inventoryMan; ObjectMan &objMan = *_vm->_objectMan; MenuMan &menuMan = *_vm->_menuMan; @@ -309,52 +309,52 @@ void ChampionMan::drawChangedObjectIcons() { if (((leaderHandObjIconIndex < k32_IconIndiceWeaponDagger) && (leaderHandObjIconIndex >= k0_IconIndiceJunkCompassNorth)) // < instead of <= is correct || ((leaderHandObjIconIndex >= k148_IconIndicePotionMaPotionMonPotion) && (leaderHandObjIconIndex <= k163_IconIndicePotionWaterFlask)) || (leaderHandObjIconIndex == k195_IconIndicePotionEmptyFlask)) { - IconIndice iconIndex = objMan.getIconIndex(_414_leaderHandObject); + IconIndice iconIndex = objMan.f33_getIconIndex(_g414_leaderHandObject); if (iconIndex != leaderHandObjIconIndex) { _g420_mousePointerHiddenToDrawChangedObjIconOnScreen = true; warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE"); - objMan.extractIconFromBitmap(iconIndex, objMan._g412_objectIconForMousePointer); + objMan.f36_extractIconFromBitmap(iconIndex, objMan._g412_objectIconForMousePointer); warning("MISSING CODE: F0068_MOUSE_SetPointerToObject"); _g413_leaderHandObjectIconIndex = iconIndex; - objMan.drawLeaderObjectName(_414_leaderHandObject); + objMan.f34_drawLeaderObjectName(_g414_leaderHandObject); } } for (uint16 slotBoxIndex = 0; slotBoxIndex < (_g305_partyChampionCount * 2); ++slotBoxIndex) { int16 champIndex = slotBoxIndex >> 1; - if (invChampOrdinal == _vm->indexToOrdinal(champIndex)) + if (invChampOrdinal == _vm->M0_indexToOrdinal(champIndex)) continue; - if (hasObjectIconInSlotBoxChanged(slotBoxIndex, _champions[champIndex].getSlot((ChampionSlot)handSlotIndex(slotBoxIndex))) - && (handSlotIndex(slotBoxIndex) == k1_ChampionSlotActionHand)) { + if (f295_hasObjectIconInSlotBoxChanged(slotBoxIndex, _gK71_champions[champIndex].getSlot((ChampionSlot)M70_handSlotIndex(slotBoxIndex))) + && (M70_handSlotIndex(slotBoxIndex) == k1_ChampionSlotActionHand)) { - menuMan.drawActionIcon((ChampionIndex)champIndex); + menuMan.f386_drawActionIcon((ChampionIndex)champIndex); } } if (invChampOrdinal) { - Champion *champ = &_champions[_vm->ordinalToIndex(invChampOrdinal)]; + Champion *champ = &_gK71_champions[_vm->M1_ordinalToIndex(invChampOrdinal)]; Thing *thing = &champ->getSlot(k0_ChampionSlotReadyHand); uint16 drawViewport = 0; for (uint16 slotIndex = k0_ChampionSlotReadyHand; slotIndex < k30_ChampionSlotChest_1; slotIndex++, thing++) { - uint16 objIconChanged = hasObjectIconInSlotBoxChanged(slotIndex + k8_SlotBoxInventoryFirstSlot, *thing) ? 1 : 0; + uint16 objIconChanged = f295_hasObjectIconInSlotBoxChanged(slotIndex + k8_SlotBoxInventoryFirstSlot, *thing) ? 1 : 0; drawViewport |= objIconChanged; if (objIconChanged && (slotIndex == k1_ChampionSlotActionHand)) { - menuMan.drawActionIcon((ChampionIndex)_vm->ordinalToIndex(invChampOrdinal)); + menuMan.f386_drawActionIcon((ChampionIndex)_vm->M1_ordinalToIndex(invChampOrdinal)); } } if (invMan._g424_panelContent = k4_PanelContentChest) { thing = invMan._g425_chestSlots; for (int16 slotIndex = 0; slotIndex < 8; ++slotIndex, thing++) { - drawViewport |= (hasObjectIconInSlotBoxChanged(slotIndex + k38_SlotBoxChestFirstSlot, *thing) ? 1 : 0); + drawViewport |= (f295_hasObjectIconInSlotBoxChanged(slotIndex + k38_SlotBoxChestFirstSlot, *thing) ? 1 : 0); } } if (drawViewport) { champ->setAttributeFlag(k0x4000_ChampionAttributeViewport, true); - drawChampionState((ChampionIndex)_vm->ordinalToIndex(invChampOrdinal)); + f292_drawChampionState((ChampionIndex)_vm->M1_ordinalToIndex(invChampOrdinal)); } } @@ -362,7 +362,7 @@ void ChampionMan::drawChangedObjectIcons() { warning("MISSING CODE: F0078_MOUSE_ShowPointer"); } -void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, ChampionSlot slotIndex) { +void ChampionMan::f301_addObjectInSlot(ChampionIndex champIndex, Thing thing, ChampionSlot slotIndex) { InventoryMan &invMan = *_vm->_inventoryMan; DungeonMan &dunMan = *_vm->_dungeonMan; ObjectMan &objMan = *_vm->_objectMan; @@ -371,7 +371,7 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio if (thing == Thing::_none) return; - Champion *champ = &_champions[champIndex]; + Champion *champ = &_gK71_champions[champIndex]; if (slotIndex >= k30_ChampionSlotChest_1) { invMan._g425_chestSlots[slotIndex - k30_ChampionSlotChest_1] = thing; @@ -379,30 +379,30 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio champ->setSlot(slotIndex, thing); } - champ->_load += dunMan.getObjectWeight(thing); + champ->_load += dunMan.f140_getObjectWeight(thing); champ->setAttributeFlag(k0x0200_ChampionAttributeLoad, true); - IconIndice iconIndex = objMan.getIconIndex(thing); - bool isInventoryChampion = (_vm->indexToOrdinal(champIndex) == invMan._g432_inventoryChampionOrdinal); - applyModifiersToStatistics(champ, slotIndex, iconIndex, 1, thing); - uint16 *rawObjPtr = dunMan.getThingData(thing); + IconIndice iconIndex = objMan.f33_getIconIndex(thing); + bool isInventoryChampion = (_vm->M0_indexToOrdinal(champIndex) == invMan._g432_inventoryChampionOrdinal); + f299_pplyModifiersToStatistics(champ, slotIndex, iconIndex, 1, thing); + uint16 *rawObjPtr = dunMan.f156_getThingData(thing); if (slotIndex < k2_ChampionSlotHead) { if (slotIndex == k1_ChampionSlotActionHand) { champ->setAttributeFlag(k0x8000_ChampionAttributeActionHand, true); - if (_g506_actingChampionOrdinal == _vm->indexToOrdinal(champIndex)) - menuMan.clearActingChampion(); + if (_g506_actingChampionOrdinal == _vm->M0_indexToOrdinal(champIndex)) + menuMan.f388_clearActingChampion(); if ((iconIndex >= k30_IconIndiceScrollOpen) && (iconIndex <= k31_IconIndiceScrollClosed)) { ((Scroll*)rawObjPtr)->setClosed(false); - drawChangedObjectIcons(); + f296_drawChangedObjectIcons(); } } if (iconIndex = k4_IconIndiceWeaponTorchUnlit) { ((Weapon*)rawObjPtr)->setLit(true); warning("MISSING CODE: F0337_INVENTORY_SetDungeonViewPalette"); - drawChangedObjectIcons(); + f296_drawChangedObjectIcons(); } else if (isInventoryChampion && (slotIndex == k1_ChampionSlotActionHand) && ((iconIndex == k144_IconIndiceContainerChestClosed) || ((iconIndex >= k30_IconIndiceScrollOpen) && (iconIndex <= k31_IconIndiceScrollClosed)))) { champ->setAttributeFlag(k0x0800_ChampionAttributePanel, true); @@ -422,33 +422,33 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio } - drawSlot(champIndex, slotIndex); + f291_drawSlot(champIndex, slotIndex); if (isInventoryChampion) champ->setAttributeFlag(k0x4000_ChampionAttributeViewport, true); } -ChampionIndex ChampionMan::getIndexInCell(ViewCell cell) { +ChampionIndex ChampionMan::f285_getIndexInCell(ViewCell cell) { for (uint16 i = 0; i < _g305_partyChampionCount; ++i) { - if ((_champions[i]._cell == cell) && _champions[i]._currHealth) + if ((_gK71_champions[i]._cell == cell) && _gK71_champions[i]._currHealth) return (ChampionIndex)i; } return kM1_ChampionNone; } -void ChampionMan::resetDataToStartGame() { +void ChampionMan::f278_resetDataToStartGame() { if (!_vm->_g298_newGame) { warning("MISSING CODE: stuff for resetting for loaded games"); assert(false); } - _414_leaderHandObject = Thing::_none; + _g414_leaderHandObject = Thing::_none; _g413_leaderHandObjectIconIndex = kM1_IconIndiceNone; _g415_leaderEmptyHanded = true; } -void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) { +void ChampionMan::f280_addCandidateChampionToParty(uint16 championPortraitIndex) { DisplayMan &dispMan = *_vm->_displayMan; DungeonMan &dunMan = *_vm->_dungeonMan; @@ -456,12 +456,12 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) { return; uint16 prevChampCount = _g305_partyChampionCount; - Champion *champ = &_champions[prevChampCount]; + Champion *champ = &_gK71_champions[prevChampCount]; champ->resetToZero(); dispMan._g578_useByteBoxCoordinates = true; { // limit destBox scope Box &destBox = gBoxChampionPortrait; - dispMan.blitToBitmap(dispMan.getBitmap(k26_ChampionPortraitsIndice), 256, getChampionPortraitX(championPortraitIndex), getChampionPortraitY(championPortraitIndex), + dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k26_ChampionPortraitsIndice), 256, M27_getChampionPortraitX(championPortraitIndex), M28_getChampionPortraitY(championPortraitIndex), champ->_portrait, 32, destBox, k255_ColorNoTransparency); } @@ -470,7 +470,7 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) { champ->_hideDamageReceivedIndex = -1; champ->_dir = dunMan._g308_partyDir; ViewCell AL_0_viewCell = k0_ViewCellFronLeft; - while (getIndexInCell((ViewCell)((AL_0_viewCell + dunMan._g308_partyDir) & 3)) != kM1_ChampionNone) + while (f285_getIndexInCell((ViewCell)((AL_0_viewCell + dunMan._g308_partyDir) & 3)) != kM1_ChampionNone) AL_0_viewCell = (ViewCell)(AL_0_viewCell + 1); champ->_cell = (ViewCell)((AL_0_viewCell + dunMan._g308_partyDir) & 3); champ->clearAttributes(k0x0400_ChampionAttributeIcon); @@ -481,13 +481,13 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) { for (AL_0_slotIndex_Red = k0_ChampionSlotReadyHand; AL_0_slotIndex_Red < k30_ChampionSlotChest_1; ++AL_0_slotIndex_Red) { champ->setSlot((ChampionSlot)AL_0_slotIndex_Red, Thing::_none); } - Thing thing = dunMan.getSquareFirstThing(dunMan._g306_partyMapX, dunMan._g307_partyMapY); + Thing thing = dunMan.f161_getSquareFirstThing(dunMan._g306_partyMapX, dunMan._g307_partyMapY); while (thing.getType() != k2_TextstringType) { - thing = dunMan.getNextThing(thing); + thing = dunMan.f159_getNextThing(thing); } char decodedChampionText[77]; char* character_Green = decodedChampionText; - dunMan.decodeText(character_Green, thing, (TextType)(k2_TextTypeScroll | k0x8000_DecodeEvenIfInvisible)); + dunMan.f168_decodeText(character_Green, thing, (TextType)(k2_TextTypeScroll | k0x8000_DecodeEvenIfInvisible)); int16 AL_0_characterIndex = 0; uint16 AL_2_character; while ((AL_2_character = *character_Green++) != '\n') { @@ -511,18 +511,18 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) { champ->setAttributeFlag(k0x0010_ChampionAttributeMale, true); } character_Green++; - champ->_currHealth = champ->_maxHealth = getDecodedValue(character_Green, 4); + champ->_currHealth = champ->_maxHealth = f279_getDecodedValue(character_Green, 4); character_Green += 4; - champ->_currStamina = champ->_maxStamina = getDecodedValue(character_Green, 4); + champ->_currStamina = champ->_maxStamina = f279_getDecodedValue(character_Green, 4); character_Green += 4; - champ->_currMana = champ->_maxMana = getDecodedValue(character_Green, 4); + champ->_currMana = champ->_maxMana = f279_getDecodedValue(character_Green, 4); character_Green += 4; character_Green++; int16 AL_0_statisticIndex; for (AL_0_statisticIndex = k0_ChampionStatLuck; AL_0_statisticIndex <= k6_ChampionStatAntifire; ++AL_0_statisticIndex) { champ->setStatistic((ChampionStatisticType)AL_0_statisticIndex, k2_ChampionStatMinimum, 30); - uint16 currMaxVal = getDecodedValue(character_Green, 2); + uint16 currMaxVal = f279_getDecodedValue(character_Green, 2); champ->setStatistic((ChampionStatisticType)AL_0_statisticIndex, k1_ChampionStatCurrent, currMaxVal); champ->setStatistic((ChampionStatisticType)AL_0_statisticIndex, k0_ChampionStatMaximum, currMaxVal); character_Green += 2; @@ -550,11 +550,11 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) { _g299_candidateChampionOrdinal = prevChampCount + 1; if (++_g305_partyChampionCount == 1) { - _vm->_eventMan->commandSetLeader(k0_ChampionFirst); + _vm->_eventMan->f368_commandSetLeader(k0_ChampionFirst); _vm->_menuMan->_g508_refreshActionArea = true; } else { - _vm->_menuMan->clearActingChampion(); - _vm->_menuMan->drawActionIcon((ChampionIndex)(_g305_partyChampionCount - 1)); + _vm->_menuMan->f388_clearActingChampion(); + _vm->_menuMan->f386_drawActionIcon((ChampionIndex)(_g305_partyChampionCount - 1)); } int16 mapX = _vm->_dungeonMan->_g306_partyMapX; @@ -563,13 +563,13 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) { uint16 championObjectsCell = returnOppositeDir((direction)(dunMan._g308_partyDir)); mapX += _vm->_dirIntoStepCountEast[dunMan._g308_partyDir]; mapY += _vm->_dirIntoStepCountNorth[dunMan._g308_partyDir]; - thing = dunMan.getSquareFirstThing(mapX, mapY); + thing = dunMan.f161_getSquareFirstThing(mapX, mapY); AL_0_slotIndex_Red = k13_ChampionSlotBackpackLine_1_1; uint16 slotIndex_Green; while (thing != Thing::_endOfList) { ThingType AL_2_thingType = thing.getType(); if ((AL_2_thingType > k3_SensorThingType) && (thing.getCell() == championObjectsCell)) { - int16 objectAllowedSlots = g237_ObjectInfo[dunMan.getObjectInfoIndex(thing)].getAllowedSlots(); + int16 objectAllowedSlots = g237_ObjectInfo[dunMan.f141_getObjectInfoIndex(thing)].getAllowedSlots(); switch (AL_2_thingType) { case k6_ArmourThingType: for (slotIndex_Green = k2_ChampionSlotHead; slotIndex_Green <= k5_ChampionSlotFeet; slotIndex_Green++) { @@ -616,18 +616,18 @@ T0280048: if (champ->getSlot((ChampionSlot)slotIndex_Green) != Thing::_none) { goto T0280046; } - addObjectInSlot((ChampionIndex)prevChampCount, thing, (ChampionSlot)slotIndex_Green); + f301_addObjectInSlot((ChampionIndex)prevChampCount, thing, (ChampionSlot)slotIndex_Green); } - thing = dunMan.getNextThing(thing); + thing = dunMan.f159_getNextThing(thing); } - _vm->_inventoryMan->toggleInventory((ChampionIndex)prevChampCount); - _vm->_menuMan->drawDisabledMenu(); + _vm->_inventoryMan->f355_toggleInventory((ChampionIndex)prevChampCount); + _vm->_menuMan->f456_drawDisabledMenu(); } -void ChampionMan::drawChampionBarGraphs(ChampionIndex champIndex) { +void ChampionMan::f287_drawChampionBarGraphs(ChampionIndex champIndex) { - Champion *curChampion = &_champions[champIndex]; + Champion *curChampion = &_gK71_champions[champIndex]; int16 barGraphIndex = 0; int16 barGraphHeightArray[3]; @@ -676,12 +676,12 @@ void ChampionMan::drawChampionBarGraphs(ChampionIndex champIndex) { if (barGraphHeight < 25) { box._y1 = 2; box._y1 = 27 - barGraphHeight + 1; - _vm->_displayMan->clearScreenBox(g46_ChampionColor[champIndex], box); + _vm->_displayMan->D24_clearScreenBox(g46_ChampionColor[champIndex], box); } if (barGraphHeight) { box._y1 = 27 - barGraphHeight; box._y2 = 26 + 1; - _vm->_displayMan->clearScreenBox(g46_ChampionColor[champIndex], box); + _vm->_displayMan->D24_clearScreenBox(g46_ChampionColor[champIndex], box); } box._x1 += 7; box._x2 += 7; @@ -690,7 +690,7 @@ void ChampionMan::drawChampionBarGraphs(ChampionIndex champIndex) { } -uint16 ChampionMan::getStaminaAdjustedValue(Champion *champ, int16 val) { +uint16 ChampionMan::f306_getStaminaAdjustedValue(Champion *champ, int16 val) { int16 currStamina = champ->_currStamina; int16 halfMaxStamina = champ->_maxStamina / 2; if (currStamina < halfMaxStamina) { @@ -701,14 +701,14 @@ uint16 ChampionMan::getStaminaAdjustedValue(Champion *champ, int16 val) { return val; } -uint16 ChampionMan::getMaximumLoad(Champion *champ) { +uint16 ChampionMan::f309_getMaximumLoad(Champion *champ) { uint16 maximumLoad = champ->getStatistic(k1_ChampionStatStrength, k1_ChampionStatCurrent) * 8 + 100; - maximumLoad = getStaminaAdjustedValue(champ, maximumLoad); + maximumLoad = f306_getStaminaAdjustedValue(champ, maximumLoad); int16 wounds = champ->getWounds(); if (wounds) { maximumLoad -= maximumLoad >> (champ->getWoundsFlag(k0x0010_ChampionWoundLegs) ? 2 : 3); } - if (_vm->_objectMan->getIconIndex(champ->getSlot(k5_ChampionSlotFeet)) == k119_IconIndiceArmourElvenBoots) { + if (_vm->_objectMan->f33_getIconIndex(champ->getSlot(k5_ChampionSlotFeet)) == k119_IconIndiceArmourElvenBoots) { maximumLoad += maximumLoad * 16; } maximumLoad += 9; @@ -716,7 +716,7 @@ uint16 ChampionMan::getMaximumLoad(Champion *champ) { return maximumLoad; } -void ChampionMan::drawChampionState(ChampionIndex champIndex) { +void ChampionMan::f292_drawChampionState(ChampionIndex champIndex) { InventoryMan &invMan = *_vm->_inventoryMan; DisplayMan &dispMan = *_vm->_displayMan; MenuMan &menuMan = *_vm->_menuMan; @@ -724,14 +724,14 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) { Box box; int16 champStatusBoxX = champIndex * k69_ChampionStatusBoxSpacing; - Champion *champ = &_champions[champIndex]; + Champion *champ = &_gK71_champions[champIndex]; uint16 champAttributes = champ->getAttributes(); if (!((champAttributes) & (k0x0080_ChampionAttributeNameTitle | k0x0100_ChampionAttributeStatistics | k0x0200_ChampionAttributeLoad | k0x0400_ChampionAttributeIcon | k0x0800_ChampionAttributePanel | k0x1000_ChampionAttributeStatusBox | k0x2000_ChampionAttributeWounds | k0x4000_ChampionAttributeViewport | k0x8000_ChampionAttributeActionHand))) { return; } - bool isInventoryChamp = (_vm->indexToOrdinal(champIndex) == invMan._g432_inventoryChampionOrdinal); + bool isInventoryChamp = (_vm->M0_indexToOrdinal(champIndex) == invMan._g432_inventoryChampionOrdinal); dispMan._g578_useByteBoxCoordinates = false; if (champAttributes & k0x1000_ChampionAttributeStatusBox) { box._y1 = 0; @@ -739,7 +739,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) { box._x1 = champStatusBoxX; box._x2 = box._x1 + 66 + 1; if (champ->_currHealth) { - dispMan.clearScreenBox(k12_ColorDarkestGray, box); + dispMan.D24_clearScreenBox(k12_ColorDarkestGray, box); int16 nativeBitmapIndices[3]; for (int16 i = 0; i < 3; ++i) nativeBitmapIndices[i] = 0; @@ -751,20 +751,20 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) { if (_g407_party._shieldDefense > 0) nativeBitmapIndices[AL_0_borderCount++] = k37_BorderPartyShieldIndice; while (AL_0_borderCount--) { - dispMan.blitToBitmap(dispMan.getBitmap(nativeBitmapIndices[AL_0_borderCount]), 80, 0, 0, + dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(nativeBitmapIndices[AL_0_borderCount]), 80, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, box, k10_ColorFlesh); } if (isInventoryChamp) { - invMan.drawStatusBoxPortrait(champIndex); + invMan.f354_drawStatusBoxPortrait(champIndex); champAttributes |= k0x0100_ChampionAttributeStatistics; } else { champAttributes |= (k0x0080_ChampionAttributeNameTitle | k0x0100_ChampionAttributeStatistics | k0x2000_ChampionAttributeWounds | k0x8000_ChampionAttributeActionHand); } } else { - dispMan.blitToBitmap(dispMan.getBitmap(k8_StatusBoxDeadChampion), 80, 0, 0, + dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k8_StatusBoxDeadChampion), 80, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, box, k255_ColorNoTransparency); _vm->_textMan->f53_printToLogicalScreen(champStatusBoxX + 1, 5, k13_ColorLightestGray, k1_ColorDarkGary, champ->_name); - menuMan.drawActionIcon(champIndex); + menuMan.f386_drawActionIcon(champIndex); goto T0292042_green; } } @@ -776,35 +776,35 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) { Color AL_0_colorIndex = (champIndex == _g411_leaderIndex) ? k9_ColorGold : k13_ColorLightestGray; // unused because of missing functions if (isInventoryChamp) { char *champName = champ->_name; - _vm->_textMan->printToViewport(3, 7, AL_0_colorIndex, champName); + _vm->_textMan->f52_printToViewport(3, 7, AL_0_colorIndex, champName); int16 champTitleX = 6 * strlen(champName) + 3; char champTitleFirstChar = champ->_title[0]; if ((champTitleFirstChar != ',') && (champTitleFirstChar != ';') && (champTitleFirstChar != '-')) { champTitleX += 6; } - _vm->_textMan->printToViewport(champTitleX, 7, AL_0_colorIndex, champ->_title); + _vm->_textMan->f52_printToViewport(champTitleX, 7, AL_0_colorIndex, champ->_title); champAttributes |= k0x4000_ChampionAttributeViewport; } else { box._y1 = 0; box._y2 = 6 + 1; box._x1 = champStatusBoxX; box._x2 = box._x1 + 42 + 1; - dispMan.clearScreenBox(k1_ColorDarkGary, box); + dispMan.D24_clearScreenBox(k1_ColorDarkGary, box); _vm->_textMan->f53_printToLogicalScreen(champStatusBoxX + 1, 5, AL_0_colorIndex, k1_ColorDarkGary, champ->_name); } } if (champAttributes & k0x0100_ChampionAttributeStatistics) { - drawChampionBarGraphs(champIndex); + f287_drawChampionBarGraphs(champIndex); if (isInventoryChamp) { - drawHealthStaminaManaValues(champ); + f290_drawHealthStaminaManaValues(champ); int16 AL_2_nativeBitmapIndex; if ((champ->_food < 0) || (champ->_water < 0) || (champ->_poisonEventCount)) { AL_2_nativeBitmapIndex = k34_SlotBoxWoundedIndice; } else { AL_2_nativeBitmapIndex = k33_SlotBoxNormalIndice; } - dispMan.blitToBitmap(dispMan.getBitmap(AL_2_nativeBitmapIndex), 32, 0, 0, + dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(AL_2_nativeBitmapIndex), 32, 0, 0, dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, gBoxMouth, k12_ColorDarkestGray); AL_2_nativeBitmapIndex = k33_SlotBoxNormalIndice; for (int16 AL_0_statisticIndex = k1_ChampionStatStrength; AL_0_statisticIndex <= k6_ChampionStatAntifire; AL_0_statisticIndex++) { @@ -814,7 +814,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) { break; } } - dispMan.blitToBitmap(dispMan.getBitmap(AL_2_nativeBitmapIndex), 32, 0, 0, + dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(AL_2_nativeBitmapIndex), 32, 0, 0, dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, gBoxEye, k12_ColorDarkestGray); champAttributes |= k0x4000_ChampionAttributeViewport; } @@ -822,7 +822,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) { if (champAttributes & k0x2000_ChampionAttributeWounds) { for (int16 AL_0_slotIndex = isInventoryChamp ? k5_ChampionSlotFeet : k1_ChampionSlotActionHand; AL_0_slotIndex >= k0_ChampionSlotReadyHand; AL_0_slotIndex--) { - drawSlot(champIndex, (ChampionSlot)AL_0_slotIndex); + f291_drawSlot(champIndex, (ChampionSlot)AL_0_slotIndex); } if (isInventoryChamp) { champAttributes |= k0x4000_ChampionAttributeViewport; @@ -831,7 +831,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) { if ((champAttributes & k0x0200_ChampionAttributeLoad) && isInventoryChamp) { Color loadColor; - int16 champMaxLoad = getMaximumLoad(champ); + int16 champMaxLoad = f309_getMaximumLoad(champ); if (champ->_load > champMaxLoad) { loadColor = k8_ColorRed; } else if (((int32)champ->_load) * 8 > ((int32)champMaxLoad) * 5) { @@ -839,46 +839,46 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) { } else { loadColor = k13_ColorLightestGray; } - _vm->_textMan->printToViewport(104, 132, loadColor, "LOAD "); + _vm->_textMan->f52_printToViewport(104, 132, loadColor, "LOAD "); int16 loadTmp = champ->_load / 10; - Common::String str = getStringFromInteger(loadTmp, true, 3); + Common::String str = f288_getStringFromInteger(loadTmp, true, 3); str += '.'; loadTmp = champ->_load - (loadTmp * 10); - str += getStringFromInteger(loadTmp, false, 1); + str += f288_getStringFromInteger(loadTmp, false, 1); str += '/'; - loadTmp = (getMaximumLoad(champ) + 5) / 10; + loadTmp = (f309_getMaximumLoad(champ) + 5) / 10; str += "KG"; - _vm->_textMan->printToViewport(148, 132, loadColor, str.c_str()); + _vm->_textMan->f52_printToViewport(148, 132, loadColor, str.c_str()); champAttributes |= k0x4000_ChampionAttributeViewport; } { // block so goto won't skip AL_0_championIconIndex initialization - int16 AL_0_championIconIndex = championIconIndex(champ->_cell, _vm->_dungeonMan->_g308_partyDir); + int16 AL_0_championIconIndex = M26_championIconIndex(champ->_cell, _vm->_dungeonMan->_g308_partyDir); - if ((champAttributes & k28_ChampionIcons) && (eventMan._g599_useChampionIconOrdinalAsMousePointerBitmap != _vm->indexToOrdinal(AL_0_championIconIndex))) { - dispMan.clearScreenBox(g46_ChampionColor[champIndex], g54_BoxChampionIcons[AL_0_championIconIndex]); - dispMan.blitToBitmap(dispMan.getBitmap(k28_ChampionIcons), 80, championIconIndex(champ->_dir, _vm->_dungeonMan->_g308_partyDir) * 19, 0, + if ((champAttributes & k28_ChampionIcons) && (eventMan._g599_useChampionIconOrdinalAsMousePointerBitmap != _vm->M0_indexToOrdinal(AL_0_championIconIndex))) { + dispMan.D24_clearScreenBox(g46_ChampionColor[champIndex], g54_BoxChampionIcons[AL_0_championIconIndex]); + dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k28_ChampionIcons), 80, M26_championIconIndex(champ->_dir, _vm->_dungeonMan->_g308_partyDir) * 19, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g54_BoxChampionIcons[AL_0_championIconIndex], k12_ColorDarkestGray); } } if ((champAttributes & k0x0800_ChampionAttributePanel) && isInventoryChamp) { if (_vm->_g333_pressingMouth) { - invMan.drawPanelFoodWaterPoisoned(); + invMan.f345_drawPanelFoodWaterPoisoned(); } else if (_vm->_g331_pressingEye) { if (_g415_leaderEmptyHanded) { warning("MISSING CODE: F0351_INVENTORY_DrawChampionSkillsAndStatistics"); } } else { - invMan.drawPanel(); + invMan.f347_drawPanel(); } champAttributes |= k0x4000_ChampionAttributeViewport; } if (champAttributes & k0x8000_ChampionAttributeActionHand) { - drawSlot(champIndex, k1_ChampionSlotActionHand); - menuMan.drawActionIcon(champIndex); + f291_drawSlot(champIndex, k1_ChampionSlotActionHand); + menuMan.f386_drawActionIcon(champIndex); if (isInventoryChamp) { champAttributes |= k0x4000_ChampionAttributeViewport; } @@ -896,24 +896,24 @@ T0292042_green: warning("MISSING CODE: F0078_MOUSE_ShowPointer"); } -uint16 ChampionMan::championIconIndex(int16 val, direction dir) { +uint16 ChampionMan::M26_championIconIndex(int16 val, direction dir) { return ((val + 4 - dir) & 0x3); } -void ChampionMan::drawHealthStaminaManaValues(Champion* champ) { - drawHealthOrStaminaOrManaValue(116, champ->_currHealth, champ->_maxHealth); - drawHealthOrStaminaOrManaValue(124, champ->_currStamina, champ->_maxStamina); - drawHealthOrStaminaOrManaValue(132, champ->_currMana, champ->_maxMana); +void ChampionMan::f290_drawHealthStaminaManaValues(Champion* champ) { + f289_drawHealthOrStaminaOrManaValue(116, champ->_currHealth, champ->_maxHealth); + f289_drawHealthOrStaminaOrManaValue(124, champ->_currStamina, champ->_maxStamina); + f289_drawHealthOrStaminaOrManaValue(132, champ->_currMana, champ->_maxMana); } -void ChampionMan::drawSlot(uint16 champIndex, ChampionSlot slotIndex) { +void ChampionMan::f291_drawSlot(uint16 champIndex, ChampionSlot slotIndex) { int16 nativeBitmapIndex = -1; - Champion *champ = &_champions[champIndex]; - bool isInventoryChamp = (_vm->_inventoryMan->_g432_inventoryChampionOrdinal == _vm->indexToOrdinal(champIndex)); + Champion *champ = &_gK71_champions[champIndex]; + bool isInventoryChamp = (_vm->_inventoryMan->_g432_inventoryChampionOrdinal == _vm->M0_indexToOrdinal(champIndex)); uint16 slotBoxIndex; if (!isInventoryChamp) { /* If drawing a slot for a champion other than the champion whose inventory is open */ - if ((slotIndex > k1_ChampionSlotActionHand) || (_g299_candidateChampionOrdinal == _vm->indexToOrdinal(champIndex))) { + if ((slotIndex > k1_ChampionSlotActionHand) || (_g299_candidateChampionOrdinal == _vm->M0_indexToOrdinal(champIndex))) { return; } slotBoxIndex = (champIndex << 1) + slotIndex; @@ -959,7 +959,7 @@ void ChampionMan::drawSlot(uint16 champIndex, ChampionSlot slotIndex) { } } else { warning("BUG0_35"); - iconIndex = _vm->_objectMan->getIconIndex(thing); // BUG0_35 + iconIndex = _vm->_objectMan->f33_getIconIndex(thing); // BUG0_35 if (isInventoryChamp && (slotIndex == k1_ChampionSlotActionHand) && ((iconIndex == k144_IconIndiceContainerChestClosed) || (iconIndex == k30_IconIndiceScrollOpen))) { warning("BUG2_00"); iconIndex++; @@ -973,29 +973,29 @@ void ChampionMan::drawSlot(uint16 champIndex, ChampionSlot slotIndex) { } } - if ((slotIndex == k1_ChampionSlotActionHand) && (_vm->indexToOrdinal(champIndex) == _g506_actingChampionOrdinal)) { + if ((slotIndex == k1_ChampionSlotActionHand) && (_vm->M0_indexToOrdinal(champIndex) == _g506_actingChampionOrdinal)) { nativeBitmapIndex = k35_SlotBoxActingHandIndice; } if (nativeBitmapIndex != -1) { _vm->_displayMan->_g578_useByteBoxCoordinates = false; if (isInventoryChamp) { - _vm->_displayMan->blitToBitmap(_vm->_displayMan->getBitmap(nativeBitmapIndex), 32, 0, 0, + _vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->f489_getBitmap(nativeBitmapIndex), 32, 0, 0, _vm->_displayMan->_g296_bitmapViewport, k112_byteWidthViewport * 2, box, k12_ColorDarkestGray); } else { - _vm->_displayMan->blitToBitmap(_vm->_displayMan->getBitmap(nativeBitmapIndex), 32, 0, 0, + _vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->f489_getBitmap(nativeBitmapIndex), 32, 0, 0, _vm->_displayMan->_g348_bitmapScreen, k160_byteWidthScreen * 2, box, k12_ColorDarkestGray); } } - _vm->_objectMan->drawIconInSlotBox(slotBoxIndex, iconIndex); + _vm->_objectMan->f38_drawIconInSlotBox(slotBoxIndex, iconIndex); if (!isInventoryChamp) { warning("MISSING CODE: F0078_MOUSE_ShowPointer"); } } -void ChampionMan::renameChampion(Champion* champ) { +void ChampionMan::f281_renameChampion(Champion* champ) { warning("STUB METHOD: Champion::renameChampion, F0281_CHAMPION_Rename"); DisplayMan &dispMan = *_vm->_displayMan; @@ -1008,15 +1008,15 @@ void ChampionMan::renameChampion(Champion* champ) { box._x2 = box._x1 + 167; dispMan.f135_fillBoxBitmap(dispMan._g296_bitmapViewport, box, k12_ColorDarkestGray, k112_byteWidthViewport * 2, k136_heightViewport); - dispMan.blitToBitmap(dispMan.getBitmap(k27_PanelRenameChampionIndice), 144, 0, 0, + dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k27_PanelRenameChampionIndice), 144, 0, 0, dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, g32_BoxPanel, k4_ColorCyan); - textMan.printToViewport(177, 58, k13_ColorLightestGray, "_______"); - textMan.printToViewport(105, 76, k13_ColorLightestGray, "___________________"); + textMan.f52_printToViewport(177, 58, k13_ColorLightestGray, "_______"); + textMan.f52_printToViewport(105, 76, k13_ColorLightestGray, "___________________"); Common::Point clickPos; static Box okButtonBox(197, 215, 147, 155); // inclusive boundaries, constructor adds +1 for (;;) { _vm->_eventMan->processInput(); - if (_vm->_eventMan->hasPendingClick(clickPos, k1_LeftMouseButton) && okButtonBox.isPointInside(clickPos)) { + if (_vm->_eventMan->f360_hasPendingClick(clickPos, k1_LeftMouseButton) && okButtonBox.isPointInside(clickPos)) { return; } dispMan.f97_drawViewport(k0_viewportNotDungeonView); @@ -1024,14 +1024,14 @@ void ChampionMan::renameChampion(Champion* champ) { } } -uint16 ChampionMan::getSkillLevel(ChampionIndex champIndex, ChampionSkill skillIndex) { +uint16 ChampionMan::f303_getSkillLevel(ChampionIndex champIndex, ChampionSkill skillIndex) { if (_g300_partyIsSleeping) return 1; bool ignoreTempExp = skillIndex & k0x8000_IgnoreTemporaryExperience; bool ignoreObjModifiers = skillIndex & k0x4000_IgnoreObjectModifiers; skillIndex = (ChampionSkill)(skillIndex & ~(ignoreTempExp | ignoreObjModifiers)); - Champion *champ = &_champions[champIndex]; + Champion *champ = &_gK71_champions[champIndex]; Skill *skill = &champ->getSkill(skillIndex); int32 experience = skill->_experience; @@ -1054,14 +1054,14 @@ uint16 ChampionMan::getSkillLevel(ChampionIndex champIndex, ChampionSkill skillI } if (!ignoreObjModifiers) { - IconIndice actionHandIconIndex = _vm->_objectMan->getIconIndex(champ->getSlot(k1_ChampionSlotActionHand)); + IconIndice actionHandIconIndex = _vm->_objectMan->f33_getIconIndex(champ->getSlot(k1_ChampionSlotActionHand)); if (actionHandIconIndex == k27_IconIndiceWeaponTheFirestaff) { skillLevel++; } else if (actionHandIconIndex == k28_IconIndiceWeaponTheFirestaffComplete) { skillLevel += 2; } - IconIndice neckIconIndice = _vm->_objectMan->getIconIndex(champ->getSlot(k10_ChampionSlotNeck)); + IconIndice neckIconIndice = _vm->_objectMan->f33_getIconIndex(champ->getSlot(k10_ChampionSlotNeck)); switch (skillIndex) { case k3_ChampionSkillWizard: if (neckIconIndice == k124_IconIndiceJunkPendantFeral) diff --git a/engines/dm/champion.h b/engines/dm/champion.h index cd6694669b..1b7a4ff548 100644 --- a/engines/dm/champion.h +++ b/engines/dm/champion.h @@ -426,18 +426,18 @@ public: class ChampionMan { DMEngine *_vm; - uint16 getChampionPortraitX(uint16 index); // @ M27_PORTRAIT_X - uint16 getChampionPortraitY(uint16 index); // @ M28_PORTRAIT_Y + uint16 M27_getChampionPortraitX(uint16 index); // @ M27_PORTRAIT_X + uint16 M28_getChampionPortraitY(uint16 index); // @ M28_PORTRAIT_Y - ChampionIndex getIndexInCell(ViewCell cell); // @ F0285_CHAMPION_GetIndexInCell - int16 getDecodedValue(char *string, uint16 characterCount); // @ F0279_CHAMPION_GetDecodedValue - void drawHealthOrStaminaOrManaValue(int16 posy, int16 currVal, int16 maxVal); // @ F0289_CHAMPION_DrawHealthOrStaminaOrManaValue - uint16 handSlotIndex(uint16 slotBoxIndex);// @ M70_HAND_SLOT_INDEX + ChampionIndex f285_getIndexInCell(ViewCell cell); // @ F0285_CHAMPION_GetIndexInCell + int16 f279_getDecodedValue(char *string, uint16 characterCount); // @ F0279_CHAMPION_GetDecodedValue + void f289_drawHealthOrStaminaOrManaValue(int16 posy, int16 currVal, int16 maxVal); // @ F0289_CHAMPION_DrawHealthOrStaminaOrManaValue + uint16 M70_handSlotIndex(uint16 slotBoxIndex);// @ M70_HAND_SLOT_INDEX public: - Champion _champions[4]; + Champion _gK71_champions[4]; // @ K0071_as_Champions uint16 _g305_partyChampionCount; // @ G0305_ui_PartyChampionCount - bool _303_partyDead; // @ G0303_B_PartyDead - Thing _414_leaderHandObject; // @ G0414_T_LeaderHandObject + bool _g303_partyDead; // @ G0303_B_PartyDead + Thing _g414_leaderHandObject; // @ G0414_T_LeaderHandObject ChampionIndex _g411_leaderIndex; // @ G0411_i_LeaderIndex uint16 _g299_candidateChampionOrdinal; // @ G0299_ui_CandidateChampionOrdinal bool _g300_partyIsSleeping; // @ G0300_B_PartyIsSleeping @@ -449,23 +449,23 @@ public: bool _g420_mousePointerHiddenToDrawChangedObjIconOnScreen; // @ G0420_B_MousePointerHiddenToDrawChangedObjectIconOnScreen explicit ChampionMan(DMEngine *vm); - void resetDataToStartGame(); // @ F0278_CHAMPION_ResetDataToStartGame - void addCandidateChampionToParty(uint16 championPortraitIndex); // @ F0280_CHAMPION_AddCandidateChampionToParty - void drawChampionBarGraphs(ChampionIndex champIndex); // @ F0287_CHAMPION_DrawBarGraphs - uint16 getStaminaAdjustedValue(Champion *champ, int16 val); // @ F0306_CHAMPION_GetStaminaAdjustedValue - uint16 getMaximumLoad(Champion *champ); // @ F0309_CHAMPION_GetMaximumLoad - void drawChampionState(ChampionIndex champIndex); // @ F0292_CHAMPION_DrawState - uint16 championIconIndex(int16 val, direction dir); // @ M26_CHAMPION_ICON_INDEX - void drawHealthStaminaManaValues(Champion *champ); // @ F0290_CHAMPION_DrawHealthStaminaManaValues - void drawSlot(uint16 champIndex, ChampionSlot slotIndex); // @ F0291_CHAMPION_DrawSlot - void renameChampion(Champion* champ); // @ F0281_CHAMPION_Rename - uint16 getSkillLevel(ChampionIndex champIndex, ChampionSkill skillIndex);// @ F0303_CHAMPION_GetSkillLevel - Common::String getStringFromInteger(uint16 val, bool padding, uint16 paddingCharCount); // @ F0288_CHAMPION_GetStringFromInteger - void applyModifiersToStatistics(Champion *champ, ChampionSlot slotIndex, IconIndice iconIndex, + void f278_resetDataToStartGame(); // @ F0278_CHAMPION_ResetDataToStartGame + void f280_addCandidateChampionToParty(uint16 championPortraitIndex); // @ F0280_CHAMPION_AddCandidateChampionToParty + void f287_drawChampionBarGraphs(ChampionIndex champIndex); // @ F0287_CHAMPION_DrawBarGraphs + uint16 f306_getStaminaAdjustedValue(Champion *champ, int16 val); // @ F0306_CHAMPION_GetStaminaAdjustedValue + uint16 f309_getMaximumLoad(Champion *champ); // @ F0309_CHAMPION_GetMaximumLoad + void f292_drawChampionState(ChampionIndex champIndex); // @ F0292_CHAMPION_DrawState + uint16 M26_championIconIndex(int16 val, direction dir); // @ M26_CHAMPION_ICON_INDEX + void f290_drawHealthStaminaManaValues(Champion *champ); // @ F0290_CHAMPION_DrawHealthStaminaManaValues + void f291_drawSlot(uint16 champIndex, ChampionSlot slotIndex); // @ F0291_CHAMPION_DrawSlot + void f281_renameChampion(Champion* champ); // @ F0281_CHAMPION_Rename + uint16 f303_getSkillLevel(ChampionIndex champIndex, ChampionSkill skillIndex);// @ F0303_CHAMPION_GetSkillLevel + Common::String f288_getStringFromInteger(uint16 val, bool padding, uint16 paddingCharCount); // @ F0288_CHAMPION_GetStringFromInteger + void f299_pplyModifiersToStatistics(Champion *champ, ChampionSlot slotIndex, IconIndice iconIndex, int16 modifierFactor, Thing thing); // @ F0299_CHAMPION_ApplyObjectModifiersToStatistics - bool hasObjectIconInSlotBoxChanged(int16 slotBoxIndex, Thing thing); // @ F0295_CHAMPION_HasObjectIconInSlotBoxChanged - void drawChangedObjectIcons(); // @ F0296_CHAMPION_DrawChangedObjectIcons - void addObjectInSlot(ChampionIndex champIndex, Thing thing, ChampionSlot slotIndex); // @ F0301_CHAMPION_AddObjectInSlot + bool f295_hasObjectIconInSlotBoxChanged(int16 slotBoxIndex, Thing thing); // @ F0295_CHAMPION_HasObjectIconInSlotBoxChanged + void f296_drawChangedObjectIcons(); // @ F0296_CHAMPION_DrawChangedObjectIcons + void f301_addObjectInSlot(ChampionIndex champIndex, Thing thing, ChampionSlot slotIndex); // @ F0301_CHAMPION_AddObjectInSlot }; diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp index f7e9e8fbbd..c5ff2f2287 100644 --- a/engines/dm/dm.cpp +++ b/engines/dm/dm.cpp @@ -141,26 +141,26 @@ DMEngine::~DMEngine() { DebugMan.clearAllDebugChannels(); } -void DMEngine::initializeGame() { - _displayMan->loadGraphics(); - _displayMan->initializeGraphicData(); +void DMEngine::f463_initializeGame() { + _displayMan->f479_loadGraphics(); + _displayMan->f460_initializeGraphicData(); // DUMMY CODE: next line _displayMan->loadPalette(g19_PalCredits); _eventMan->initMouse(); - while (_loadsaveMan->loadgame() != k1_LoadgameSuccess) { + while (_loadsaveMan->f435_loadgame() != k1_LoadgameSuccess) { warning("TODO: F0441_STARTEND_ProcessEntrance"); } - _displayMan->loadFloorSet(k0_FloorSetStone); - _displayMan->loadWallSet(k0_WallSetStone); + _displayMan->f94_loadFloorSet(k0_FloorSetStone); + _displayMan->f95_loadWallSet(k0_WallSetStone); _objectMan->loadObjectNames(); // There was some memory wizardy for the Amiga platform, I skipped that part _displayMan->f461_allocateFlippedWallBitmaps(); - startGame(); + f462_startGame(); warning("MISSING CODE: F0267_MOVE_GetMoveResult_CPSCE (if newGame)"); _eventMan->showMouse(true); warning("MISSING CODE: F0357_COMMAND_DiscardAllInput"); @@ -173,7 +173,7 @@ void DMEngine::initializeGame() { _displayMan->_g347_paletteTopAndBottomScreen[i] = g21_PalDungeonView[0][i]; } - void DMEngine::startGame() { + void DMEngine::f462_startGame() { _g331_pressingEye = false; _g332_stopPressingEye = false; _g333_pressingMouth = false; @@ -181,15 +181,15 @@ void DMEngine::initializeGame() { _g340_highlightBoxInversionRequested = false; _eventMan->_g341_highlightBoxEnabled = false; _championMan->_g300_partyIsSleeping = false; - _championMan->_g506_actingChampionOrdinal = indexToOrdinal(kM1_ChampionNone); + _championMan->_g506_actingChampionOrdinal = M0_indexToOrdinal(kM1_ChampionNone); _menuMan->_g509_actionAreaContainsIcons = true; - _eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap = indexToOrdinal(kM1_ChampionNone); + _eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap = M0_indexToOrdinal(kM1_ChampionNone); _eventMan->_g441_primaryMouseInput = g447_PrimaryMouseInput_Interface; _eventMan->_g442_secondaryMouseInput = g448_SecondaryMouseInput_Movement; warning("MISSING CODE: set primary/secondary keyboard input"); - processNewPartyMap(_dungeonMan->_g309_partyMapIndex); + f3_processNewPartyMap(_dungeonMan->_g309_partyMapIndex); if (!_g298_newGame) { warning("TODO: loading game"); @@ -199,15 +199,15 @@ void DMEngine::initializeGame() { } warning("TODO: build copper"); - _menuMan->drawMovementArrows(); - _championMan->resetDataToStartGame(); + _menuMan->f395_drawMovementArrows(); + _championMan->f278_resetDataToStartGame(); _g301_gameTimeTicking = true; } -void DMEngine::processNewPartyMap(uint16 mapIndex) { +void DMEngine::f3_processNewPartyMap(uint16 mapIndex) { warning("MISSING CODE: F0194_GROUP_RemoveAllActiveGroups"); - _dungeonMan->setCurrentMapAndPartyMap(mapIndex); - _displayMan->loadCurrentMapGraphics(); + _dungeonMan->f174_setCurrentMapAndPartyMap(mapIndex); + _displayMan->f96_loadCurrentMapGraphics(); warning("MISSING CODE: F0195_GROUP_AddAllActiveGroups"); warning("MISSING CODE: F0337_INVENTORY_SetDungeonViewPalette"); } @@ -232,16 +232,16 @@ Common::Error DMEngine::run() { _timeline = new Timeline(this); _displayMan->setUpScreens(320, 200); - initializeGame(); // @ F0463_START_InitializeGame_CPSADEF + f463_initializeGame(); // @ F0463_START_InitializeGame_CPSADEF while (true) { - gameloop(); + f2_gameloop(); warning("TODO: F0444_STARTEND_Endgame(G0303_B_PartyDead);"); } return Common::kNoError; } -void DMEngine::gameloop() { +void DMEngine::f2_gameloop() { warning("DUMMY CODE SETTING PARTY POS AND DIRECTION"); _dungeonMan->_g306_partyMapX = 10; _dungeonMan->_g307_partyMapY = 4; @@ -254,21 +254,21 @@ void DMEngine::gameloop() { while (true) { _g321_stopWaitingForPlayerInput = false; - _menuMan->refreshActionAreaAndSetChampDirMaxDamageReceived(); + _menuMan->f390_refreshActionAreaAndSetChampDirMaxDamageReceived(); //do { _eventMan->processInput(); - _eventMan->processCommandQueue(); + _eventMan->f380_processCommandQueue(); //} while (!_g321_stopWaitingForPlayerInput || !_g301_gameTimeTicking); if (!_inventoryMan->_g432_inventoryChampionOrdinal && !_championMan->_g300_partyIsSleeping) { Box box(0, 224, 0, 126); _displayMan->f135_fillBoxBitmap(_displayMan->_g296_bitmapViewport, box, k0_ColorBlack, k112_byteWidthViewport * 2, k136_heightViewport); // dummy code - _displayMan->drawDungeon(_dungeonMan->_g308_partyDir, _dungeonMan->_g306_partyMapX, _dungeonMan->_g307_partyMapY); + _displayMan->f128_drawDungeon(_dungeonMan->_g308_partyDir, _dungeonMan->_g306_partyMapX, _dungeonMan->_g307_partyMapY); } // DUMMY CODE: next 2 lines - _menuMan->drawMovementArrows(); + _menuMan->f395_drawMovementArrows(); _displayMan->f97_drawViewport(k1_viewportDungeonView); _displayMan->updateScreen(); @@ -276,11 +276,11 @@ void DMEngine::gameloop() { } } -int16 DMEngine::ordinalToIndex(int16 val) { +int16 DMEngine::M1_ordinalToIndex(int16 val) { return val - 1; } -int16 DMEngine::indexToOrdinal(int16 val) { +int16 DMEngine::M0_indexToOrdinal(int16 val) { return val + 1; } diff --git a/engines/dm/dm.h b/engines/dm/dm.h index 7837ac4716..6ceedf9e33 100644 --- a/engines/dm/dm.h +++ b/engines/dm/dm.h @@ -142,19 +142,19 @@ enum { }; class DMEngine : public Engine { - void startGame(); // @ F0462_START_StartGame_CPSF - void processNewPartyMap(uint16 mapIndex); // @ F0003_MAIN_ProcessNewPartyMap_CPSE - void initializeGame(); // @ F0463_START_InitializeGame_CPSADEF + void f462_startGame(); // @ F0462_START_StartGame_CPSF + void f3_processNewPartyMap(uint16 mapIndex); // @ F0003_MAIN_ProcessNewPartyMap_CPSE + void f463_initializeGame(); // @ F0463_START_InitializeGame_CPSADEF void f448_initMemoryManager(); // @ F0448_STARTUP1_InitializeMemoryManager_CPSADEF - void gameloop(); // @ F0002_MAIN_GameLoop_CPSDF + void f2_gameloop(); // @ F0002_MAIN_GameLoop_CPSDF void initArrays(); public: explicit DMEngine(OSystem *syst); ~DMEngine(); - int16 ordinalToIndex(int16 val); // @ M01_ORDINAL_TO_INDEX - int16 indexToOrdinal(int16 val); // @ M00_INDEX_TO_ORDINAL + int16 M1_ordinalToIndex(int16 val); // @ M01_ORDINAL_TO_INDEX + int16 M0_indexToOrdinal(int16 val); // @ M00_INDEX_TO_ORDINAL virtual Common::Error run(); // @ main private: diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp index d75e92b124..2a037a70d0 100644 --- a/engines/dm/dungeonman.cpp +++ b/engines/dm/dungeonman.cpp @@ -360,7 +360,7 @@ CreatureInfo g243_CreatureInfo[k27_CreatureTypeCount] = { // @ G0243_as_Graphic5 {25, 0, 0x38AA, 0x0000, 12, 22, 255, 180, 210, 0, 130, 0x6369, 0xFF37, 0x0FBF, 0x0564, 0xFB52, 5}, {26, 0, 0x38AA, 0x0000, 12, 22, 255, 180, 210, 0, 130, 0x6369, 0xFF37, 0x0FBF, 0x0564, 0xFB52, 5}}; -void DungeonMan::mapCoordsAfterRelMovement(direction dir, int16 stepsForward, int16 stepsRight, int16 &posX, int16 &posY) { +void DungeonMan::f150_mapCoordsAfterRelMovement(direction dir, int16 stepsForward, int16 stepsRight, int16 &posX, int16 &posY) { posX += _vm->_dirIntoStepCountEast[dir] * stepsForward; posY += _vm->_dirIntoStepCountNorth[dir] * stepsForward; turnDirRight(dir); @@ -438,7 +438,7 @@ DungeonMan::~DungeonMan() { } } -void DungeonMan::decompressDungeonFile() { +void DungeonMan::f455_decompressDungeonFile() { Common::File f; f.open("Dungeon.dat"); if (f.readUint16BE() == 0x8104) { @@ -550,9 +550,9 @@ const Thing Thing::_explRebirthStep1(0xFFE4); // @ C0xFFE4_THING_EXPLOSION_REBIR const Thing Thing::_explRebirthStep2(0xFFE5); // @ C0xFFE5_THING_EXPLOSION_REBIRTH_STEP2 const Thing Thing::_party(0xFFFF); // @ C0xFFFF_THING_PARTY -void DungeonMan::loadDungeonFile() { +void DungeonMan::f434_loadDungeonFile() { if (_vm->_g298_newGame) - decompressDungeonFile(); + f455_decompressDungeonFile(); Common::MemoryReadStream dunDataStream(_rawDunFileData, _rawDunFileDataSize, DisposeAfterUse::NO); @@ -728,7 +728,7 @@ void DungeonMan::loadDungeonFile() { } } -void DungeonMan::setCurrentMap(uint16 mapIndex) { +void DungeonMan::f173_setCurrentMap(uint16 mapIndex) { _g272_currMapIndex = mapIndex; _g271_currMapData = _g279_dungeonMapData[mapIndex]; _g269_currMap = _g277_dungeonMaps + mapIndex; @@ -738,8 +738,8 @@ void DungeonMan::setCurrentMap(uint16 mapIndex) { = &_g280_dungeonColumnsCumulativeSquareThingCount[_g281_dungeonMapsFirstColumnIndex[mapIndex]]; } -void DungeonMan::setCurrentMapAndPartyMap(uint16 mapIndex) { - setCurrentMap(mapIndex); +void DungeonMan::f174_setCurrentMapAndPartyMap(uint16 mapIndex) { + f173_setCurrentMap(mapIndex); byte *metaMapData = _g271_currMapData[_g273_currMapWidth - 1] + _g274_currMapHeight; _vm->_displayMan->_g264_currMapAllowedCreatureTypes = metaMapData; @@ -758,7 +758,7 @@ void DungeonMan::setCurrentMapAndPartyMap(uint16 mapIndex) { } -Square DungeonMan::getSquare(int16 mapX, int16 mapY) { +Square DungeonMan::f151_getSquare(int16 mapX, int16 mapY) { bool isInXBounds = (mapX >= 0) && (mapX < _g273_currMapWidth); bool isInYBounds = (mapY >= 0) && (mapY < _g274_currMapHeight); @@ -788,12 +788,12 @@ Square DungeonMan::getSquare(int16 mapX, int16 mapY) { return Square(k0_WallElemType); } -Square DungeonMan::getRelSquare(direction dir, int16 stepsForward, int16 stepsRight, int16 posX, int16 posY) { - mapCoordsAfterRelMovement(dir, stepsForward, stepsForward, posX, posY); - return getSquare(posX, posY); +Square DungeonMan::f152_getRelSquare(direction dir, int16 stepsForward, int16 stepsRight, int16 posX, int16 posY) { + f150_mapCoordsAfterRelMovement(dir, stepsForward, stepsForward, posX, posY); + return f151_getSquare(posX, posY); } -int16 DungeonMan::getSquareFirstThingIndex(int16 mapX, int16 mapY) { +int16 DungeonMan::f160_getSquareFirstThingIndex(int16 mapX, int16 mapY) { if (mapX < 0 || mapX >= _g273_currMapWidth || mapY < 0 || mapY >= _g274_currMapHeight || !Square(_g271_currMapData[mapX][mapY]).get(k0x0010_ThingListPresent)) return -1; @@ -807,8 +807,8 @@ int16 DungeonMan::getSquareFirstThingIndex(int16 mapX, int16 mapY) { return index; } -Thing DungeonMan::getSquareFirstThing(int16 mapX, int16 mapY) { - int16 index = getSquareFirstThingIndex(mapX, mapY); +Thing DungeonMan::f161_getSquareFirstThing(int16 mapX, int16 mapY) { + int16 index = f160_getSquareFirstThingIndex(mapX, mapY); if (index == -1) return Thing::_endOfList; return _g283_squareFirstThings[index]; @@ -816,14 +816,14 @@ Thing DungeonMan::getSquareFirstThing(int16 mapX, int16 mapY) { // TODO: get rid of the GOTOs -void DungeonMan::setSquareAspect(uint16 *aspectArray, direction dir, int16 mapX, int16 mapY) { // complete, except where marked +void DungeonMan::f172_setSquareAspect(uint16 *aspectArray, direction dir, int16 mapX, int16 mapY) { // complete, except where marked _vm->_displayMan->_g289_championPortraitOrdinal = 0; // BUG0_75, possible fix for (uint16 i = 0; i < 5; ++i) aspectArray[i] = 0; - Thing thing = getSquareFirstThing(mapX, mapY); - Square square = getSquare(mapX, mapY); + Thing thing = f161_getSquareFirstThing(mapX, mapY); + Square square = f151_getSquare(mapX, mapY); aspectArray[k0_ElemAspect] = square.getType(); @@ -860,25 +860,25 @@ void DungeonMan::setSquareAspect(uint16 *aspectArray, direction dir, int16 mapX, } T0172010_ClosedFakeWall: - setSquareAspectOrnOrdinals(aspectArray, leftOrnAllowed, frontOrnAllowed, rightOrnAllowed, dir, mapX, mapY, squareIsFakeWall); + f171_setSquareAspectOrnOrdinals(aspectArray, leftOrnAllowed, frontOrnAllowed, rightOrnAllowed, dir, mapX, mapY, squareIsFakeWall); while ((thing != Thing::_endOfList) && (thing.getType() <= k3_SensorThingType)) { int16 sideIndex = (thing.getCell() - dir) & 3; if (sideIndex) { if (thing.getType() == k2_TextstringType) { - if (TextString(getThingData(thing)).isVisible()) { + if (TextString(f156_getThingData(thing)).isVisible()) { aspectArray[sideIndex + 1] = _g265_currMapInscriptionWallOrnIndex + 1; _vm->_displayMan->_g290_inscriptionThing = thing; // BUG0_76 } } else { - Sensor sensor(getThingData(thing)); + Sensor sensor(f156_getThingData(thing)); aspectArray[sideIndex + 1] = sensor.getOrnOrdinal(); if (sensor.getType() == k127_SensorWallChampionPortrait) { - _vm->_displayMan->_g289_championPortraitOrdinal = _vm->indexToOrdinal(sensor.getData()); + _vm->_displayMan->_g289_championPortraitOrdinal = _vm->M0_indexToOrdinal(sensor.getData()); } } } - thing = getNextThing(thing); + thing = f159_getNextThing(thing); } if (squareIsFakeWall && (_g306_partyMapX != mapX) && (_g307_partyMapY != mapY)) { aspectArray[k1_FirstGroupOrObjectAspect] = Thing::_endOfList.toUint16(); @@ -906,14 +906,14 @@ T0172010_ClosedFakeWall: square = Square(footPrintsAllowed ? 8 : 0); // intentional fallthrough case k1_CorridorElemType: - aspectArray[k4_FloorOrnOrdAspect] = getRandomOrnOrdinal(square.get(k0x0008_CorridorRandOrnAllowed), _g269_currMap->_randFloorOrnCount, mapX, mapY, 30); + aspectArray[k4_FloorOrnOrdAspect] = f170_getRandomOrnOrdinal(square.get(k0x0008_CorridorRandOrnAllowed), _g269_currMap->_randFloorOrnCount, mapX, mapY, 30); T0172029_Teleporter: footPrintsAllowed = true; T0172030_Pit: while ((thing != Thing::_endOfList) && (thing.getType() <= k3_SensorThingType)) { if (thing.getType() == k3_SensorThingType) - aspectArray[k4_FloorOrnOrdAspect] = Sensor(getThingData(thing)).getOrnOrdinal(); - thing = getNextThing(thing); + aspectArray[k4_FloorOrnOrdAspect] = Sensor(f156_getThingData(thing)).getOrnOrdinal(); + thing = f159_getNextThing(thing); } goto T0172049_Footprints; case k5_TeleporterElemType: @@ -930,12 +930,12 @@ T0172030_Pit: } else { aspectArray[k0_ElemAspect] = k17_DoorFrontElemType; aspectArray[k2_DoorStateAspect] = square.getDoorState(); - aspectArray[k3_DoorThingIndexAspect] = getSquareFirstThing(mapX, mapY).getIndex(); + aspectArray[k3_DoorThingIndexAspect] = f161_getSquareFirstThing(mapX, mapY).getIndex(); } footPrintsAllowed = true; T0172046_Stairs: while ((thing != Thing::_endOfList) && (thing.getType() <= k3_SensorThingType)) - thing = getNextThing(thing); + thing = f159_getNextThing(thing); T0172049_Footprints: unsigned char scentOrdinal; // see next line comment if (footPrintsAllowed) // TODO: I skipped some party query code, must come back later and complete @@ -947,36 +947,36 @@ T0172049_Footprints: aspectArray[k1_FirstGroupOrObjectAspect] = thing.toUint16(); } -void DungeonMan::setSquareAspectOrnOrdinals(uint16 *aspectArray, bool leftAllowed, bool frontAllowed, bool rightAllowed, direction dir, +void DungeonMan::f171_setSquareAspectOrnOrdinals(uint16 *aspectArray, bool leftAllowed, bool frontAllowed, bool rightAllowed, direction dir, int16 mapX, int16 mapY, bool isFakeWall) { int16 ornCount = _g269_currMap->_randWallOrnCount; turnDirRight(dir); - aspectArray[k2_RightWallOrnOrdAspect] = getRandomOrnOrdinal(leftAllowed, ornCount, mapX, ++mapY * (dir + 1), 30); + aspectArray[k2_RightWallOrnOrdAspect] = f170_getRandomOrnOrdinal(leftAllowed, ornCount, mapX, ++mapY * (dir + 1), 30); turnDirRight(dir); - aspectArray[k3_FrontWallOrnOrdAspect] = getRandomOrnOrdinal(frontAllowed, ornCount, mapX, ++mapY * (dir + 1), 30); + aspectArray[k3_FrontWallOrnOrdAspect] = f170_getRandomOrnOrdinal(frontAllowed, ornCount, mapX, ++mapY * (dir + 1), 30); turnDirRight(dir); - aspectArray[k4_LeftWallOrnOrdAspect] = getRandomOrnOrdinal(rightAllowed, ornCount, mapX, ++mapY * (dir + 1), 30); + aspectArray[k4_LeftWallOrnOrdAspect] = f170_getRandomOrnOrdinal(rightAllowed, ornCount, mapX, ++mapY * (dir + 1), 30); if (isFakeWall || mapX < 0 || mapX >= _g273_currMapWidth || mapY < 0 || mapY >= _g274_currMapHeight) { for (uint16 i = k2_RightWallOrnOrdAspect; i <= k4_LeftWallOrnOrdAspect; ++i) { - if (isWallOrnAnAlcove(_vm->ordinalToIndex(aspectArray[i]))) + if (f149_isWallOrnAnAlcove(_vm->M1_ordinalToIndex(aspectArray[i]))) aspectArray[i] = 0; } } } -int16 DungeonMan::getRandomOrnOrdinal(bool allowed, int16 count, int16 mapX, int16 mapY, int16 modulo) { +int16 DungeonMan::f170_getRandomOrnOrdinal(bool allowed, int16 count, int16 mapX, int16 mapY, int16 modulo) { int16 index = (((((2000 + (mapX << 5) + mapY) * 31417) >> 1) + (3000 + (_g272_currMapIndex << 6) + _g273_currMapWidth + _g274_currMapHeight) * 11 + _g278_dungeonFileHeader._ornamentRandomSeed) >> 2) % modulo; if (allowed && index < count) - return _vm->indexToOrdinal(index); + return _vm->M0_indexToOrdinal(index); return 0; } -bool DungeonMan::isWallOrnAnAlcove(int16 wallOrnIndex) { +bool DungeonMan::f149_isWallOrnAnAlcove(int16 wallOrnIndex) { if (wallOrnIndex >= 0) for (uint16 i = 0; i < k3_AlcoveOrnCount; ++i) if (_vm->_displayMan->_g267_currMapAlcoveOrnIndices[i] == wallOrnIndex) @@ -984,16 +984,16 @@ bool DungeonMan::isWallOrnAnAlcove(int16 wallOrnIndex) { return false; } -uint16 *DungeonMan::getThingData(Thing thing) { +uint16 *DungeonMan::f156_getThingData(Thing thing) { return _g284_thingData[thing.getType()][thing.getIndex()]; } -uint16* DungeonMan::getSquareFirstThingData(int16 mapX, int16 mapY) { - return getThingData(getSquareFirstThing(mapX, mapY)); +uint16* DungeonMan::f157_getSquareFirstThingData(int16 mapX, int16 mapY) { + return f156_getThingData(f161_getSquareFirstThing(mapX, mapY)); } -Thing DungeonMan::getNextThing(Thing thing) { - return getThingData(thing)[0]; // :) +Thing DungeonMan::f159_getNextThing(Thing thing) { + return Thing(f156_getThingData(thing)[0]); // :) } char g255_MessageAndScrollEscReplacementStrings[32][8] = { // @ G0255_aac_Graphic559_MessageAndScrollEscapeReplacementStrings @@ -1097,7 +1097,7 @@ char g257_InscriptionEscReplacementStrings[32][8] = { // @ G0257_aac_Graphic559_ {0, 0, 0, 0, 0, 0, 0, 0}}; -void DungeonMan::decodeText(char *destString, Thing thing, TextType type) { +void DungeonMan::f168_decodeText(char *destString, Thing thing, TextType type) { char sepChar; TextString textString(_g284_thingData[k2_TextstringType][thing.getIndex()]); if ((textString.isVisible()) || (type & k0x8000_DecodeEvenIfInvisible)) { @@ -1165,7 +1165,7 @@ void DungeonMan::decodeText(char *destString, Thing thing, TextType type) { } -uint16 DungeonMan::getObjectWeight(Thing thing) { +uint16 DungeonMan::f140_getObjectWeight(Thing thing) { static const uint16 g241_junkInfo[] = { // @ G0241_auc_Graphic559_JunkInfo // COMPASS - WATERSKIN - JEWEL SYMAL - ILLUMULET - ASHES 1, 3, 2, 2, 4, @@ -1195,11 +1195,11 @@ uint16 DungeonMan::getObjectWeight(Thing thing) { return 0; switch (thing.getType()) { case k5_WeaponThingType: - return g238_WeaponInfo[Weapon(getThingData(thing)).getType()]._weight; + return g238_WeaponInfo[Weapon(f156_getThingData(thing)).getType()]._weight; case k6_ArmourThingType: - return g239_ArmourInfo[Armour(getThingData(thing)).getType()]._weight; + return g239_ArmourInfo[Armour(f156_getThingData(thing)).getType()]._weight; case k10_JunkThingType: { - Junk junk(getThingData(thing)); + Junk junk(f156_getThingData(thing)); uint16 weight = g241_junkInfo[junk.getType()]; if (junk.getType() == k1_JunkTypeWaterskin) weight += junk.getChargeCount() * 2; @@ -1207,16 +1207,16 @@ uint16 DungeonMan::getObjectWeight(Thing thing) { } case k9_ContainerThingType: { uint16 weight = 50; - Container container(getThingData(thing)); + Container container(f156_getThingData(thing)); Thing slotThing = container.getSlot(); while (slotThing != Thing::_endOfList) { - weight += getObjectWeight(slotThing); - slotThing = getNextThing(slotThing); + weight += f140_getObjectWeight(slotThing); + slotThing = f159_getNextThing(slotThing); } return weight; } case k8_PotionThingType: - if (Junk(getThingData(thing)).getType() == k20_PotionTypeEmptyFlask) { + if (Junk(f156_getThingData(thing)).getType() == k20_PotionTypeEmptyFlask) { return 1; } else { return 3; @@ -1232,8 +1232,8 @@ uint16 DungeonMan::getObjectWeight(Thing thing) { } -int16 DungeonMan::getObjectInfoIndex(Thing thing) { - uint16 *rawType = getThingData(thing); +int16 DungeonMan::f141_getObjectInfoIndex(Thing thing) { + uint16 *rawType = f156_getThingData(thing); switch (thing.getType()) { case k7_ScrollThingType: return k0_ObjectInfoIndexFirstScroll; @@ -1252,17 +1252,17 @@ int16 DungeonMan::getObjectInfoIndex(Thing thing) { } } -void DungeonMan::linkThingToList(Thing thingToLink, Thing thingInList, int16 mapX, int16 mapY) { +void DungeonMan::f163_linkThingToList(Thing thingToLink, Thing thingInList, int16 mapX, int16 mapY) { if (thingToLink == Thing::_endOfList) return; - uint16 *rawObjPtr = getThingData(thingToLink); + uint16 *rawObjPtr = f156_getThingData(thingToLink); *rawObjPtr = Thing::_endOfList.toUint16(); if (mapX >= 0) { Square *squarePtr = (Square*)&_g271_currMapData[mapX][mapY]; if (squarePtr->get(k0x0010_ThingListPresent)) { - thingInList = getSquareFirstThing(mapX, mapY); + thingInList = f161_getSquareFirstThing(mapX, mapY); } else { squarePtr->set(k0x0010_ThingListPresent); uint16 *cumulativeCount = &_g270_currMapColCumulativeSquareFirstThingCount[mapX + 1]; @@ -1286,43 +1286,43 @@ void DungeonMan::linkThingToList(Thing thingToLink, Thing thingInList, int16 map } } - Thing thing = getNextThing(thingInList); + Thing thing = f159_getNextThing(thingInList); while (thing != Thing::_endOfList) { - thing = getNextThing(thing); + thing = f159_getNextThing(thing); thingInList = thing; } - rawObjPtr = getThingData(thingInList); + rawObjPtr = f156_getThingData(thingInList); *rawObjPtr = thingToLink.toUint16(); } -WeaponInfo* DungeonMan::getWeaponInfo(Thing thing) { - Weapon* weapon = (Weapon*)getThingData(thing); +WeaponInfo* DungeonMan::f158_getWeaponInfo(Thing thing) { + Weapon* weapon = (Weapon*)f156_getThingData(thing); return &g238_WeaponInfo[weapon->getType()]; } -int16 DungeonMan::getProjectileAspect(Thing thing) { +int16 DungeonMan::f142_getProjectileAspect(Thing thing) { ThingType thingType; int16 projAspOrd; WeaponInfo *weaponInfo; if ((thingType = thing.getType()) == k15_ExplosionThingType) { if (thing == Thing::_explFireBall) - return -_vm->indexToOrdinal(k10_ProjectileAspectExplosionFireBall); + return -_vm->M0_indexToOrdinal(k10_ProjectileAspectExplosionFireBall); if (thing == Thing::_explSlime) - return -_vm->indexToOrdinal(k12_ProjectileAspectExplosionSlime); + return -_vm->M0_indexToOrdinal(k12_ProjectileAspectExplosionSlime); if (thing == Thing::_explLightningBolt) - return -_vm->indexToOrdinal(k3_ProjectileAspectExplosionLightningBolt); + return -_vm->M0_indexToOrdinal(k3_ProjectileAspectExplosionLightningBolt); if ((thing == Thing::_explPoisonBolt) || (thing == Thing::_explPoisonCloud)) - return -_vm->indexToOrdinal(k13_ProjectileAspectExplosionPoisonBoltCloud); + return -_vm->M0_indexToOrdinal(k13_ProjectileAspectExplosionPoisonBoltCloud); - return -_vm->indexToOrdinal(k11_ProjectileAspectExplosionDefault); + return -_vm->M0_indexToOrdinal(k11_ProjectileAspectExplosionDefault); } else if (thingType == k5_WeaponThingType) { - weaponInfo = getWeaponInfo(thing); + weaponInfo = f158_getWeaponInfo(thing); if (projAspOrd = weaponInfo->getProjectileAspectOrdinal()) return -projAspOrd; } - return g237_ObjectInfo[getObjectInfoIndex(thing)]._objectAspectIndex; + return g237_ObjectInfo[f141_getObjectInfoIndex(thing)]._objectAspectIndex; } } diff --git a/engines/dm/dungeonman.h b/engines/dm/dungeonman.h index 3b752bdebc..331c3c9e17 100644 --- a/engines/dm/dungeonman.h +++ b/engines/dm/dungeonman.h @@ -601,45 +601,45 @@ class DungeonMan { DungeonMan(const DungeonMan &other); // no implementation on purpose void operator=(const DungeonMan &rhs); // no implementation on purpose - Square getSquare(int16 mapX, int16 mapY); // @ F0151_DUNGEON_GetSquare - Square getRelSquare(direction dir, int16 stepsForward, int16 stepsRight, int16 posX, int16 posY); // @ F0152_DUNGEON_GetRelativeSquare + Square f151_getSquare(int16 mapX, int16 mapY); // @ F0151_DUNGEON_GetSquare + Square f152_getRelSquare(direction dir, int16 stepsForward, int16 stepsRight, int16 posX, int16 posY); // @ F0152_DUNGEON_GetRelativeSquare - void decompressDungeonFile(); // @ F0455_FLOPPY_DecompressDungeon + void f455_decompressDungeonFile(); // @ F0455_FLOPPY_DecompressDungeon - int16 getSquareFirstThingIndex(int16 mapX, int16 mapY); // @ F0160_DUNGEON_GetSquareFirstThingIndex + int16 f160_getSquareFirstThingIndex(int16 mapX, int16 mapY); // @ F0160_DUNGEON_GetSquareFirstThingIndex - int16 getRandomOrnOrdinal(bool allowed, int16 count, int16 mapX, int16 mapY, int16 modulo); // @ F0170_DUNGEON_GetRandomOrnamentOrdinal - void setSquareAspectOrnOrdinals(uint16 *aspectArray, bool leftAllowed, bool frontAllowed, bool rightAllowed, direction dir, + int16 f170_getRandomOrnOrdinal(bool allowed, int16 count, int16 mapX, int16 mapY, int16 modulo); // @ F0170_DUNGEON_GetRandomOrnamentOrdinal + void f171_setSquareAspectOrnOrdinals(uint16 *aspectArray, bool leftAllowed, bool frontAllowed, bool rightAllowed, direction dir, int16 mapX, int16 mapY, bool isFakeWall); // @ F0171_DUNGEON_SetSquareAspectRandomWallOrnamentOrdinals - void setCurrentMap(uint16 mapIndex); // @ F0173_DUNGEON_SetCurrentMap + void f173_setCurrentMap(uint16 mapIndex); // @ F0173_DUNGEON_SetCurrentMap public: explicit DungeonMan(DMEngine *dmEngine); ~DungeonMan(); - Thing getSquareFirstThing(int16 mapX, int16 mapY); // @ F0161_DUNGEON_GetSquareFirstThing - Thing getNextThing(Thing thing); // @ F0159_DUNGEON_GetNextThing(THING P0280_T_Thing) - uint16 *getThingData(Thing thing); // @ unsigned char* F0156_DUNGEON_GetThingData(register THING P0276_T_Thing) - uint16 *getSquareFirstThingData(int16 mapX, int16 mapY); // @ F0157_DUNGEON_GetSquareFirstThingData + Thing f161_getSquareFirstThing(int16 mapX, int16 mapY); // @ F0161_DUNGEON_GetSquareFirstThing + Thing f159_getNextThing(Thing thing); // @ F0159_DUNGEON_GetNextThing(THING P0280_T_Thing) + uint16 *f156_getThingData(Thing thing); // @ F0156_DUNGEON_GetThingData + uint16 *f157_getSquareFirstThingData(int16 mapX, int16 mapY); // @ F0157_DUNGEON_GetSquareFirstThingData // TODO: this does stuff other than load the file! - void loadDungeonFile(); // @ F0434_STARTEND_IsLoadDungeonSuccessful_CPSC - void setCurrentMapAndPartyMap(uint16 mapIndex); // @ F0174_DUNGEON_SetCurrentMapAndPartyMap + void f434_loadDungeonFile(); // @ F0434_STARTEND_IsLoadDungeonSuccessful_CPSC + void f174_setCurrentMapAndPartyMap(uint16 mapIndex); // @ F0174_DUNGEON_SetCurrentMapAndPartyMap - bool isWallOrnAnAlcove(int16 wallOrnIndex); // @ F0149_DUNGEON_IsWallOrnamentAnAlcove - void mapCoordsAfterRelMovement(direction dir, int16 stepsForward, int16 stepsRight, int16 &posX, int16 &posY); // @ F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement - SquareType getRelSquareType(direction dir, int16 stepsForward, int16 stepsRight, int16 posX, int16 posY) { - return Square(getRelSquare(dir, stepsForward, stepsRight, posX, posY)).getType(); + bool f149_isWallOrnAnAlcove(int16 wallOrnIndex); // @ F0149_DUNGEON_IsWallOrnamentAnAlcove + void f150_mapCoordsAfterRelMovement(direction dir, int16 stepsForward, int16 stepsRight, int16 &posX, int16 &posY); // @ F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement + SquareType f153_getRelSquareType(direction dir, int16 stepsForward, int16 stepsRight, int16 posX, int16 posY) { + return Square(f152_getRelSquare(dir, stepsForward, stepsRight, posX, posY)).getType(); } // @ F0153_DUNGEON_GetRelativeSquareType - void setSquareAspect(uint16 *aspectArray, direction dir, int16 mapX, int16 mapY); // @ F0172_DUNGEON_SetSquareAspect - void decodeText(char *destString, Thing thing, TextType type); // F0168_DUNGEON_DecodeText - - uint16 getObjectWeight(Thing thing); // @ F0140_DUNGEON_GetObjectWeight - int16 getObjectInfoIndex(Thing thing); // @ F0141_DUNGEON_GetObjectInfoIndex - void linkThingToList(Thing thingToLink, Thing thingInList, int16 mapX, int16 mapY); // @ F0163_DUNGEON_LinkThingToList - WeaponInfo *getWeaponInfo(Thing thing); // @ F0158_DUNGEON_GetWeaponInfo - int16 getProjectileAspect(Thing thing); // @ F0142_DUNGEON_GetProjectileAspect + void f172_setSquareAspect(uint16 *aspectArray, direction dir, int16 mapX, int16 mapY); // @ F0172_DUNGEON_SetSquareAspect + void f168_decodeText(char *destString, Thing thing, TextType type); // F0168_DUNGEON_DecodeText + + uint16 f140_getObjectWeight(Thing thing); // @ F0140_DUNGEON_GetObjectWeight + int16 f141_getObjectInfoIndex(Thing thing); // @ F0141_DUNGEON_GetObjectInfoIndex + void f163_linkThingToList(Thing thingToLink, Thing thingInList, int16 mapX, int16 mapY); // @ F0163_DUNGEON_LinkThingToList + WeaponInfo *f158_getWeaponInfo(Thing thing); // @ F0158_DUNGEON_GetWeaponInfo + int16 f142_getProjectileAspect(Thing thing); // @ F0142_DUNGEON_GetProjectileAspect uint32 _rawDunFileDataSize; // @ probably NONE byte *_rawDunFileData; // @ ??? diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp index 2e6f473eea..226b616c50 100644 --- a/engines/dm/eventman.cpp +++ b/engines/dm/eventman.cpp @@ -316,16 +316,16 @@ void EventManager::processInput() { switch (event.kbd.keycode) { case Common::KEYCODE_w: - dungeonMan.mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 1, 0, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY); + dungeonMan.f150_mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 1, 0, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY); break; case Common::KEYCODE_a: - dungeonMan.mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 0, -1, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY); + dungeonMan.f150_mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 0, -1, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY); break; case Common::KEYCODE_s: - dungeonMan.mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, -1, 0, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY); + dungeonMan.f150_mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, -1, 0, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY); break; case Common::KEYCODE_d: - dungeonMan.mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 0, 1, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY); + dungeonMan.f150_mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 0, 1, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY); break; case Common::KEYCODE_q: turnDirLeft(dungeonMan._g308_partyDir); @@ -335,11 +335,11 @@ void EventManager::processInput() { break; case Common::KEYCODE_UP: if (_dummyMapIndex < 13) - dungeonMan.setCurrentMapAndPartyMap(++_dummyMapIndex); + dungeonMan.f174_setCurrentMapAndPartyMap(++_dummyMapIndex); break; case Common::KEYCODE_DOWN: if (_dummyMapIndex > 0) - dungeonMan.setCurrentMapAndPartyMap(--_dummyMapIndex); + dungeonMan.f174_setCurrentMapAndPartyMap(--_dummyMapIndex); break; default: break; @@ -359,19 +359,19 @@ void EventManager::processInput() { } } -void EventManager::processPendingClick() { +void EventManager::f360_processPendingClick() { if (_g436_pendingClickPresent) { _g436_pendingClickPresent = false; - processClick(_g437_pendingClickPos, _g439_pendingClickButton); + f359_processClick(_g437_pendingClickPos, _g439_pendingClickButton); } } -void EventManager::processClick(Common::Point mousePos, MouseButton button) { +void EventManager::f359_processClick(Common::Point mousePos, MouseButton button) { CommandType commandType; - commandType = getCommandTypeFromMouseInput(_g441_primaryMouseInput, mousePos, button); + commandType = f358_getCommandTypeFromMouseInput(_g441_primaryMouseInput, mousePos, button); if (commandType == k0_CommandNone) - commandType = getCommandTypeFromMouseInput(_g442_secondaryMouseInput, mousePos, button); + commandType = f358_getCommandTypeFromMouseInput(_g442_secondaryMouseInput, mousePos, button); if (commandType != k0_CommandNone) _commandQueue.push(Command(mousePos, commandType)); @@ -379,7 +379,7 @@ void EventManager::processClick(Common::Point mousePos, MouseButton button) { _g435_isCommandQueueLocked = false; } -CommandType EventManager::getCommandTypeFromMouseInput(MouseInput *input, Common::Point mousePos, MouseButton button) { +CommandType EventManager::f358_getCommandTypeFromMouseInput(MouseInput *input, Common::Point mousePos, MouseButton button) { if (!input) return k0_CommandNone; CommandType commandType = k0_CommandNone; @@ -393,11 +393,11 @@ CommandType EventManager::getCommandTypeFromMouseInput(MouseInput *input, Common } -void EventManager::processCommandQueue() { +void EventManager::f380_processCommandQueue() { _g435_isCommandQueueLocked = true; if (_commandQueue.empty()) { _g435_isCommandQueueLocked = false; - processPendingClick(); + f360_processPendingClick(); return; } @@ -407,29 +407,29 @@ void EventManager::processCommandQueue() { int16 commandY = cmd._pos.y; _g435_isCommandQueueLocked = false; - processPendingClick(); + f360_processPendingClick(); if ((cmd._type == k2_CommandTurnRight) || (cmd._type == k1_CommandTurnLeft)) { - commandTurnParty(cmd._type); + f365_commandTurnParty(cmd._type); return; } if ((cmd._type >= k3_CommandMoveForward) && (cmd._type <= k6_CommandMoveLeft)) { - commandMoveParty(cmd._type); + f366_commandMoveParty(cmd._type); return; } if (cmd._type == k80_CommandClickInDungeonView) { - commandProcessType80ClickInDungeonView(commandX, commandY); + f377_commandProcessType80ClickInDungeonView(commandX, commandY); } if (cmd._type == k81_CommandClickInPanel) { - commandProcess81ClickInPanel(commandX, commandY); + f378_commandProcess81ClickInPanel(commandX, commandY); } // MISSING CODE: the rest of the function } -void EventManager::commandTurnParty(CommandType cmdType) { +void EventManager::f365_commandTurnParty(CommandType cmdType) { _vm->_g321_stopWaitingForPlayerInput = true; // MISSING CODE: highlight turn left/right buttons @@ -445,7 +445,7 @@ void EventManager::commandTurnParty(CommandType cmdType) { // MISSING CODE: process sensors } -void EventManager::commandMoveParty(CommandType cmdType) { +void EventManager::f366_commandMoveParty(CommandType cmdType) { _vm->_g321_stopWaitingForPlayerInput = true; // MISSING CODE: Lots of code @@ -455,16 +455,16 @@ void EventManager::commandMoveParty(CommandType cmdType) { switch (cmdType) { case k3_CommandMoveForward: - dungeonMan.mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 1, 0, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY); + dungeonMan.f150_mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 1, 0, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY); break; case k6_CommandMoveLeft: - dungeonMan.mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 0, -1, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY); + dungeonMan.f150_mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 0, -1, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY); break; case k5_CommandMoveBackward: - dungeonMan.mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, -1, 0, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY); + dungeonMan.f150_mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, -1, 0, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY); break; case k4_CommandMoveRight: - dungeonMan.mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 0, 1, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY); + dungeonMan.f150_mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 0, 1, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY); break; default: break; @@ -473,46 +473,46 @@ void EventManager::commandMoveParty(CommandType cmdType) { // MISSING CODE: Lots of code } -void EventManager::commandSetLeader(ChampionIndex champIndex) { +void EventManager::f368_commandSetLeader(ChampionIndex champIndex) { ChampionMan &cm = *_vm->_championMan; ChampionIndex leaderIndex; - if ((cm._g411_leaderIndex == champIndex) || ((champIndex != kM1_ChampionNone) && !cm._champions[champIndex]._currHealth)) + if ((cm._g411_leaderIndex == champIndex) || ((champIndex != kM1_ChampionNone) && !cm._gK71_champions[champIndex]._currHealth)) return; if (cm._g411_leaderIndex != kM1_ChampionNone) { leaderIndex = cm._g411_leaderIndex; - cm._champions[leaderIndex].setAttributeFlag(k0x0200_ChampionAttributeLoad, true); - cm._champions[leaderIndex].setAttributeFlag(k0x0080_ChampionAttributeNameTitle, true); - cm._champions[leaderIndex]._load -= _vm->_dungeonMan->getObjectWeight(cm._414_leaderHandObject); + cm._gK71_champions[leaderIndex].setAttributeFlag(k0x0200_ChampionAttributeLoad, true); + cm._gK71_champions[leaderIndex].setAttributeFlag(k0x0080_ChampionAttributeNameTitle, true); + cm._gK71_champions[leaderIndex]._load -= _vm->_dungeonMan->f140_getObjectWeight(cm._g414_leaderHandObject); cm._g411_leaderIndex = kM1_ChampionNone; - cm.drawChampionState(leaderIndex); + cm.f292_drawChampionState(leaderIndex); } if (champIndex == kM1_ChampionNone) { cm._g411_leaderIndex = kM1_ChampionNone; return; } cm._g411_leaderIndex = champIndex; - Champion *champion = &cm._champions[cm._g411_leaderIndex]; + Champion *champion = &cm._gK71_champions[cm._g411_leaderIndex]; champion->_dir = _vm->_dungeonMan->_g308_partyDir; - cm._champions[champIndex]._load += _vm->_dungeonMan->getObjectWeight(cm._414_leaderHandObject); - if (_vm->indexToOrdinal(champIndex) != cm._g299_candidateChampionOrdinal) { + cm._gK71_champions[champIndex]._load += _vm->_dungeonMan->f140_getObjectWeight(cm._g414_leaderHandObject); + if (_vm->M0_indexToOrdinal(champIndex) != cm._g299_candidateChampionOrdinal) { champion->setAttributeFlag(k0x0400_ChampionAttributeIcon, true); champion->setAttributeFlag(k0x0080_ChampionAttributeNameTitle, true); - cm.drawChampionState(champIndex); + cm.f292_drawChampionState(champIndex); } } -void EventManager::commandProcessType80ClickInDungeonViewTouchFrontWall() { +void EventManager::f372_commandProcessType80ClickInDungeonViewTouchFrontWall() { DungeonMan &dunMan = *_vm->_dungeonMan; int16 mapX = dunMan._g306_partyMapX + _vm->_dirIntoStepCountEast[dunMan._g308_partyDir]; int16 mapY = dunMan._g307_partyMapY + _vm->_dirIntoStepCountNorth[dunMan._g308_partyDir]; if ((mapX >= 0) && (mapX < dunMan._g273_currMapWidth) && (mapY >= 0) && (mapY < dunMan._g274_currMapHeight)) { - _vm->_g321_stopWaitingForPlayerInput = _vm->_movsens->sensorIsTriggeredByClickOnWall(mapX, mapY, returnOppositeDir(dunMan._g308_partyDir)); + _vm->_g321_stopWaitingForPlayerInput = _vm->_movsens->f275_sensorIsTriggeredByClickOnWall(mapX, mapY, returnOppositeDir(dunMan._g308_partyDir)); } } -void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY) { +void EventManager::f377_commandProcessType80ClickInDungeonView(int16 posX, int16 posY) { DungeonMan &dunMan = *_vm->_dungeonMan; ChampionMan &champMan = *_vm->_championMan; @@ -524,7 +524,7 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY int16 mapX = dunMan._g306_partyMapX + _vm->_dirIntoStepCountEast[dunMan._g308_partyDir]; int16 mapY = dunMan._g307_partyMapY + _vm->_dirIntoStepCountNorth[dunMan._g308_partyDir]; - if (Door(dunMan.getSquareFirstThingData(mapX, mapY)).hasButton() && + if (Door(dunMan.f157_getSquareFirstThingData(mapX, mapY)).hasButton() && dunMan._g291_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn].isPointInside(Common::Point(posX, posY - 33))) { _vm->_g321_stopWaitingForPlayerInput = true; warning("MISSING CODE: F0064_SOUND_RequestPlay_CPSD"); @@ -541,7 +541,7 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY if (dunMan._g291_dungeonViewClickableBoxes[viewCell].isPointInside(Common::Point(posX, posY - 33))) { if (viewCell == k5_ViewCellDoorButtonOrWallOrn) { if (!dunMan._g286_isFacingAlcove) { - commandProcessType80ClickInDungeonViewTouchFrontWall(); + f372_commandProcessType80ClickInDungeonViewTouchFrontWall(); } } else { warning("MISSING CODE: F0373_COMMAND_ProcessType80_ClickInDungeonView_GrabLeaderHandObject"); @@ -550,8 +550,8 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY } } } else { - Thing thing = champMan._414_leaderHandObject; - uint16 *rawThingPointer = dunMan.getThingData(thing); + Thing thing = champMan._g414_leaderHandObject; + uint16 *rawThingPointer = dunMan.f156_getThingData(thing); if (dunMan._g285_squareAheadElement == k0_ElementTypeWall) { for (int16 viewCell = k0_ViewCellFronLeft; viewCell <= k1_ViewCellFrontRight; ++viewCell) { if (g462_BoxObjectPiles[viewCell].isPointInside(Common::Point(posX, posY))) { @@ -565,8 +565,8 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY warning("MISSING CODE: F0374_COMMAND_ProcessType80_ClickInDungeonView_DropLeaderHandObject"); } else { if (dunMan._g288_isFacingFountain) { - uint16 iconIndex = _vm->_objectMan->getIconIndex(thing); - int16 weight = dunMan.getObjectWeight(thing); + uint16 iconIndex = _vm->_objectMan->f33_getIconIndex(thing); + int16 weight = dunMan.f140_getObjectWeight(thing); if ((iconIndex >= k8_IconIndiceJunkWater) && (iconIndex <= k9_IconIndiceJunkWaterSkin)) { ((Junk*)rawThingPointer)->setChargeCount(3); } else if (iconIndex == k195_IconIndicePotionEmptyFlask) { @@ -574,11 +574,11 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY } else { goto T0377019; } - champMan.drawChangedObjectIcons(); - champMan._champions[champMan._g411_leaderIndex]._load += dunMan.getObjectWeight(thing) - weight; + champMan.f296_drawChangedObjectIcons(); + champMan._gK71_champions[champMan._g411_leaderIndex]._load += dunMan.f140_getObjectWeight(thing) - weight; } T0377019: - commandProcessType80ClickInDungeonViewTouchFrontWall(); + f372_commandProcessType80ClickInDungeonViewTouchFrontWall(); } } } else { @@ -593,19 +593,19 @@ T0377019: } } -void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePanel(CommandType commandType) { +void EventManager::f282_commandProcessCommands160To162ClickInResurrectReincarnatePanel(CommandType commandType) { ChampionMan &champMan = *_vm->_championMan; InventoryMan &invMan = *_vm->_inventoryMan; DisplayMan &dispMan = *_vm->_displayMan; DungeonMan &dunMan = *_vm->_dungeonMan; uint16 championIndex = champMan._g305_partyChampionCount - 1; - Champion *champ = &champMan._champions[championIndex]; + Champion *champ = &champMan._gK71_champions[championIndex]; if (commandType == k162_CommandClickInPanelCancel) { - invMan.toggleInventory(k4_ChampionCloseInventory); - champMan._g299_candidateChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone); + invMan.f355_toggleInventory(k4_ChampionCloseInventory); + champMan._g299_candidateChampionOrdinal = _vm->M0_indexToOrdinal(kM1_ChampionNone); if (champMan._g305_partyChampionCount == 1) { - commandSetLeader(kM1_ChampionNone); + f368_commandSetLeader(kM1_ChampionNone); } champMan._g305_partyChampionCount--; Box box; @@ -614,14 +614,14 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane box._x1 = championIndex * k69_ChampionStatusBoxSpacing; box._x2 = box._x1 + 66 + 1; dispMan._g578_useByteBoxCoordinates = false; - dispMan.clearScreenBox(k0_ColorBlack, box); - dispMan.clearScreenBox(k0_ColorBlack, g54_BoxChampionIcons[champMan.championIconIndex(champ->_cell, dunMan._g308_partyDir) * 2]); + dispMan.D24_clearScreenBox(k0_ColorBlack, box); + dispMan.D24_clearScreenBox(k0_ColorBlack, g54_BoxChampionIcons[champMan.M26_championIconIndex(champ->_cell, dunMan._g308_partyDir) * 2]); warning("F0457_START_DrawEnabledMenus_CPSF"); warning("F0078_MOUSE_ShowPointer"); return; } - champMan._g299_candidateChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone); + champMan._g299_candidateChampionOrdinal = _vm->M0_indexToOrdinal(kM1_ChampionNone); int16 mapX = dunMan._g306_partyMapX + _vm->_dirIntoStepCountEast[dunMan._g308_partyDir]; int16 mapY = dunMan._g307_partyMapY + _vm->_dirIntoStepCountNorth[dunMan._g308_partyDir]; @@ -631,17 +631,17 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane warning("MISSING CODE: F0164_DUNGEON_UnlinkThingFromList"); } } - Thing thing = dunMan.getSquareFirstThing(mapX, mapY); + Thing thing = dunMan.f161_getSquareFirstThing(mapX, mapY); for (;;) { // infinite if (thing.getType() == k3_SensorThingType) { - ((Sensor*)dunMan.getThingData(thing))->setTypeDisabled(); + ((Sensor*)dunMan.f156_getThingData(thing))->setTypeDisabled(); break; } - thing = dunMan.getNextThing(thing); + thing = dunMan.f159_getNextThing(thing); } if (commandType == k161_CommandClickInPanelReincarnate) { - champMan.renameChampion(champ); + champMan.f281_renameChampion(champ); champ->resetSkillsToZero(); for (uint16 i = 0; i < 12; i++) { @@ -653,10 +653,10 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane if (champMan._g305_partyChampionCount == 1) { warning("MISSING CODE: setting time, G0362_l_LastPartyMovementTime , G0313_ul_GameTime"); - commandSetLeader(k0_ChampionFirst); - _vm->_menuMan->setMagicCasterAndDrawSpellArea(k0_ChampionFirst); + f368_commandSetLeader(k0_ChampionFirst); + _vm->_menuMan->f394_setMagicCasterAndDrawSpellArea(k0_ChampionFirst); } else { - _vm->_menuMan->drawSpellAreaControls(champMan._g514_magicCasterChampionIndex); + _vm->_menuMan->f393_drawSpellAreaControls(champMan._g514_magicCasterChampionIndex); } warning("MISSING CODE: F0051_TEXT_MESSAGEAREA_PrintLineFeed"); @@ -664,12 +664,12 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane warning("MISSING CODE: F0047_TEXT_MESSAGEAREA_PrintMessage"); warning("MISSING CODE: F0047_TEXT_MESSAGEAREA_PrintMessage"); - invMan.toggleInventory(k4_ChampionCloseInventory); + invMan.f355_toggleInventory(k4_ChampionCloseInventory); warning("MISSING CODE: F0457_START_DrawEnabledMenus_CPSF"); warning("MISSING CODE: F0067_MOUSE_SetPointerToNormal"); } -void EventManager::commandProcess81ClickInPanel(int16 x, int16 y) { +void EventManager::f378_commandProcess81ClickInPanel(int16 x, int16 y) { ChampionMan &champMan = *_vm->_championMan; InventoryMan &invMan = *_vm->_inventoryMan; @@ -678,23 +678,23 @@ void EventManager::commandProcess81ClickInPanel(int16 x, int16 y) { case k4_PanelContentChest: if (champMan._g411_leaderIndex == kM1_ChampionNone) // if no leader return; - commandType = getCommandTypeFromMouseInput(g456_MouseInput_PanelChest, Common::Point(x, y), k1_LeftMouseButton); + commandType = f358_getCommandTypeFromMouseInput(g456_MouseInput_PanelChest, Common::Point(x, y), k1_LeftMouseButton); if (commandType != k0_CommandNone) warning("MISSING CODE: F0302_CHAMPION_ProcessCommands28To65_ClickOnSlotBox"); break; case k5_PanelContentResurrectReincarnate: if (!champMan._g415_leaderEmptyHanded) break; - commandType = getCommandTypeFromMouseInput(g457_MouseInput_PanelResurrectReincarnateCancel, Common::Point(x, y), k1_LeftMouseButton); + commandType = f358_getCommandTypeFromMouseInput(g457_MouseInput_PanelResurrectReincarnateCancel, Common::Point(x, y), k1_LeftMouseButton); if (commandType != k0_CommandNone) - commandProcessCommands160To162ClickInResurrectReincarnatePanel(commandType); + f282_commandProcessCommands160To162ClickInResurrectReincarnatePanel(commandType); break; default: break; } } -bool EventManager::hasPendingClick(Common::Point& point, MouseButton button) { +bool EventManager::f360_hasPendingClick(Common::Point& point, MouseButton button) { if (_g439_pendingClickButton && button == _g439_pendingClickButton) point = _g437_pendingClickPos; diff --git a/engines/dm/eventman.h b/engines/dm/eventman.h index 35f8bd6dc3..51f176185a 100644 --- a/engines/dm/eventman.h +++ b/engines/dm/eventman.h @@ -225,8 +225,8 @@ class EventManager { bool _g435_isCommandQueueLocked; // @ G0435_B_CommandQueueLocked Common::Queue _commandQueue; - void commandTurnParty(CommandType cmdType); // @ F0365_COMMAND_ProcessTypes1To2_TurnParty - void commandMoveParty(CommandType cmdType); // @ F0366_COMMAND_ProcessTypes3To6_MoveParty + void f365_commandTurnParty(CommandType cmdType); // @ F0365_COMMAND_ProcessTypes1To2_TurnParty + void f366_commandMoveParty(CommandType cmdType); // @ F0366_COMMAND_ProcessTypes3To6_MoveParty public: explicit EventManager(DMEngine *vm); @@ -242,18 +242,18 @@ public: void setMousePos(Common::Point pos); void processInput(); // acknowledges mouse and keyboard input - 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 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 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 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 - bool hasPendingClick(Common::Point &point, MouseButton button); + bool f360_hasPendingClick(Common::Point &point, MouseButton button); // @ F0360_COMMAND_ProcessPendingClick }; } diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp index 18deb969cd..a21d8213e1 100644 --- a/engines/dm/gfx.cpp +++ b/engines/dm/gfx.cpp @@ -728,7 +728,7 @@ void DisplayMan::setUpScreens(uint16 width, uint16 height) { clearScreen(k0_ColorBlack); } -void DisplayMan::loadGraphics() { +void DisplayMan::f479_loadGraphics() { Common::File f; f.open("graphics.dat"); _grapItemCount = f.readUint16BE(); @@ -749,7 +749,7 @@ void DisplayMan::loadGraphics() { unpackGraphics(); } -void DisplayMan::initializeGraphicData() { +void DisplayMan::f460_initializeGraphicData() { _g85_bitmapCeiling = new byte[224 * 29]; _g84_bitmapFloor = new byte[224 * 70]; _g697_bitmapWallSet_Wall_D3L2 = new byte[16 * 49]; @@ -801,8 +801,8 @@ void DisplayMan::initializeGraphicData() { for (int16 objectAspectIndex = 0; objectAspectIndex < k85_ObjAspectCount; ++objectAspectIndex, ++objectAspect) { derivedBitmapIndex = k104_DerivedBitmapFirstObject + objectAspect->_firstDerivedBitmapRelativeIndex; - _g639_derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapPixelCount(objectAspect->_width, objectAspect->_height, k16_Scale_D3); - _g639_derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapPixelCount(objectAspect->_width, objectAspect->_height, k20_Scale_D2); + _g639_derivedBitmapByteCount[derivedBitmapIndex++] = f459_getScaledBitmapPixelCount(objectAspect->_width, objectAspect->_height, k16_Scale_D3); + _g639_derivedBitmapByteCount[derivedBitmapIndex++] = f459_getScaledBitmapPixelCount(objectAspect->_width, objectAspect->_height, k20_Scale_D2); if (getFlag(objectAspect->_graphicInfo, k0x0001_ObjectFlipOnRightMask)) { _g639_derivedBitmapByteCount[derivedBitmapIndex] = _g639_derivedBitmapByteCount[derivedBitmapIndex - 2]; @@ -825,7 +825,7 @@ void DisplayMan::initializeGraphicData() { derivedBitmapIndex = k282_DerivedBitmapFirstProjectile + projectileAspect->_firstDerivedBitmapRelativeIndex; for (int16 projectileScaleIndex = 0; projectileScaleIndex < 6; projectileScaleIndex++) { - int16 bitmapPixelCount = getScaledBitmapPixelCount(projectileAspect->_width, projectileAspect->_height, g215_ProjectileScales[projectileScaleIndex]); + int16 bitmapPixelCount = f459_getScaledBitmapPixelCount(projectileAspect->_width, projectileAspect->_height, g215_ProjectileScales[projectileScaleIndex]); _g639_derivedBitmapByteCount[derivedBitmapIndex] = bitmapPixelCount; if (getFlag(projectileAspect->_graphicInfo, k0x0003_ProjectileAspectTypeMask) != k3_ProjectileAspectHasNone) { @@ -847,7 +847,7 @@ void DisplayMan::initializeGraphicData() { ExplosionAspect *expAsp = g211_ExplosionAspects; for (uint16 expAspIndex = 0; expAspIndex < k4_ExplosionAspectCount; ++expAspIndex, expAsp++) { for (int16 scale = 4; scale < 32; scale += 2) - _g639_derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapPixelCount(expAsp->_pixelWidth, expAsp->_height, scale); + _g639_derivedBitmapByteCount[derivedBitmapIndex++] = f459_getScaledBitmapPixelCount(expAsp->_pixelWidth, expAsp->_height, scale); if (expAspIndex == k3_ExplosionAspectSmoke) { _g639_derivedBitmapByteCount[derivedBitmapIndex++] = expAsp->_pixelWidth * expAsp->_height; @@ -863,14 +863,14 @@ void DisplayMan::initializeGraphicData() { creatureAsp->_firstDerivedBitmapIndex = derivedBitmapIndex; int16 creatureFrontBitmapD3PixelCount; - _g639_derivedBitmapByteCount[derivedBitmapIndex++] = creatureFrontBitmapD3PixelCount = getScaledBitmapPixelCount(creatureAsp->_byteWidthFront, creatureAsp->_heightFront, k16_Scale_D3); + _g639_derivedBitmapByteCount[derivedBitmapIndex++] = creatureFrontBitmapD3PixelCount = f459_getScaledBitmapPixelCount(creatureAsp->_byteWidthFront, creatureAsp->_heightFront, k16_Scale_D3); int16 creatureFrontBitmapD2PixelCount; - _g639_derivedBitmapByteCount[derivedBitmapIndex++] = creatureFrontBitmapD2PixelCount = getScaledBitmapPixelCount(creatureAsp->_byteWidthFront, creatureAsp->_heightFront, k20_Scale_D2); + _g639_derivedBitmapByteCount[derivedBitmapIndex++] = creatureFrontBitmapD2PixelCount = f459_getScaledBitmapPixelCount(creatureAsp->_byteWidthFront, creatureAsp->_heightFront, k20_Scale_D2); if (getFlag(creatureGraphicInfo, k0x0008_CreatureInfoGraphicMaskSide)) { - _g639_derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapPixelCount(creatureAsp->_byteWidthSide, creatureAsp->_heightSide, k16_Scale_D3); - _g639_derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapPixelCount(creatureAsp->_byteWidthSide, creatureAsp->_heightSide, k20_Scale_D2); + _g639_derivedBitmapByteCount[derivedBitmapIndex++] = f459_getScaledBitmapPixelCount(creatureAsp->_byteWidthSide, creatureAsp->_heightSide, k16_Scale_D3); + _g639_derivedBitmapByteCount[derivedBitmapIndex++] = f459_getScaledBitmapPixelCount(creatureAsp->_byteWidthSide, creatureAsp->_heightSide, k20_Scale_D2); } if (getFlag(creatureGraphicInfo, k0x0010_CreatureInfoGraphicMaskBack)) { @@ -879,16 +879,16 @@ void DisplayMan::initializeGraphicData() { } if (getFlag(creatureGraphicInfo, k0x0020_CreatureInfoGraphicMaskAttack)) { - _g639_derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapPixelCount(creatureAsp->_byteWidthAttack, creatureAsp->_heightAttack, k16_Scale_D3); - _g639_derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapPixelCount(creatureAsp->_byteWidthAttack, creatureAsp->_heightAttack, k20_Scale_D2); + _g639_derivedBitmapByteCount[derivedBitmapIndex++] = f459_getScaledBitmapPixelCount(creatureAsp->_byteWidthAttack, creatureAsp->_heightAttack, k16_Scale_D3); + _g639_derivedBitmapByteCount[derivedBitmapIndex++] = f459_getScaledBitmapPixelCount(creatureAsp->_byteWidthAttack, creatureAsp->_heightAttack, k20_Scale_D2); } int16 additionalFronGraphicCount; if (additionalFronGraphicCount = getFlag(creatureGraphicInfo, k0x0003_CreatureInfoGraphicMaskAdditional)) { do { _g639_derivedBitmapByteCount[derivedBitmapIndex++] = creatureAsp->_byteWidthFront * creatureAsp->_heightFront; - _g639_derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapPixelCount(creatureAsp->_byteWidthFront, creatureAsp->_heightFront, k16_Scale_D3); - _g639_derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapPixelCount(creatureAsp->_byteWidthFront, creatureAsp->_heightFront, k20_Scale_D2); + _g639_derivedBitmapByteCount[derivedBitmapIndex++] = f459_getScaledBitmapPixelCount(creatureAsp->_byteWidthFront, creatureAsp->_heightFront, k16_Scale_D3); + _g639_derivedBitmapByteCount[derivedBitmapIndex++] = f459_getScaledBitmapPixelCount(creatureAsp->_byteWidthFront, creatureAsp->_heightFront, k20_Scale_D2); } while (--additionalFronGraphicCount); } } @@ -908,15 +908,15 @@ void DisplayMan::unpackGraphics() { } _bitmaps = new byte*[575]; // largest graphic indice (i think) _bitmaps[0] = new byte[unpackedBitmapsSize]; - loadIntoBitmap(0, _bitmaps[0]); + f466_loadIntoBitmap(0, _bitmaps[0]); for (uint16 i = 1; i <= 20; ++i) { _bitmaps[i] = _bitmaps[i - 1] + getWidth(i - 1) * getHeight(i - 1); - loadIntoBitmap(i, _bitmaps[i]); + f466_loadIntoBitmap(i, _bitmaps[i]); } _bitmaps[22] = _bitmaps[20] + getWidth(20) * getHeight(20); for (uint16 i = 23; i <= 532; ++i) { _bitmaps[i] = _bitmaps[i - 1] + getWidth(i - 1) * getHeight(i - 1); - loadIntoBitmap(i, _bitmaps[i]); + f466_loadIntoBitmap(i, _bitmaps[i]); } _bitmaps[k557_FontGraphicIndice] = _bitmaps[532] + getWidth(532) * getHeight(532); loadFNT1intoBitmap(k557_FontGraphicIndice, _bitmaps[k557_FontGraphicIndice]); @@ -955,7 +955,7 @@ void DisplayMan::f566_viewportBlitToScreen() { warning("MISSING FUNCTIONALITY: using correct colorpalette"); Box box(0, 223, 33, 33 + 135); - blitToBitmap(_g296_bitmapViewport, k112_byteWidthViewport * 2, 0, 0, _g348_bitmapScreen, k160_byteWidthScreen * 2, box, k255_ColorNoTransparency); + f132_blitToBitmap(_g296_bitmapViewport, k112_byteWidthViewport * 2, 0, 0, _g348_bitmapScreen, k160_byteWidthScreen * 2, box, k255_ColorNoTransparency); } void DisplayMan::loadPalette(uint16 *palette) { @@ -969,7 +969,7 @@ void DisplayMan::loadPalette(uint16 *palette) { } -void DisplayMan::loadIntoBitmap(uint16 index, byte *destBitmap) { +void DisplayMan::f466_loadIntoBitmap(uint16 index, byte *destBitmap) { uint8 *data = _packedBitmaps + _packedItemPos[index]; uint16 width = READ_BE_UINT16(data); uint16 height = READ_BE_UINT16(data + 2); @@ -1018,7 +1018,7 @@ void DisplayMan::loadIntoBitmap(uint16 index, byte *destBitmap) { } -void DisplayMan::blitToBitmap(byte* srcBitmap, uint16 srcWidth, uint16 srcX, uint16 srcY, byte* destBitmap, uint16 destWidth, Box& box, Color transparent) { +void DisplayMan::f132_blitToBitmap(byte* srcBitmap, uint16 srcWidth, uint16 srcX, uint16 srcY, byte* destBitmap, uint16 destWidth, Box& box, Color transparent) { for (uint16 y = 0; y < box._y2 - box._y1; ++y) for (uint16 x = 0; x < box._x2 - box._x1; ++x) { byte srcPixel = srcBitmap[srcWidth * (y + srcY) + srcX + x]; @@ -1028,7 +1028,7 @@ void DisplayMan::blitToBitmap(byte* srcBitmap, uint16 srcWidth, uint16 srcX, uin } -void DisplayMan::clearScreenBox(Color color, Box &box) { +void DisplayMan::D24_clearScreenBox(Color color, Box &box) { uint16 width = box._x2 - box._x1; for (int16 y = box._y1; y < box._y2; ++y) memset(_g348_bitmapScreen + y * _screenWidth + box._x1, color, sizeof(byte) * width); @@ -1039,7 +1039,7 @@ void DisplayMan::f135_fillBoxBitmap(byte* destBitmap, Box &box, Color color, int memset(destBitmap + y * pixelWidth + box._x1, color, sizeof(byte) * (box._x2 - box._x1)); } -void DisplayMan::blitBoxFilledWithMaskedBitmap(byte* src, byte* dest, byte* mask, byte* tmp, Box& box, +void DisplayMan::f133_blitBoxFilledWithMaskedBitmap(byte* src, byte* dest, byte* mask, byte* tmp, Box& box, int16 lastUnitIndex, int16 firstUnitIndex, int16 destPixelWidth, Color transparent, int16 xPos, int16 yPos, int16 destHeight, int16 height2) { warning("STUB FUNCTION: does nothing at all"); @@ -1047,7 +1047,7 @@ void DisplayMan::blitBoxFilledWithMaskedBitmap(byte* src, byte* dest, byte* mask -void DisplayMan::flipBitmapHorizontal(byte *bitmap, uint16 width, uint16 height) { +void DisplayMan::f103_flipBitmapHorizontal(byte *bitmap, uint16 width, uint16 height) { for (uint16 y = 0; y < height; ++y) { for (uint16 x = 0; x < width / 2; ++x) { byte tmp; @@ -1070,22 +1070,22 @@ void DisplayMan::flipBitmapVertical(byte *bitmap, uint16 width, uint16 height) { delete[] tmp; } -byte* DisplayMan::getExplosionBitmap(uint16 explosionAspIndex, uint16 scale, int16& returnPixelWidth, int16& returnHeight) { +byte* DisplayMan::f114_getExplosionBitmap(uint16 explosionAspIndex, uint16 scale, int16& returnPixelWidth, int16& returnHeight) { ExplosionAspect *explAsp = &g211_ExplosionAspects[explosionAspIndex]; if (scale > 32) scale = 32; - int16 pixelWidth = getScaledDimension(explAsp->_pixelWidth, scale); - int16 height = getScaledDimension(explAsp->_height, scale); + int16 pixelWidth = M78_getScaledDimension(explAsp->_pixelWidth, scale); + int16 height = M78_getScaledDimension(explAsp->_height, scale); byte *bitmap; int16 derBitmapIndex = (explosionAspIndex * 14) + scale / 2 + k438_DerivedBitmapFirstExplosion - 2; if ((scale == 32) && (explosionAspIndex != k3_ExplosionAspectSmoke)) { - bitmap = getBitmap(explosionAspIndex + k348_FirstExplosionGraphicIndice); - } else if (isDerivedBitmapInCache(derBitmapIndex)) { - bitmap = getDerivedBitmap(derBitmapIndex); + bitmap = f489_getBitmap(explosionAspIndex + k348_FirstExplosionGraphicIndice); + } else if (f491_isDerivedBitmapInCache(derBitmapIndex)) { + bitmap = f492_getDerivedBitmap(derBitmapIndex); } else { - byte *nativeBitmap = getBitmap(MIN(explosionAspIndex, (uint16)k2_ExplosionAspectPoison) + k348_FirstExplosionGraphicIndice); - bitmap = getDerivedBitmap(derBitmapIndex); - blitToBitmapShrinkWithPalChange(nativeBitmap, explAsp->_pixelWidth, explAsp->_height, bitmap, pixelWidth, height, + byte *nativeBitmap = f489_getBitmap(MIN(explosionAspIndex, (uint16)k2_ExplosionAspectPoison) + k348_FirstExplosionGraphicIndice); + bitmap = f492_getDerivedBitmap(derBitmapIndex); + f129_blitToBitmapShrinkWithPalChange(nativeBitmap, explAsp->_pixelWidth, explAsp->_height, bitmap, pixelWidth, height, (explosionAspIndex == k3_ExplosionAspectSmoke) ? g212_PalChangeSmoke : g17_PalChangesNoChanges); warning("IGNORED CODE: F0493_CACHE_AddDerivedBitmap"); } @@ -1148,37 +1148,37 @@ uint16 DisplayMan::getHeight(uint16 index) { // Note: has been screened for missing code void DisplayMan::f99_copyBitmapAndFlipHorizontal(byte* srcBitmap, byte* destBitmap, uint16 pixelWidth, uint16 height) { memmove(destBitmap, srcBitmap, pixelWidth * height * sizeof(byte)); - flipBitmapHorizontal(destBitmap, pixelWidth, height); + f103_flipBitmapHorizontal(destBitmap, pixelWidth, height); } -void DisplayMan::drawWallSetBitmapWithoutTransparency(byte *bitmap, Frame &f) { +void DisplayMan::f101_drawWallSetBitmapWithoutTransparency(byte *bitmap, Frame &f) { if (f._srcWidth) - blitToBitmap(bitmap, f._srcWidth, f._srcX, f._srcY, _g296_bitmapViewport, k112_byteWidthViewport * 2, f._box, k255_ColorNoTransparency); + f132_blitToBitmap(bitmap, f._srcWidth, f._srcX, f._srcY, _g296_bitmapViewport, k112_byteWidthViewport * 2, f._box, k255_ColorNoTransparency); } -void DisplayMan::drawWallSetBitmap(byte *bitmap, Frame &f) { +void DisplayMan::f100_drawWallSetBitmap(byte *bitmap, Frame &f) { if (f._srcWidth) - blitToBitmap(bitmap, f._srcWidth, f._srcX, f._srcY, _g296_bitmapViewport, k112_byteWidthViewport * 2, f._box, k10_ColorFlesh); + f132_blitToBitmap(bitmap, f._srcWidth, f._srcX, f._srcY, _g296_bitmapViewport, k112_byteWidthViewport * 2, f._box, k10_ColorFlesh); } // NOTE: has been screened for missing code -void DisplayMan::drawSquareD3L(direction dir, int16 posX, int16 posY) { +void DisplayMan::f116_drawSquareD3L(direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; int16 order; - _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[k0_ElemAspect]) { case k19_StairsFrontElemType: if (squareAspect[k2_StairsUpAspect]) - drawFloorPitOrStairsBitmap(_g675_stairsNativeBitmapIndex_Up_Front_D3L, g110_FrameStairsUpFront_D3L); + f104_drawFloorPitOrStairsBitmap(_g675_stairsNativeBitmapIndex_Up_Front_D3L, g110_FrameStairsUpFront_D3L); else - drawFloorPitOrStairsBitmap(_g682_stairsNativeBitmapIndex_Down_Front_D3L, g121_FrameStairsDownFront_D3L); + f104_drawFloorPitOrStairsBitmap(_g682_stairsNativeBitmapIndex_Down_Front_D3L, g121_FrameStairsDownFront_D3L); goto T0116015_redEagle; case k0_WallElemType: - drawWallSetBitmap(_g698_bitmapWallSet_Wall_D3LCR, g163_FrameWalls[k1_ViewSquare_D3L]); - isDrawnWallOrnAnAlcove(squareAspect[k2_RightWallOrnOrdAspect], k0_ViewWall_D3L_RIGHT); - if (isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k2_ViewWall_D3L_FRONT)) { + f100_drawWallSetBitmap(_g698_bitmapWallSet_Wall_D3LCR, g163_FrameWalls[k1_ViewSquare_D3L]); + f107_isDrawnWallOrnAnAlcove(squareAspect[k2_RightWallOrnOrdAspect], k0_ViewWall_D3L_RIGHT); + if (f107_isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k2_ViewWall_D3L_FRONT)) { order = k0x0000_CellOrder_Alcove; goto T0116017_orangeElk; } @@ -1189,14 +1189,14 @@ void DisplayMan::drawSquareD3L(direction dir, int16 posX, int16 posY) { goto T0116016_blueToad; case k17_ElementTypeDoorFront: warning("MISSING CODE: F0108_DUNGEONVIEW_DrawFloorOrnament"); - cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k1_ViewSquare_D3L, k0x0218_CellOrder_DoorPass1_BackLeft_BackRight); - drawWallSetBitmap(_g705_bitmapWallSet_DoorFrameLeft_D3L, g164_Frame_DoorFrameLeft_D3L); + f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k1_ViewSquare_D3L, k0x0218_CellOrder_DoorPass1_BackLeft_BackRight); + f100_drawWallSetBitmap(_g705_bitmapWallSet_DoorFrameLeft_D3L, g164_Frame_DoorFrameLeft_D3L); warning("MISSING CODE: F0111_DUNGEONVIEW_DrawDoor"); order = k0x0349_CellOrder_DoorPass2_FrontLeft_FrontRight; goto T0116017_orangeElk; case k2_ElementTypePit: if (!squareAspect[k2_PitInvisibleAspect]) { - drawFloorPitOrStairsBitmap(k49_FloorPit_D3L_GraphicIndice, g140_FrameFloorPit_D3L); + f104_drawFloorPitOrStairsBitmap(k49_FloorPit_D3L_GraphicIndice, g140_FrameFloorPit_D3L); } case k5_ElementTypeTeleporter: case k1_ElementTypeCorridor: @@ -1205,32 +1205,32 @@ T0116015_redEagle: T0116016_blueToad: warning("MISSING CODE: F0108_DUNGEONVIEW_DrawFloorOrnament"); T0116017_orangeElk: - cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k1_ViewSquare_D3L, order); + f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k1_ViewSquare_D3L, order); } if ((squareAspect[k0_ElemAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) { - drawField(&g188_FieldAspects[k1_ViewSquare_D3L], g163_FrameWalls[k1_ViewSquare_D3L]._box); + f113_drawField(&g188_FieldAspects[k1_ViewSquare_D3L], g163_FrameWalls[k1_ViewSquare_D3L]._box); } } // NOTE: has been screened for missing code -void DisplayMan::drawSquareD3R(direction dir, int16 posX, int16 posY) { +void DisplayMan::f117_drawSquareD3R(direction dir, int16 posX, int16 posY) { int16 order; uint16 squareAspect[5]; - _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[k0_ElemAspect]) { case k19_ElementTypeStaisFront: if (squareAspect[k2_StairsUpAspect]) { - drawFloorPitOrStairsBitmapFlippedHorizontally(_g675_stairsNativeBitmapIndex_Up_Front_D3L, g112_FrameStairsUpFront_D3R); + f105_drawFloorPitOrStairsBitmapFlippedHorizontally(_g675_stairsNativeBitmapIndex_Up_Front_D3L, g112_FrameStairsUpFront_D3R); } else { - drawFloorPitOrStairsBitmapFlippedHorizontally(_g682_stairsNativeBitmapIndex_Down_Front_D3L, g123_FrameStairsDownFront_D3R); + f105_drawFloorPitOrStairsBitmapFlippedHorizontally(_g682_stairsNativeBitmapIndex_Down_Front_D3L, g123_FrameStairsDownFront_D3R); } goto T0117016; case k0_ElementTypeWall: - drawWallSetBitmap(_g698_bitmapWallSet_Wall_D3LCR, g163_FrameWalls[k2_ViewSquare_D3R]); - isDrawnWallOrnAnAlcove(squareAspect[k4_LeftWallOrnOrdAspect], k1_ViewWall_D3R_LEFT); - if (isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k4_ViewWall_D3R_FRONT)) { + f100_drawWallSetBitmap(_g698_bitmapWallSet_Wall_D3LCR, g163_FrameWalls[k2_ViewSquare_D3R]); + f107_isDrawnWallOrnAnAlcove(squareAspect[k4_LeftWallOrnOrdAspect], k1_ViewWall_D3R_LEFT); + if (f107_isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k4_ViewWall_D3R_FRONT)) { order = k0x0000_CellOrder_Alcove; goto T0117018; } @@ -1241,7 +1241,7 @@ void DisplayMan::drawSquareD3R(direction dir, int16 posX, int16 posY) { goto T0117017; case k17_ElementTypeDoorFront: warning("MISSING CODE: F0108_DUNGEONVIEW_DrawFloorOrnament"); - cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k2_ViewSquare_D3R, k0x0128_CellOrder_DoorPass1_BackRight_BackLeft); + f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k2_ViewSquare_D3R, k0x0128_CellOrder_DoorPass1_BackRight_BackLeft); memmove(_g74_tmpBitmap, _g705_bitmapWallSet_DoorFrameLeft_D3L, 32 * 44); warning("MISSING CODE: F0103_DUNGEONVIEW_DrawDoorFrameBitmapFlippedHorizontally"); if (((Door*)_vm->_dungeonMan->_g284_thingData[k0_DoorThingType])[squareAspect[k3_DoorThingIndexAspect]].hasButton()) { @@ -1252,7 +1252,7 @@ void DisplayMan::drawSquareD3R(direction dir, int16 posX, int16 posY) { goto T0117018; case k2_ElementTypePit: if (!squareAspect[k2_PitInvisibleAspect]) { - drawFloorPitOrStairsBitmapFlippedHorizontally(k49_FloorPit_D3L_GraphicIndice, g142_FrameFloorPit_D3R); + f105_drawFloorPitOrStairsBitmapFlippedHorizontally(k49_FloorPit_D3L_GraphicIndice, g142_FrameFloorPit_D3R); } case k5_ElementTypeTeleporter: case k1_ElementTypeCorridor: @@ -1261,26 +1261,26 @@ T0117016: T0117017: warning("MISSING CODE: F0108_DUNGEONVIEW_DrawFloorOrnament"); T0117018: - cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k2_ViewSquare_D3R, order); + f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k2_ViewSquare_D3R, order); } if ((squareAspect[k0_ElemAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) { - drawField(&g188_FieldAspects[k2_ViewSquare_D3R], g163_FrameWalls[k2_ViewSquare_D3R]._box); + f113_drawField(&g188_FieldAspects[k2_ViewSquare_D3R], g163_FrameWalls[k2_ViewSquare_D3R]._box); } } -void DisplayMan::drawSquareD3C(direction dir, int16 posX, int16 posY) { +void DisplayMan::f118_drawSquareD3C(direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; - _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[0]) { case k19_StairsFrontElemType: if (squareAspect[k2_StairsUpAspect]) - drawFloorPitOrStairsBitmap(_g676_stairsNativeBitmapIndex_Up_Front_D3C, g111_FrameStairsUpFront_D3C); + f104_drawFloorPitOrStairsBitmap(_g676_stairsNativeBitmapIndex_Up_Front_D3C, g111_FrameStairsUpFront_D3C); else - drawFloorPitOrStairsBitmap(_g683_stairsNativeBitmapIndex_Down_Front_D3C, g122_FrameStairsDownFront_D3C); + f104_drawFloorPitOrStairsBitmap(_g683_stairsNativeBitmapIndex_Down_Front_D3C, g122_FrameStairsDownFront_D3C); break; case k0_WallElemType: - drawWallSetBitmapWithoutTransparency(_g698_bitmapWallSet_Wall_D3LCR, g163_FrameWalls[k0_ViewSquare_D3C]); - if (isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k3_ViewWall_D3C_FRONT)) { + f101_drawWallSetBitmapWithoutTransparency(_g698_bitmapWallSet_Wall_D3LCR, g163_FrameWalls[k0_ViewSquare_D3C]); + if (f107_isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k3_ViewWall_D3C_FRONT)) { //... missing code } break; @@ -1288,67 +1288,67 @@ void DisplayMan::drawSquareD3C(direction dir, int16 posX, int16 posY) { break; } } -void DisplayMan::drawSquareD2L(direction dir, int16 posX, int16 posY) { +void DisplayMan::f119_drawSquareD2L(direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; - _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[0]) { case k19_StairsFrontElemType: if (squareAspect[k2_StairsUpAspect]) - drawFloorPitOrStairsBitmap(_g677_stairsNativeBitmapIndex_Up_Front_D2L, g113_FrameStairsUpFront_D2L); + f104_drawFloorPitOrStairsBitmap(_g677_stairsNativeBitmapIndex_Up_Front_D2L, g113_FrameStairsUpFront_D2L); else - drawFloorPitOrStairsBitmap(_g684_stairsNativeBitmapIndex_Down_Front_D2L, g124_FrameStairsDownFront_D2L); + f104_drawFloorPitOrStairsBitmap(_g684_stairsNativeBitmapIndex_Down_Front_D2L, g124_FrameStairsDownFront_D2L); break; case k0_WallElemType: - drawWallSetBitmap(_g699_bitmapWallSet_Wall_D2LCR, g163_FrameWalls[k4_ViewSquare_D2L]); - isDrawnWallOrnAnAlcove(squareAspect[k2_RightWallOrnOrdAspect], k5_ViewWall_D2L_RIGHT); - if (isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k7_ViewWall_D2L_FRONT)) { + f100_drawWallSetBitmap(_g699_bitmapWallSet_Wall_D2LCR, g163_FrameWalls[k4_ViewSquare_D2L]); + f107_isDrawnWallOrnAnAlcove(squareAspect[k2_RightWallOrnOrdAspect], k5_ViewWall_D2L_RIGHT); + if (f107_isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k7_ViewWall_D2L_FRONT)) { // ... missing code } break; case k18_StairsSideElemType: - drawFloorPitOrStairsBitmap(_g689_stairsNativeBitmapIndex_Side_D2L, g132_FrameStairsSide_D2L); + f104_drawFloorPitOrStairsBitmap(_g689_stairsNativeBitmapIndex_Side_D2L, g132_FrameStairsSide_D2L); break; default: break; } } -void DisplayMan::drawSquareD2R(direction dir, int16 posX, int16 posY) { +void DisplayMan::f120_drawSquareD2R(direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; - _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[0]) { case k19_StairsFrontElemType: if (squareAspect[k2_StairsUpAspect]) - drawFloorPitOrStairsBitmapFlippedHorizontally(_g677_stairsNativeBitmapIndex_Up_Front_D2L, g115_FrameStairsUpFront_D2R); + f105_drawFloorPitOrStairsBitmapFlippedHorizontally(_g677_stairsNativeBitmapIndex_Up_Front_D2L, g115_FrameStairsUpFront_D2R); else - drawFloorPitOrStairsBitmapFlippedHorizontally(_g684_stairsNativeBitmapIndex_Down_Front_D2L, g126_FrameStairsDownFront_D2R); + f105_drawFloorPitOrStairsBitmapFlippedHorizontally(_g684_stairsNativeBitmapIndex_Down_Front_D2L, g126_FrameStairsDownFront_D2R); break; case k0_WallElemType: - drawWallSetBitmap(_g699_bitmapWallSet_Wall_D2LCR, g163_FrameWalls[k5_ViewSquare_D2R]); - isDrawnWallOrnAnAlcove(squareAspect[k4_LeftWallOrnOrdAspect], k6_ViewWall_D2R_LEFT); - if (isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k9_ViewWall_D2R_FRONT)) { + f100_drawWallSetBitmap(_g699_bitmapWallSet_Wall_D2LCR, g163_FrameWalls[k5_ViewSquare_D2R]); + f107_isDrawnWallOrnAnAlcove(squareAspect[k4_LeftWallOrnOrdAspect], k6_ViewWall_D2R_LEFT); + if (f107_isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k9_ViewWall_D2R_FRONT)) { // ... missing code } break; case k18_StairsSideElemType: - drawFloorPitOrStairsBitmapFlippedHorizontally(_g689_stairsNativeBitmapIndex_Side_D2L, g133_FrameStairsSide_D2R); + f105_drawFloorPitOrStairsBitmapFlippedHorizontally(_g689_stairsNativeBitmapIndex_Side_D2L, g133_FrameStairsSide_D2R); break; default: break; } } -void DisplayMan::drawSquareD2C(direction dir, int16 posX, int16 posY) { +void DisplayMan::f121_drawSquareD2C(direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; - _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[0]) { case k19_StairsFrontElemType: if (squareAspect[k2_StairsUpAspect]) - drawFloorPitOrStairsBitmap(_g678_stairsNativeBitmapIndex_Up_Front_D2C, g114_FrameStairsUpFront_D2C); + f104_drawFloorPitOrStairsBitmap(_g678_stairsNativeBitmapIndex_Up_Front_D2C, g114_FrameStairsUpFront_D2C); else - drawFloorPitOrStairsBitmap(_g685_stairsNativeBitmapIndex_Down_Front_D2C, g125_FrameStairsDownFront_D2C); + f104_drawFloorPitOrStairsBitmap(_g685_stairsNativeBitmapIndex_Down_Front_D2C, g125_FrameStairsDownFront_D2C); break; case k0_WallElemType: - drawWallSetBitmapWithoutTransparency(_g699_bitmapWallSet_Wall_D2LCR, g163_FrameWalls[k3_ViewSquare_D2C]); - if (isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k8_ViewWall_D2C_FRONT)) { + f101_drawWallSetBitmapWithoutTransparency(_g699_bitmapWallSet_Wall_D2LCR, g163_FrameWalls[k3_ViewSquare_D2C]); + if (f107_isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k8_ViewWall_D2C_FRONT)) { // ... missing code } break; @@ -1356,70 +1356,70 @@ void DisplayMan::drawSquareD2C(direction dir, int16 posX, int16 posY) { break; } } -void DisplayMan::drawSquareD1L(direction dir, int16 posX, int16 posY) { +void DisplayMan::f122_drawSquareD1L(direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; - _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[0]) { case k19_StairsFrontElemType: if (squareAspect[k2_StairsUpAspect]) - drawFloorPitOrStairsBitmap(_g679_stairsNativeBitmapIndex_Up_Front_D1L, g116_FrameStairsUpFront_D1L); + f104_drawFloorPitOrStairsBitmap(_g679_stairsNativeBitmapIndex_Up_Front_D1L, g116_FrameStairsUpFront_D1L); else - drawFloorPitOrStairsBitmap(_g686_stairsNativeBitmapIndex_Down_Front_D1L, g127_FrameStairsDownFront_D1L); + f104_drawFloorPitOrStairsBitmap(_g686_stairsNativeBitmapIndex_Down_Front_D1L, g127_FrameStairsDownFront_D1L); break; case k0_WallElemType: - drawWallSetBitmap(_g700_bitmapWallSet_Wall_D1LCR, g163_FrameWalls[k7_ViewSquare_D1L]); - isDrawnWallOrnAnAlcove(squareAspect[k2_RightWallOrnOrdAspect], k10_ViewWall_D1L_RIGHT); + f100_drawWallSetBitmap(_g700_bitmapWallSet_Wall_D1LCR, g163_FrameWalls[k7_ViewSquare_D1L]); + f107_isDrawnWallOrnAnAlcove(squareAspect[k2_RightWallOrnOrdAspect], k10_ViewWall_D1L_RIGHT); break; case k18_StairsSideElemType: if (squareAspect[k2_StairsUpAspect]) - drawFloorPitOrStairsBitmap(_g690_stairsNativeBitmapIndex_Up_Side_D1L, g134_FrameStairsUpSide_D1L); + f104_drawFloorPitOrStairsBitmap(_g690_stairsNativeBitmapIndex_Up_Side_D1L, g134_FrameStairsUpSide_D1L); else - drawFloorPitOrStairsBitmap(_g691_stairsNativeBitmapIndex_Down_Side_D1L, g136_FrameStairsDownSide_D1L); + f104_drawFloorPitOrStairsBitmap(_g691_stairsNativeBitmapIndex_Down_Side_D1L, g136_FrameStairsDownSide_D1L); break; default: break; } } -void DisplayMan::drawSquareD1R(direction dir, int16 posX, int16 posY) { +void DisplayMan::f123_drawSquareD1R(direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; - _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[0]) { case k19_StairsFrontElemType: if (squareAspect[k2_StairsUpAspect]) - drawFloorPitOrStairsBitmapFlippedHorizontally(_g679_stairsNativeBitmapIndex_Up_Front_D1L, g118_FrameStairsUpFront_D1R); + f105_drawFloorPitOrStairsBitmapFlippedHorizontally(_g679_stairsNativeBitmapIndex_Up_Front_D1L, g118_FrameStairsUpFront_D1R); else - drawFloorPitOrStairsBitmapFlippedHorizontally(_g686_stairsNativeBitmapIndex_Down_Front_D1L, g129_FrameStairsDownFront_D1R); + f105_drawFloorPitOrStairsBitmapFlippedHorizontally(_g686_stairsNativeBitmapIndex_Down_Front_D1L, g129_FrameStairsDownFront_D1R); break; case k0_WallElemType: - drawWallSetBitmap(_g700_bitmapWallSet_Wall_D1LCR, g163_FrameWalls[k8_ViewSquare_D1R]); - isDrawnWallOrnAnAlcove(squareAspect[k4_LeftWallOrnOrdAspect], k11_ViewWall_D1R_LEFT); + f100_drawWallSetBitmap(_g700_bitmapWallSet_Wall_D1LCR, g163_FrameWalls[k8_ViewSquare_D1R]); + f107_isDrawnWallOrnAnAlcove(squareAspect[k4_LeftWallOrnOrdAspect], k11_ViewWall_D1R_LEFT); break; case k18_StairsSideElemType: if (squareAspect[k2_StairsUpAspect]) - drawFloorPitOrStairsBitmapFlippedHorizontally(_g690_stairsNativeBitmapIndex_Up_Side_D1L, g135_FrameStairsUpSide_D1R); + f105_drawFloorPitOrStairsBitmapFlippedHorizontally(_g690_stairsNativeBitmapIndex_Up_Side_D1L, g135_FrameStairsUpSide_D1R); else - drawFloorPitOrStairsBitmapFlippedHorizontally(_g691_stairsNativeBitmapIndex_Down_Side_D1L, g137_FrameStairsDownSide_D1R); + f105_drawFloorPitOrStairsBitmapFlippedHorizontally(_g691_stairsNativeBitmapIndex_Down_Side_D1L, g137_FrameStairsDownSide_D1R); break; default: break; } } -void DisplayMan::drawSquareD1C(direction dir, int16 posX, int16 posY) { +void DisplayMan::f124_drawSquareD1C(direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; - _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[0]) { case k19_StairsFrontElemType: if (squareAspect[k2_StairsUpAspect]) - drawFloorPitOrStairsBitmap(_g680_stairsNativeBitmapIndex_Up_Front_D1C, g117_FrameStairsUpFront_D1C); + f104_drawFloorPitOrStairsBitmap(_g680_stairsNativeBitmapIndex_Up_Front_D1C, g117_FrameStairsUpFront_D1C); else - drawFloorPitOrStairsBitmap(_g687_stairsNativeBitmapIndex_Down_Front_D1C, g128_FrameStairsDownFront_D1C); + f104_drawFloorPitOrStairsBitmap(_g687_stairsNativeBitmapIndex_Down_Front_D1C, g128_FrameStairsDownFront_D1C); break; case k0_WallElemType: _vm->_dungeonMan->_g286_isFacingAlcove = false; _vm->_dungeonMan->_g287_isFacingViAltar = false; _vm->_dungeonMan->_g288_isFacingFountain = false; - drawWallSetBitmapWithoutTransparency(_g700_bitmapWallSet_Wall_D1LCR, g163_FrameWalls[k6_ViewSquare_D1C]); - if (isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k12_ViewWall_D1C_FRONT)) { + f101_drawWallSetBitmapWithoutTransparency(_g700_bitmapWallSet_Wall_D1LCR, g163_FrameWalls[k6_ViewSquare_D1C]); + if (f107_isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k12_ViewWall_D1C_FRONT)) { // .... code not yet implemneted } break; @@ -1428,49 +1428,49 @@ void DisplayMan::drawSquareD1C(direction dir, int16 posX, int16 posY) { } } -void DisplayMan::drawSquareD0L(direction dir, int16 posX, int16 posY) { +void DisplayMan::f125_drawSquareD0L(direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; - _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[0]) { case k18_StairsSideElemType: if (squareAspect[k2_StairsUpAspect]) - drawFloorPitOrStairsBitmap(_g692_stairsNativeBitmapIndex_Side_D0L, g138_FrameStairsSide_D0L); + f104_drawFloorPitOrStairsBitmap(_g692_stairsNativeBitmapIndex_Side_D0L, g138_FrameStairsSide_D0L); break; case k0_WallElemType: - drawWallSetBitmap(_g701_bitmapWallSet_Wall_D0L, g163_FrameWalls[k10_ViewSquare_D0L]); + f100_drawWallSetBitmap(_g701_bitmapWallSet_Wall_D0L, g163_FrameWalls[k10_ViewSquare_D0L]); break; default: break; } } -void DisplayMan::drawSquareD0R(direction dir, int16 posX, int16 posY) { +void DisplayMan::f126_drawSquareD0R(direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; - _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[0]) { case k18_StairsSideElemType: if (squareAspect[k2_StairsUpAspect]) - drawFloorPitOrStairsBitmapFlippedHorizontally(_g692_stairsNativeBitmapIndex_Side_D0L, g139_FrameStairsSide_D0R); + f105_drawFloorPitOrStairsBitmapFlippedHorizontally(_g692_stairsNativeBitmapIndex_Side_D0L, g139_FrameStairsSide_D0R); return; case k0_WallElemType: - drawWallSetBitmap(_g702_bitmapWallSet_Wall_D0R, g163_FrameWalls[k11_ViewSquare_D0R]); + f100_drawWallSetBitmap(_g702_bitmapWallSet_Wall_D0R, g163_FrameWalls[k11_ViewSquare_D0R]); break; default: break; } } -void DisplayMan::drawSquareD0C(direction dir, int16 posX, int16 posY) { +void DisplayMan::f127_drawSquareD0C(direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; - _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); + _vm->_dungeonMan->f172_setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[0]) { case k19_StairsFrontElemType: if (squareAspect[k2_StairsUpAspect]) { - drawFloorPitOrStairsBitmap(_g681_stairsNativeBitmapIndex_Up_Front_D0C_Left, g119_FrameStairsUpFront_D0L); - drawFloorPitOrStairsBitmapFlippedHorizontally(_g681_stairsNativeBitmapIndex_Up_Front_D0C_Left, g120_FrameStairsUpFront_D0R); + f104_drawFloorPitOrStairsBitmap(_g681_stairsNativeBitmapIndex_Up_Front_D0C_Left, g119_FrameStairsUpFront_D0L); + f105_drawFloorPitOrStairsBitmapFlippedHorizontally(_g681_stairsNativeBitmapIndex_Up_Front_D0C_Left, g120_FrameStairsUpFront_D0R); } else { - drawFloorPitOrStairsBitmap(_g688_stairsNativeBitmapIndex_Down_Front_D0C_Left, g130_FrameStairsDownFront_D0L); - drawFloorPitOrStairsBitmapFlippedHorizontally(_g688_stairsNativeBitmapIndex_Down_Front_D0C_Left, g131_FrameStairsDownFront_D0R); + f104_drawFloorPitOrStairsBitmap(_g688_stairsNativeBitmapIndex_Down_Front_D0C_Left, g130_FrameStairsDownFront_D0L); + f105_drawFloorPitOrStairsBitmapFlippedHorizontally(_g688_stairsNativeBitmapIndex_Down_Front_D0C_Left, g131_FrameStairsDownFront_D0R); } break; default: @@ -1478,7 +1478,7 @@ void DisplayMan::drawSquareD0C(direction dir, int16 posX, int16 posY) { } } -void DisplayMan::drawDungeon(direction dir, int16 posX, int16 posY) { +void DisplayMan::f128_drawDungeon(direction dir, int16 posX, int16 posY) { loadPalette(g20_PalEntrance); // TODO: this is a global variable, set from here bool flippedFloorCeiling = true; @@ -1492,9 +1492,9 @@ void DisplayMan::drawDungeon(direction dir, int16 posX, int16 posY) { } if (_g76_useFlippedWallAndFootprintsBitmap = (posX + posY + dir) & 1) { - drawWallSetBitmap(_g85_bitmapCeiling, gK12_CeilingFrame); + f100_drawWallSetBitmap(_g85_bitmapCeiling, gK12_CeilingFrame); f99_copyBitmapAndFlipHorizontal(_g84_bitmapFloor, _g74_tmpBitmap, k112_byteWidthViewport * 2, 70); - drawWallSetBitmap(_g74_tmpBitmap, gK13_FloorFrame); + f100_drawWallSetBitmap(_g74_tmpBitmap, gK13_FloorFrame); if (flippedFloorCeiling) { _g698_bitmapWallSet_Wall_D3LCR = _g90_bitmapWall_D3LCR_Flipped; @@ -1505,49 +1505,49 @@ void DisplayMan::drawDungeon(direction dir, int16 posX, int16 posY) { } } else { f99_copyBitmapAndFlipHorizontal(_g85_bitmapCeiling, _g74_tmpBitmap, k112_byteWidthViewport * 2, 29); - drawWallSetBitmap(_g74_tmpBitmap, gK12_CeilingFrame); - drawWallSetBitmap(_g84_bitmapFloor, gK13_FloorFrame); + f100_drawWallSetBitmap(_g74_tmpBitmap, gK12_CeilingFrame); + f100_drawWallSetBitmap(_g84_bitmapFloor, gK13_FloorFrame); } - if (_vm->_dungeonMan->getRelSquareType(dir, 3, -2, posX, posY) == k0_WallElemType) - drawWallSetBitmap(_g697_bitmapWallSet_Wall_D3L2, g711_FrameWall_D3L2); - if (_vm->_dungeonMan->getRelSquareType(dir, 3, 2, posX, posY) == k0_WallElemType) - drawWallSetBitmap(_g696_bitmapWallSet_Wall_D3R2, g712_FrameWall_D3R2); + if (_vm->_dungeonMan->f153_getRelSquareType(dir, 3, -2, posX, posY) == k0_WallElemType) + f100_drawWallSetBitmap(_g697_bitmapWallSet_Wall_D3L2, g711_FrameWall_D3L2); + if (_vm->_dungeonMan->f153_getRelSquareType(dir, 3, 2, posX, posY) == k0_WallElemType) + f100_drawWallSetBitmap(_g696_bitmapWallSet_Wall_D3R2, g712_FrameWall_D3R2); int16 tmpPosX = posX, tmpPosY = posY; - _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 3, -1, tmpPosX, tmpPosY); - drawSquareD3L(dir, tmpPosX, tmpPosY); + _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 3, -1, tmpPosX, tmpPosY); + f116_drawSquareD3L(dir, tmpPosX, tmpPosY); tmpPosX = posX, tmpPosY = posY; - _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 3, 1, tmpPosX, tmpPosY); - drawSquareD3R(dir, tmpPosX, tmpPosY); + _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 3, 1, tmpPosX, tmpPosY); + f117_drawSquareD3R(dir, tmpPosX, tmpPosY); tmpPosX = posX, tmpPosY = posY; - _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 3, 0, tmpPosX, tmpPosY); - drawSquareD3C(dir, tmpPosX, tmpPosY); + _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 3, 0, tmpPosX, tmpPosY); + f118_drawSquareD3C(dir, tmpPosX, tmpPosY); tmpPosX = posX, tmpPosY = posY; - _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 2, -1, tmpPosX, tmpPosY); - drawSquareD2L(dir, tmpPosX, tmpPosY); + _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 2, -1, tmpPosX, tmpPosY); + f119_drawSquareD2L(dir, tmpPosX, tmpPosY); tmpPosX = posX, tmpPosY = posY; - _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 2, 1, tmpPosX, tmpPosY); - drawSquareD2R(dir, tmpPosX, tmpPosY); + _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 2, 1, tmpPosX, tmpPosY); + f120_drawSquareD2R(dir, tmpPosX, tmpPosY); tmpPosX = posX, tmpPosY = posY; - _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 2, 0, tmpPosX, tmpPosY); - drawSquareD2C(dir, tmpPosX, tmpPosY); + _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 2, 0, tmpPosX, tmpPosY); + f121_drawSquareD2C(dir, tmpPosX, tmpPosY); tmpPosX = posX, tmpPosY = posY; - _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 1, -1, tmpPosX, tmpPosY); - drawSquareD1L(dir, tmpPosX, tmpPosY); + _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 1, -1, tmpPosX, tmpPosY); + f122_drawSquareD1L(dir, tmpPosX, tmpPosY); tmpPosX = posX, tmpPosY = posY; - _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 1, 1, tmpPosX, tmpPosY); - drawSquareD1R(dir, tmpPosX, tmpPosY); + _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 1, 1, tmpPosX, tmpPosY); + f123_drawSquareD1R(dir, tmpPosX, tmpPosY); tmpPosX = posX, tmpPosY = posY; - _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 1, 0, tmpPosX, tmpPosY); - drawSquareD1C(dir, tmpPosX, tmpPosY); + _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 1, 0, tmpPosX, tmpPosY); + f124_drawSquareD1C(dir, tmpPosX, tmpPosY); tmpPosX = posX, tmpPosY = posY; - _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 0, -1, tmpPosX, tmpPosY); - drawSquareD0L(dir, tmpPosX, tmpPosY); + _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 0, -1, tmpPosX, tmpPosY); + f125_drawSquareD0L(dir, tmpPosX, tmpPosY); tmpPosX = posX, tmpPosY = posY; - _vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 0, 1, tmpPosX, tmpPosY); - drawSquareD0R(dir, tmpPosX, tmpPosY); - drawSquareD0C(dir, posX, posY); + _vm->_dungeonMan->f150_mapCoordsAfterRelMovement(dir, 0, 1, tmpPosX, tmpPosY); + f126_drawSquareD0R(dir, tmpPosX, tmpPosY); + f127_drawSquareD0C(dir, posX, posY); if (flippedFloorCeiling) { _g698_bitmapWallSet_Wall_D3LCR = _g95_bitmapWall_D3LCR_Native; @@ -1569,12 +1569,12 @@ void DisplayMan::f134_fillBitmap(byte *bitmap, uint16 width, uint16 height, Colo } // NOTE: has been screened for missing code -void DisplayMan::loadFloorSet(FloorSet set) { +void DisplayMan::f94_loadFloorSet(FloorSet set) { if (_g230_currentFloorSet != set) { _g230_currentFloorSet = set; int16 index = (set * k2_FloorSetGraphicCount) + k75_FirstFloorSet; - loadIntoBitmap(index, _g84_bitmapFloor); - loadIntoBitmap(index + 1, _g85_bitmapCeiling); + f466_loadIntoBitmap(index, _g84_bitmapFloor); + f466_loadIntoBitmap(index + 1, _g85_bitmapCeiling); } } @@ -1582,25 +1582,25 @@ Box g161_BoxWallBitmap_D3LCR = Box(0, 115, 0, 50); // @ G0161_s_Graphic558_Box_W Box g162_BoxWallBitmap_D2LCR = Box(0, 135, 0, 70); // @ G0162_s_Graphic558_Box_WallBitmap_D2LCR // Note: has been screened for missing code -void DisplayMan::loadWallSet(WallSet set) { +void DisplayMan::f95_loadWallSet(WallSet set) { if ((_g231_currentWallSet != set) || _vm->_g523_restartGameRequest) { _g231_currentWallSet = set; { int16 graphicIndice = (set * k13_WallSetGraphicCount) + k77_FirstWallSet; - loadIntoBitmap(graphicIndice++, _g709_bitmapWallSet_DoorFrameFront); - loadIntoBitmap(graphicIndice++, _g708_bitmapWallSet_DoorFrameLeft_D1C); - loadIntoBitmap(graphicIndice++, _g707_bitmapWallSet_DoorFrameLeft_D2C); - loadIntoBitmap(graphicIndice++, _g706_bitmapWallSet_DoorFrameLeft_D3C); - loadIntoBitmap(graphicIndice++, _g705_bitmapWallSet_DoorFrameLeft_D3L); - loadIntoBitmap(graphicIndice++, _g704_bitmapWallSet_DoorFrameTop_D1LCR); - loadIntoBitmap(graphicIndice++, _g703_bitmapWallSet_DoorFrameTop_D2LCR); - loadIntoBitmap(graphicIndice++, _g702_bitmapWallSet_Wall_D0R); - loadIntoBitmap(graphicIndice++, _g701_bitmapWallSet_Wall_D0L); - loadIntoBitmap(graphicIndice++, _g700_bitmapWallSet_Wall_D1LCR); - loadIntoBitmap(graphicIndice++, _g699_bitmapWallSet_Wall_D2LCR); - loadIntoBitmap(graphicIndice++, _g698_bitmapWallSet_Wall_D3LCR); - loadIntoBitmap(graphicIndice++, _g697_bitmapWallSet_Wall_D3L2); + f466_loadIntoBitmap(graphicIndice++, _g709_bitmapWallSet_DoorFrameFront); + f466_loadIntoBitmap(graphicIndice++, _g708_bitmapWallSet_DoorFrameLeft_D1C); + f466_loadIntoBitmap(graphicIndice++, _g707_bitmapWallSet_DoorFrameLeft_D2C); + f466_loadIntoBitmap(graphicIndice++, _g706_bitmapWallSet_DoorFrameLeft_D3C); + f466_loadIntoBitmap(graphicIndice++, _g705_bitmapWallSet_DoorFrameLeft_D3L); + f466_loadIntoBitmap(graphicIndice++, _g704_bitmapWallSet_DoorFrameTop_D1LCR); + f466_loadIntoBitmap(graphicIndice++, _g703_bitmapWallSet_DoorFrameTop_D2LCR); + f466_loadIntoBitmap(graphicIndice++, _g702_bitmapWallSet_Wall_D0R); + f466_loadIntoBitmap(graphicIndice++, _g701_bitmapWallSet_Wall_D0L); + f466_loadIntoBitmap(graphicIndice++, _g700_bitmapWallSet_Wall_D1LCR); + f466_loadIntoBitmap(graphicIndice++, _g699_bitmapWallSet_Wall_D2LCR); + f466_loadIntoBitmap(graphicIndice++, _g698_bitmapWallSet_Wall_D3LCR); + f466_loadIntoBitmap(graphicIndice++, _g697_bitmapWallSet_Wall_D3L2); } f99_copyBitmapAndFlipHorizontal(_g708_bitmapWallSet_DoorFrameLeft_D1C, _g710_bitmapWallSet_DoorFrameRight_D1C, g171_Frame_DoorFrameRight_D1C._srcWidth, g171_Frame_DoorFrameRight_D1C._srcHeight); @@ -1610,9 +1610,9 @@ void DisplayMan::loadWallSet(WallSet set) { } -void DisplayMan::loadCurrentMapGraphics() { - loadFloorSet(_vm->_dungeonMan->_g269_currMap->_floorSet); - loadWallSet(_vm->_dungeonMan->_g269_currMap->_wallSet); +void DisplayMan::f96_loadCurrentMapGraphics() { + f94_loadFloorSet(_vm->_dungeonMan->_g269_currMap->_floorSet); + f95_loadWallSet(_vm->_dungeonMan->_g269_currMap->_wallSet); { _g74_tmpBitmap = new byte[_screenWidth * _screenHeight]; @@ -1621,12 +1621,12 @@ void DisplayMan::loadCurrentMapGraphics() { f99_copyBitmapAndFlipHorizontal(_g95_bitmapWall_D3LCR_Native = _g698_bitmapWallSet_Wall_D3LCR, _g74_tmpBitmap, g163_FrameWalls[k0_ViewSquare_D3C]._srcWidth, g163_FrameWalls[k0_ViewSquare_D3C]._srcHeight); f134_fillBitmap(_g90_bitmapWall_D3LCR_Flipped, 128, 51, k10_ColorFlesh); - blitToBitmap(_g74_tmpBitmap, 128, 11, 0, _g90_bitmapWall_D3LCR_Flipped, 128, g161_BoxWallBitmap_D3LCR, k255_ColorNoTransparency); + f132_blitToBitmap(_g74_tmpBitmap, 128, 11, 0, _g90_bitmapWall_D3LCR_Flipped, 128, g161_BoxWallBitmap_D3LCR, k255_ColorNoTransparency); f99_copyBitmapAndFlipHorizontal(_g96_bitmapWall_D2LCR_Native = _g699_bitmapWallSet_Wall_D2LCR, _g74_tmpBitmap, g163_FrameWalls[k3_ViewSquare_D2C]._srcWidth, g163_FrameWalls[k3_ViewSquare_D2C]._srcHeight); f134_fillBitmap(_g91_bitmapWall_D2LCR_Flipped, 144, 71, k10_ColorFlesh); - blitToBitmap(_g74_tmpBitmap, 144, 8, 0, _g91_bitmapWall_D2LCR_Flipped, 144, g162_BoxWallBitmap_D2LCR, k255_ColorNoTransparency); + f132_blitToBitmap(_g74_tmpBitmap, 144, 8, 0, _g91_bitmapWall_D2LCR_Flipped, 144, g162_BoxWallBitmap_D2LCR, k255_ColorNoTransparency); f99_copyBitmapAndFlipHorizontal(_g97_bitmapWall_D1LCR_Native = _g700_bitmapWallSet_Wall_D1LCR, _g92_bitmapWall_D1LCR_Flipped, g163_FrameWalls[k6_ViewSquare_D1C]._srcWidth, g163_FrameWalls[k6_ViewSquare_D1C]._srcHeight); @@ -1707,23 +1707,23 @@ void DisplayMan::loadCurrentMapGraphics() { _g103_currMapDoorOrnInfo[i][k1_CoordinateSet] = g196_DoorOrnCoordIndices[ornIndice]; } - applyCreatureReplColors(9, 8); - applyCreatureReplColors(10, 12); + f93_applyCreatureReplColors(9, 8); + f93_applyCreatureReplColors(10, 12); for (uint16 creatureType = 0; creatureType < currMap._creatureTypeCount; ++creatureType) { CreatureAspect &aspect = g219_CreatureAspects[_g264_currMapAllowedCreatureTypes[creatureType]]; uint16 replColorOrdinal = aspect.getReplColour9(); if (replColorOrdinal) - applyCreatureReplColors(9, _vm->ordinalToIndex(replColorOrdinal)); + f93_applyCreatureReplColors(9, _vm->M1_ordinalToIndex(replColorOrdinal)); replColorOrdinal = aspect.getReplColour10(); if (replColorOrdinal) - applyCreatureReplColors(10, _vm->ordinalToIndex(replColorOrdinal)); + f93_applyCreatureReplColors(10, _vm->M1_ordinalToIndex(replColorOrdinal)); } _g342_refreshDungeonViewPaleteRequested = true; } -void DisplayMan::applyCreatureReplColors(int replacedColor, int replacementColor) { +void DisplayMan::f93_applyCreatureReplColors(int replacedColor, int replacementColor) { for (int16 i = 0; i < 6; ++i) g21_PalDungeonView[i][replacedColor] = g220_CreatureReplColorSets[replacementColor]._RGBColor[i]; @@ -1731,15 +1731,15 @@ void DisplayMan::applyCreatureReplColors(int replacedColor, int replacementColor g221_PalChangesCreature_D3[replacedColor] = g220_CreatureReplColorSets[replacementColor]._D3ReplacementColor; } -void DisplayMan::drawFloorPitOrStairsBitmap(uint16 nativeIndex, Frame &f) { +void DisplayMan::f104_drawFloorPitOrStairsBitmap(uint16 nativeIndex, Frame &f) { if (f._srcWidth) - blitToBitmap(_bitmaps[nativeIndex], f._srcWidth, f._srcX, f._srcY, _g296_bitmapViewport, k112_byteWidthViewport * 2, f._box, k10_ColorFlesh); + f132_blitToBitmap(_bitmaps[nativeIndex], f._srcWidth, f._srcX, f._srcY, _g296_bitmapViewport, k112_byteWidthViewport * 2, f._box, k10_ColorFlesh); } -void DisplayMan::drawFloorPitOrStairsBitmapFlippedHorizontally(uint16 nativeIndex, Frame &f) { +void DisplayMan::f105_drawFloorPitOrStairsBitmapFlippedHorizontally(uint16 nativeIndex, Frame &f) { if (f._srcWidth) { - f99_copyBitmapAndFlipHorizontal(getBitmap(nativeIndex), _g74_tmpBitmap, f._srcWidth, f._srcHeight); - blitToBitmap(_g74_tmpBitmap, f._srcWidth, f._srcX, f._srcY, _g296_bitmapViewport, k112_byteWidthViewport * 2, f._box, k10_ColorFlesh); + f99_copyBitmapAndFlipHorizontal(f489_getBitmap(nativeIndex), _g74_tmpBitmap, f._srcWidth, f._srcHeight); + f132_blitToBitmap(_g74_tmpBitmap, f._srcWidth, f._srcX, f._srcY, _g296_bitmapViewport, k112_byteWidthViewport * 2, f._box, k10_ColorFlesh); } } @@ -1777,7 +1777,7 @@ byte g204_UnreadableInscriptionBoxY2[15] = { // @ G0204_auc_Graphic558_Unreadabl Box g109_BoxChampionPortraitOnWall = Box(96, 127, 35, 63); // G0109_s_Graphic558_Box_ChampionPortraitOnWall -bool DisplayMan::isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex) { +bool DisplayMan::f107_isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex) { byte *bitmapGreen; byte *bitmapRed; int16 coordinateSetOffset; @@ -1794,17 +1794,17 @@ bool DisplayMan::isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex int16 nativeBitmapIndex = _g101_currMapWallOrnInfo[wallOrnIndex][k0_NativeBitmapIndex]; uint16 *coordinateSetA = g205_WallOrnCoordSets[_g101_currMapWallOrnInfo[wallOrnIndex][k1_CoordinateSet]][viewWallIndex]; - isAlcove = _vm->_dungeonMan->isWallOrnAnAlcove(wallOrnIndex); + isAlcove = _vm->_dungeonMan->f149_isWallOrnAnAlcove(wallOrnIndex); isInscription = (wallOrnIndex == _vm->_dungeonMan->_g265_currMapInscriptionWallOrnIndex); if (isInscription) { - _vm->_dungeonMan->decodeText((char*)inscriptionString, _g290_inscriptionThing, k0_TextTypeInscription); + _vm->_dungeonMan->f168_decodeText((char*)inscriptionString, _g290_inscriptionThing, k0_TextTypeInscription); } if (viewWallIndex >= k10_ViewWall_D1L_RIGHT) { if (viewWallIndex == k12_ViewWall_D1C_FRONT) { if (isInscription) { Frame &D1CFrame = g163_FrameWalls[k6_ViewSquare_D1C]; - blitToBitmap(_g700_bitmapWallSet_Wall_D1LCR, D1CFrame._srcWidth, 94, 28, _g296_bitmapViewport, k112_byteWidthViewport * 2, + f132_blitToBitmap(_g700_bitmapWallSet_Wall_D1LCR, D1CFrame._srcWidth, 94, 28, _g296_bitmapViewport, k112_byteWidthViewport * 2, g202_BoxWallPatchBehindInscription, k255_ColorNoTransparency); unsigned char *string = inscriptionString; @@ -1819,7 +1819,7 @@ bool DisplayMan::isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex frame._box._x2 = (frame._box._x1 = 112 - (characterCount * 4)) + 7; frame._box._y1 = (frame._box._y2 = g203_InscriptionLineY[textLineIndex++]) - 7; while (characterCount--) { - blitToBitmap(bitmapRed, 288, (*string++) * 8, 0, _g296_bitmapViewport, k112_byteWidthViewport * 2, frame._box, k10_ColorFlesh); + f132_blitToBitmap(bitmapRed, 288, (*string++) * 8, 0, _g296_bitmapViewport, k112_byteWidthViewport * 2, frame._box, k10_ColorFlesh); frame._box._x1 += 8; frame._box._x2 += 8; } @@ -1868,7 +1868,7 @@ bool DisplayMan::isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex } } int16 pixelWidth = (coordinateSetA + coordinateSetOffset)[1] - (coordinateSetA + coordinateSetOffset)[0]; - blitToBitmapShrinkWithPalChange(_bitmaps[nativeBitmapIndex], coordSetB[4] << 1, coordSetB[5], _g74_tmpBitmap, pixelWidth + 1, coordinateSetA[5], + f129_blitToBitmapShrinkWithPalChange(_bitmaps[nativeBitmapIndex], coordSetB[4] << 1, coordSetB[5], _g74_tmpBitmap, pixelWidth + 1, coordinateSetA[5], (viewWallIndex <= k4_ViewWall_D3R_FRONT) ? g198_PalChangesDoorButtonAndWallOrn_D3 : g199_PalChangesDoorButtonAndWallOrn_D2); bitmapGreen = _bitmaps[nativeBitmapIndex]; var_X = pixelWidth; @@ -1905,11 +1905,11 @@ bool DisplayMan::isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex coordinateSetA[3] = g204_UnreadableInscriptionBoxY2[g190_WallOrnDerivedBitmapIndexIncrement[viewWallIndex] * 3 + unreadableTextLineCount - 1]; } } - blitToBitmap(bitmapGreen, coordinateSetA[4], var_X, 0, _g296_bitmapViewport, k112_byteWidthViewport * 2, *(Box*)coordinateSetA, k10_ColorFlesh); + f132_blitToBitmap(bitmapGreen, coordinateSetA[4], var_X, 0, _g296_bitmapViewport, k112_byteWidthViewport * 2, *(Box*)coordinateSetA, k10_ColorFlesh); if ((viewWallIndex == k12_ViewWall_D1C_FRONT) && _g289_championPortraitOrdinal--) { Box &box = g109_BoxChampionPortraitOnWall; - blitToBitmap(_bitmaps[k26_ChampionPortraitsIndice], 256, (_g289_championPortraitOrdinal & 0x7) << 5, (_g289_championPortraitOrdinal >> 3) * 29, + f132_blitToBitmap(_bitmaps[k26_ChampionPortraitsIndice], 256, (_g289_championPortraitOrdinal & 0x7) << 5, (_g289_championPortraitOrdinal >> 3) * 29, _g296_bitmapViewport, k112_byteWidthViewport * 2, box, k1_ColorDarkGary); } return isAlcove; @@ -1918,7 +1918,7 @@ bool DisplayMan::isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex } -void DisplayMan::blitToBitmapShrinkWithPalChange(byte *srcBitmap, int16 srcWidth, int16 srcHeight, byte *destBitmap, int16 destWidth, int16 destHeight, byte *palChange) { +void DisplayMan::f129_blitToBitmapShrinkWithPalChange(byte *srcBitmap, int16 srcWidth, int16 srcHeight, byte *destBitmap, int16 destWidth, int16 destHeight, byte *palChange) { double rateW = srcWidth / destWidth; double rateH = srcHeight / destHeight; @@ -1933,7 +1933,7 @@ void DisplayMan::blitToBitmapShrinkWithPalChange(byte *srcBitmap, int16 srcWidth } -byte* DisplayMan::getBitmap(uint16 index) { +byte* DisplayMan::f489_getBitmap(uint16 index) { return _bitmaps[index]; } @@ -1950,7 +1950,7 @@ uint32 DisplayMan::getCompressedDataSize(uint16 index) { #define kMaskFieldAspectIndex 0x007F // @ MASK0x007F_MASK_INDEX #define kMaskFieldAspectNoMask 255 // @ C255_NO_MASK -void DisplayMan::drawField(FieldAspect* fieldAspect, Box& box) { +void DisplayMan::f113_drawField(FieldAspect* fieldAspect, Box& box) { DisplayMan &dispMan = *_vm->_displayMan; byte *bitmapMask; @@ -1958,24 +1958,24 @@ void DisplayMan::drawField(FieldAspect* fieldAspect, Box& box) { bitmapMask = nullptr; } else { bitmapMask = dispMan._g74_tmpBitmap; - memmove(bitmapMask, dispMan.getBitmap(k69_FieldMask_D3R_GraphicIndice + getFlag(fieldAspect->_mask, kMaskFieldAspectIndex)), + memmove(bitmapMask, dispMan.f489_getBitmap(k69_FieldMask_D3R_GraphicIndice + getFlag(fieldAspect->_mask, kMaskFieldAspectIndex)), fieldAspect->_height * fieldAspect->_pixelWidth * sizeof(bitmapMask[0])); if (getFlag(fieldAspect->_mask, kMaskFieldAspectFlipMask)) { - dispMan.flipBitmapHorizontal(bitmapMask, fieldAspect->_pixelWidth, fieldAspect->_height); + dispMan.f103_flipBitmapHorizontal(bitmapMask, fieldAspect->_pixelWidth, fieldAspect->_height); } } - byte *bitmap = dispMan.getBitmap(k73_FieldTeleporterGraphicIndice + fieldAspect->_nativeBitmapRelativeIndex); + byte *bitmap = dispMan.f489_getBitmap(k73_FieldTeleporterGraphicIndice + fieldAspect->_nativeBitmapRelativeIndex); warning("MISSING CODE: F0133_VIDEO_BlitBoxFilledWithMaskedBitmap"); warning("IGNORED CODE: F0491_CACHE_IsDerivedBitmapInCache, F0493_CACHE_AddDerivedBitmap, F0480_CACHE_ReleaseBlock"); } -int16 DisplayMan::getScaledBitmapPixelCount(int16 pixelWidth, int16 pixelHeight, int16 scale) { - return getScaledDimension(pixelWidth, scale) * getScaledDimension(pixelHeight, scale); +int16 DisplayMan::f459_getScaledBitmapPixelCount(int16 pixelWidth, int16 pixelHeight, int16 scale) { + return M78_getScaledDimension(pixelWidth, scale) * M78_getScaledDimension(pixelHeight, scale); } -int16 DisplayMan::getScaledDimension(int16 dimension, int16 scale) { +int16 DisplayMan::M78_getScaledDimension(int16 dimension, int16 scale) { return (dimension * scale + scale / 2) / 32; } @@ -2135,7 +2135,7 @@ int16 g225_CenteredExplosionCoordinates[15][2] = { // @ G0225_aai_Graphic558_Cen #define k0x0080_BlitDoNotUseMask 0x0080 // @ MASK0x0080_DO_NOT_USE_MASK -void DisplayMan::cthulhu(Thing thingParam, direction directionParam, int16 mapXpos, +void DisplayMan::f115_cthulhu(Thing thingParam, direction directionParam, int16 mapXpos, int16 mapYpos, int16 viewSquareIndex, uint16 orderedViewCellOrdinals) { DungeonMan &dunMan = *_vm->_dungeonMan; @@ -2276,7 +2276,7 @@ creatures are drawn in the right order and so that Fluxcages are not drawn twice cellYellowBear = returnOppositeDir(directionParam); /* Alcove is on the opposite direction of the viewing direction */ objectShiftIndex = 2; } else { - AL_2_viewCell = _vm->ordinalToIndex((int16)remainingViewCellOrdinalsToProcess & 0x000F); /* View cell is the index of coordinates to draw object */ + AL_2_viewCell = _vm->M1_ordinalToIndex((int16)remainingViewCellOrdinalsToProcess & 0x000F); /* View cell is the index of coordinates to draw object */ currentViewCellToDraw = AL_2_viewCell; remainingViewCellOrdinalsToProcess >>= 4; /* Proceed to the next cell ordinal */ cellCounter++; @@ -2304,7 +2304,7 @@ creatures are drawn in the right order and so that Fluxcages are not drawn twice /* Square where objects are visible and object is located on cell being processed */ if ((viewSquareIndex >= k0_ViewSquare_D3C) && (viewSquareIndex <= k9_ViewSquare_D0C) && (thingParam.getCell() == cellYellowBear)) { - objectAspect = &(g209_ObjectAspects[g237_ObjectInfo[dunMan.getObjectInfoIndex(thingParam)]._objectAspectIndex]); + objectAspect = &(g209_ObjectAspects[g237_ObjectInfo[dunMan.f141_getObjectInfoIndex(thingParam)]._objectAspectIndex]); AL_4_nativeBitmapIndex = k360_FirstObjectGraphicIndice + objectAspect->_firstNativeBitmapRelativeIndex; if (useAlcoveObjectImage = (drawAlcoveObjects && getFlag(objectAspect->_graphicInfo, k0x0010_ObjectAlcoveMask) && !viewLane)) { AL_4_nativeBitmapIndex++; @@ -2324,12 +2324,12 @@ T0115015_DrawProjectileAsObject: /* If object is in the center lane (only D0C or D1C with condition above) and is not a projectile */ drawingGrabbableObject = (!viewLane && !drawProjectileAsObject); AL_8_shiftSetIndex = k0_ShiftSet_D0BackD1Front; - AL_6_bitmapRedBanana = getBitmap(AL_4_nativeBitmapIndex); /* Use base graphic, no resizing */ + AL_6_bitmapRedBanana = f489_getBitmap(AL_4_nativeBitmapIndex); /* Use base graphic, no resizing */ byteWidth = objectAspect->_width; heightRedEagle = objectAspect->_height; if (flipHorizontal) { memmove(_g74_tmpBitmap, AL_6_bitmapRedBanana, byteWidth * heightRedEagle * sizeof(byte)); - flipBitmapHorizontal(_g74_tmpBitmap, byteWidth, heightRedEagle); + f103_flipBitmapHorizontal(_g74_tmpBitmap, byteWidth, heightRedEagle); AL_6_bitmapRedBanana = _g74_tmpBitmap; } } else { @@ -2338,13 +2338,13 @@ T0115015_DrawProjectileAsObject: if ((viewSquareIndex >= k6_ViewSquare_D1C) || ((viewSquareIndex >= k3_ViewSquare_D2C) && (AL_2_viewCell >= k2_ViewCellBackRight))) { derivedBitmapIndex++; AL_8_shiftSetIndex = k1_ShiftSet_D1BackD2Front; - byteWidth = getScaledDimension(objectAspect->_width, k20_Scale_D2); - heightRedEagle = getScaledDimension(objectAspect->_height, k20_Scale_D2); + byteWidth = M78_getScaledDimension(objectAspect->_width, k20_Scale_D2); + heightRedEagle = M78_getScaledDimension(objectAspect->_height, k20_Scale_D2); paletteChanges = g214_PalChangesFloorOrn_D2; } else { AL_8_shiftSetIndex = k2_ShiftSet_D2BackD3Front; - byteWidth = getScaledDimension(objectAspect->_width, k16_Scale_D3); - heightRedEagle = getScaledDimension(objectAspect->_height, k16_Scale_D3); + byteWidth = M78_getScaledDimension(objectAspect->_width, k16_Scale_D3); + heightRedEagle = M78_getScaledDimension(objectAspect->_height, k16_Scale_D3); paletteChanges = g213_PalChangesFloorOrn_D3; } if (flipHorizontal) { @@ -2354,14 +2354,14 @@ T0115015_DrawProjectileAsObject: derivedBitmapIndex += 4; } - if (isDerivedBitmapInCache(derivedBitmapIndex)) { - AL_6_bitmapRedBanana = getDerivedBitmap(derivedBitmapIndex); + if (f491_isDerivedBitmapInCache(derivedBitmapIndex)) { + AL_6_bitmapRedBanana = f492_getDerivedBitmap(derivedBitmapIndex); } else { - bitmapGreenAnt = getBitmap(AL_4_nativeBitmapIndex); - blitToBitmapShrinkWithPalChange(bitmapGreenAnt, objectAspect->_width, objectAspect->_height, AL_6_bitmapRedBanana = getDerivedBitmap(derivedBitmapIndex), + bitmapGreenAnt = f489_getBitmap(AL_4_nativeBitmapIndex); + f129_blitToBitmapShrinkWithPalChange(bitmapGreenAnt, objectAspect->_width, objectAspect->_height, AL_6_bitmapRedBanana = f492_getDerivedBitmap(derivedBitmapIndex), byteWidth, heightRedEagle, paletteChanges); if (flipHorizontal) { - flipBitmapHorizontal(AL_6_bitmapRedBanana, byteWidth, heightRedEagle); + f103_flipBitmapHorizontal(AL_6_bitmapRedBanana, byteWidth, heightRedEagle); } warning("IGNORED CODE: F0493_CACHE_AddDerivedBitmap"); } @@ -2417,12 +2417,12 @@ T0115015_DrawProjectileAsObject: AL_6_bitmapRedBanana = bitmapGreenAnt; dunMan._g292_pileTopObject[AL_2_viewCell] = thingParam; /* The object is at the top of the pile */ } - blitToBitmap(AL_6_bitmapRedBanana, byteWidth, AL_4_xPos, 0, _g296_bitmapViewport, k112_byteWidthViewport * 2, boxByteGreen, k10_ColorFlesh); + f132_blitToBitmap(AL_6_bitmapRedBanana, byteWidth, AL_4_xPos, 0, _g296_bitmapViewport, k112_byteWidthViewport * 2, boxByteGreen, k10_ColorFlesh); if (drawProjectileAsObject) goto T0115171_BackFromT0115015_DrawProjectileAsObject; } - } while ((thingParam = dunMan.getNextThing(thingParam)) != Thing::_endOfList); + } while ((thingParam = dunMan.f159_getNextThing(thingParam)) != Thing::_endOfList); if (AL_2_viewCell == k4_ViewCellAlcove) break; /* End of processing when drawing objects in an alcove */ if (viewSquareIndex < k0_ViewSquare_D3C) @@ -2436,7 +2436,7 @@ T0115015_DrawProjectileAsObject: if ((groupThing == Thing::_none) || drawCreaturesCompleted) goto T0115129_DrawProjectiles; /* Skip code to draw creatures */ if (group == nullptr) { /* If all creature data and info has not already been gathered */ - group = (Group*)dunMan.getThingData(groupThing); + group = (Group*)dunMan.f156_getThingData(groupThing); activeGroup = &_vm->_groupMan->_g375_activeGroups[group->getActiveGroupIndex()]; creatureInfo = &g243_CreatureInfo[group->_type]; creatureAspectStruct = &g219_CreatureAspects[creatureInfo->_creatureAspectIndex]; @@ -2444,7 +2444,7 @@ T0115015_DrawProjectileAsObject: creatureGraphicInfoGreen = creatureInfo->_graphicInfo; } objectAspect = (ObjectAspect*)creatureAspectStruct; - if (AL_0_creatureIndexRed = _vm->_groupMan->getCreatureOrdinalInCell(group, cellYellowBear)) { /* If there is a creature on the cell being processed */ + if (AL_0_creatureIndexRed = _vm->_groupMan->f176_getCreatureOrdinalInCell(group, cellYellowBear)) { /* If there is a creature on the cell being processed */ AL_0_creatureIndexRed--; /* Convert ordinal to index */ creatureIndexGreen = AL_0_creatureIndexRed; } else if (creatureSize == k1_MaskCreatureSizeHalf) { @@ -2454,7 +2454,7 @@ T0115015_DrawProjectileAsObject: goto T0115129_DrawProjectiles; /* No creature to draw at cell, skip to projectiles */ } - creatureDirectionDelta = (directionParam - _vm->_groupMan->getCreatureValue(activeGroup->_directions, AL_0_creatureIndexRed)) % 3; + creatureDirectionDelta = (directionParam - _vm->_groupMan->M50_getCreatureValue(activeGroup->_directions, AL_0_creatureIndexRed)) % 3; twoHalfSquareCreaturesFrontView = false; if ((AL_4_groupCells = activeGroup->_cells) == k255_CreatureTypeSingleCenteredCreature) { /* If there is a single centered creature in the group */ if (remainingViewCellOrdinalsToProcess || (doorFrontViewDrawingPass == 1)) @@ -2487,7 +2487,7 @@ T0115015_DrawProjectileAsObject: creatureIndexGreen = 0; } twoHalfSquareCreaturesFrontView = group->getCount(); - if (((AL_4_groupCells = _vm->_groupMan->getCreatureValue(AL_4_groupCells, AL_0_creatureIndexRed)) == directionParam) + if (((AL_4_groupCells = _vm->_groupMan->M50_getCreatureValue(AL_4_groupCells, AL_0_creatureIndexRed)) == directionParam) || (AL_4_groupCells == returnPrevVal(directionParam))) { AL_2_viewCell = k0_HalfSizedViewCell_LeftColumn; } else { @@ -2571,29 +2571,29 @@ T0115077_DrawSecondHalfSquareCreature: AL_8_shiftSetIndex = k0_ShiftSet_D0BackD1Front; transparentColor = ((CreatureAspect*)objectAspect)->getTranspColour(); if (useCreatureSideBitmap) { - AL_6_bitmapRedBanana = getBitmap(AL_4_nativeBitmapIndex); + AL_6_bitmapRedBanana = f489_getBitmap(AL_4_nativeBitmapIndex); if (creatureDirectionDelta == 1) { memmove(_g74_tmpBitmap, AL_6_bitmapRedBanana, byteWidth * heightRedEagle * sizeof(byte)); - flipBitmapHorizontal(_g74_tmpBitmap, byteWidth, heightRedEagle); + f103_flipBitmapHorizontal(_g74_tmpBitmap, byteWidth, heightRedEagle); AL_6_bitmapRedBanana = _g74_tmpBitmap; } } else { if (useCreatureBackBitmap || !useFlippedHorizontallyCreatureFrontImage) { - AL_6_bitmapRedBanana = getBitmap(AL_4_nativeBitmapIndex); + AL_6_bitmapRedBanana = f489_getBitmap(AL_4_nativeBitmapIndex); if (useCreatureAttackBitmap && getFlag(creatureAspectInt, k0x0040_MaskActiveGroupFlipBitmap)) { memmove(_g74_tmpBitmap, AL_6_bitmapRedBanana, byteWidth * heightRedEagle * sizeof(byte)); - flipBitmapHorizontal(_g74_tmpBitmap, byteWidth, heightRedEagle); + f103_flipBitmapHorizontal(_g74_tmpBitmap, byteWidth, heightRedEagle); AL_6_bitmapRedBanana = _g74_tmpBitmap; } } else { /* Use first additional derived graphic: front D1 */ - if (isDerivedBitmapInCache(derivedBitmapIndex)) { /* If derived graphic is already in memory */ - AL_6_bitmapRedBanana = getDerivedBitmap(derivedBitmapIndex); + if (f491_isDerivedBitmapInCache(derivedBitmapIndex)) { /* If derived graphic is already in memory */ + AL_6_bitmapRedBanana = f492_getDerivedBitmap(derivedBitmapIndex); } else { - bitmapGreenAnt = getBitmap(AL_4_nativeBitmapIndex); + bitmapGreenAnt = f489_getBitmap(AL_4_nativeBitmapIndex); if (getFlag(AL_0_creatureGraphicInfoRed, k0x0004_CreatureInfoGraphicMaskFlipNonAttack)) { - AL_6_bitmapRedBanana = getDerivedBitmap(derivedBitmapIndex); + AL_6_bitmapRedBanana = f492_getDerivedBitmap(derivedBitmapIndex); memmove(AL_6_bitmapRedBanana, bitmapGreenAnt, byteWidth * heightRedEagle * sizeof(byte)); - flipBitmapHorizontal(AL_6_bitmapRedBanana, byteWidth, heightRedEagle); + f103_flipBitmapHorizontal(AL_6_bitmapRedBanana, byteWidth, heightRedEagle); } warning("IGNORED CODE: F0493_CACHE_AddDerivedBitmap"); } @@ -2616,15 +2616,15 @@ T0115077_DrawSecondHalfSquareCreature: paletteChanges = g221_PalChangesCreature_D3; scale = k16_Scale_D3; } - byteWidth = getScaledDimension(sourceByteWidth, scale); - heightRedEagle = getScaledDimension(sourceHeight, scale); + byteWidth = M78_getScaledDimension(sourceByteWidth, scale); + heightRedEagle = M78_getScaledDimension(sourceHeight, scale); transparentColor = paletteChanges[((CreatureAspect*)objectAspect)->getTranspColour()] / 10; - if (derivedBitmapInCache = isDerivedBitmapInCache(derivedBitmapIndex)) { - AL_6_bitmapRedBanana = getDerivedBitmap(derivedBitmapIndex); + if (derivedBitmapInCache = f491_isDerivedBitmapInCache(derivedBitmapIndex)) { + AL_6_bitmapRedBanana = f492_getDerivedBitmap(derivedBitmapIndex); } else { - bitmapGreenAnt = getBitmap(AL_4_nativeBitmapIndex); - AL_6_bitmapRedBanana = getDerivedBitmap(derivedBitmapIndex); - blitToBitmapShrinkWithPalChange(bitmapGreenAnt, sourceByteWidth, sourceHeight, AL_6_bitmapRedBanana, byteWidth, heightRedEagle, paletteChanges); + bitmapGreenAnt = f489_getBitmap(AL_4_nativeBitmapIndex); + AL_6_bitmapRedBanana = f492_getDerivedBitmap(derivedBitmapIndex); + f129_blitToBitmapShrinkWithPalChange(bitmapGreenAnt, sourceByteWidth, sourceHeight, AL_6_bitmapRedBanana, byteWidth, heightRedEagle, paletteChanges); warning("IGNORED CODE: F0493_CACHE_AddDerivedBitmap"); } if ((useCreatureSideBitmap && (creatureDirectionDelta == 1)) || /* If creature is viewed from the right, the side view must be flipped */ @@ -2633,12 +2633,12 @@ T0115077_DrawSecondHalfSquareCreature: (useFlippedHorizontallyCreatureFrontImage && getFlag(AL_0_creatureGraphicInfoRed, k0x0004_CreatureInfoGraphicMaskFlipNonAttack))) { /* If the graphic should be flipped */ if (!useFlippedHorizontallyCreatureFrontImage || !derivedBitmapInCache) { AL_4_normalizdByteWidth = byteWidth; - warning("SUPER WARNING: we might need getNormalizedByteWidthM77"); + warning("SUPER WARNING: we might need M77_getNormalizedByteWidth"); if (!useFlippedHorizontallyCreatureFrontImage) { memmove(_g74_tmpBitmap, AL_6_bitmapRedBanana, AL_4_normalizdByteWidth * heightRedEagle * sizeof(byte)); AL_6_bitmapRedBanana = _g74_tmpBitmap; } - flipBitmapHorizontal(AL_6_bitmapRedBanana, AL_4_normalizdByteWidth, heightRedEagle); + f103_flipBitmapHorizontal(AL_6_bitmapRedBanana, AL_4_normalizdByteWidth, heightRedEagle); } creaturePaddingPixelCount = (7 - ((byteWidth / 2 - 1) & 0x0007)) << 1; } else { @@ -2646,11 +2646,11 @@ T0115077_DrawSecondHalfSquareCreature: } } AL_4_yPos = coordinateSet[1]; - AL_4_yPos += g223_ShiftSets[AL_8_shiftSetIndex][getVerticalOffsetM23(creatureAspectInt)]; + AL_4_yPos += g223_ShiftSets[AL_8_shiftSetIndex][M23_getVerticalOffsetM23(creatureAspectInt)]; boxByteGreen._y2 = MIN(AL_4_yPos, (int16)135) + 1; boxByteGreen._y1 = MIN(0, AL_4_yPos - (heightRedEagle - 1)); AL_4_xPos = coordinateSet[0]; - AL_4_xPos += g223_ShiftSets[AL_8_shiftSetIndex][getHorizontalOffsetM22(creatureAspectInt)]; + AL_4_xPos += g223_ShiftSets[AL_8_shiftSetIndex][M22_getHorizontalOffsetM22(creatureAspectInt)]; if (viewLane == k1_ViewLaneLeft) { AL_4_xPos -= 100; } else { @@ -2668,7 +2668,7 @@ T0115077_DrawSecondHalfSquareCreature: AL_0_creaturePosX = creaturePaddingPixelCount + (byteWidth - AL_4_xPos - 1); } warning("SUPER WARNINIG: we might nee noralized with on byteWidth"); - blitToBitmap(AL_6_bitmapRedBanana, byteWidth, AL_0_creaturePosX, 0, _g296_bitmapViewport, k112_byteWidthViewport * 2, boxByteGreen, (Color)transparentColor); + f132_blitToBitmap(AL_6_bitmapRedBanana, byteWidth, AL_0_creaturePosX, 0, _g296_bitmapViewport, k112_byteWidthViewport * 2, boxByteGreen, (Color)transparentColor); T0115126_CreatureNotVisible: if (twoHalfSquareCreaturesFrontView) { @@ -2692,9 +2692,9 @@ continue; do { if ((thingParam.getType() == k14_ProjectileThingType) && (thingParam.getCell() == cellYellowBear)) { - projectile = (Projectile*)dunMan.getThingData(thingParam); - if ((AL_4_projectileAspect = dunMan.getProjectileAspect(projectile->_object)) < 0) { /* Negative value: projectile aspect is the ordinal of a PROJECTIL_ASPECT */ - objectAspect = (ObjectAspect*)&g210_ProjectileAspect[_vm->ordinalToIndex(-AL_4_projectileAspect)]; + projectile = (Projectile*)dunMan.f156_getThingData(thingParam); + if ((AL_4_projectileAspect = dunMan.f142_getProjectileAspect(projectile->_object)) < 0) { /* Negative value: projectile aspect is the ordinal of a PROJECTIL_ASPECT */ + objectAspect = (ObjectAspect*)&g210_ProjectileAspect[_vm->M1_ordinalToIndex(-AL_4_projectileAspect)]; AL_4_nativeBitmapIndex = ((ProjectileAspect*)objectAspect)->_firstNativeBitmapRelativeIndex + k316_FirstProjectileGraphicIndice; projectileAspectType = getFlag(((ProjectileAspect*)objectAspect)->_graphicInfo, k0x0003_ProjectileAspectTypeMask); if (((doNotScaleWithKineticEnergy = !getFlag(((ProjectileAspect*)objectAspect)->_graphicInfo, k0x0100_ProjectileScaleWithKineticEnergyMask)) @@ -2708,8 +2708,8 @@ continue; if (!doNotScaleWithKineticEnergy) { scale = (scale * MAX(96, projectile->_kineticEnergy + 1)) >> 8; } - byteWidth = getScaledDimension(((ProjectileAspect*)objectAspect)->_width, scale); - heightRedEagle = getScaledDimension(((ProjectileAspect*)objectAspect)->_height, scale); + byteWidth = M78_getScaledDimension(((ProjectileAspect*)objectAspect)->_width, scale); + heightRedEagle = M78_getScaledDimension(((ProjectileAspect*)objectAspect)->_height, scale); } if (projectileAspectTypeHasBackGraphicAndRotation = (projectileAspectType == k0_ProjectileAspectHasBackGraphicRotation)) { projectileFlipVertical = ((mapXpos + mapYpos) & 0x0001); @@ -2751,22 +2751,22 @@ continue; AL_4_nativeBitmapIndex += projectileBitmapIndexData; paddingPixelCount = 0; if (!scale) { - AL_6_bitmapRedBanana = getBitmap(AL_4_nativeBitmapIndex); + AL_6_bitmapRedBanana = f489_getBitmap(AL_4_nativeBitmapIndex); } else { if (flipHorizontal) { paddingPixelCount = (7 - ((byteWidth / 2 - 1) & 0x0007)) << 1; } derivedBitmapIndex = k282_DerivedBitmapFirstProjectile + ((ProjectileAspect*)objectAspect)->_firstNativeBitmapRelativeIndex + (projectileBitmapIndexData * 6); - if (doNotScaleWithKineticEnergy && isDerivedBitmapInCache(derivedBitmapIndex) + AL_8_projectileScaleIndex) { - AL_6_bitmapRedBanana = getDerivedBitmap(derivedBitmapIndex); + if (doNotScaleWithKineticEnergy && f491_isDerivedBitmapInCache(derivedBitmapIndex) + AL_8_projectileScaleIndex) { + AL_6_bitmapRedBanana = f492_getDerivedBitmap(derivedBitmapIndex); } else { - bitmapGreenAnt = getBitmap(AL_4_nativeBitmapIndex); + bitmapGreenAnt = f489_getBitmap(AL_4_nativeBitmapIndex); if (doNotScaleWithKineticEnergy) { - AL_6_bitmapRedBanana = getDerivedBitmap(derivedBitmapIndex); + AL_6_bitmapRedBanana = f492_getDerivedBitmap(derivedBitmapIndex); } else { AL_6_bitmapRedBanana = _g74_tmpBitmap; } - blitToBitmapShrinkWithPalChange(bitmapGreenAnt, ((ProjectileAspect*)objectAspect)->_width, ((ProjectileAspect*)objectAspect)->_height, + f129_blitToBitmapShrinkWithPalChange(bitmapGreenAnt, ((ProjectileAspect*)objectAspect)->_width, ((ProjectileAspect*)objectAspect)->_height, AL_6_bitmapRedBanana, byteWidth, heightRedEagle, _g75_palChangesProjectile[AL_8_projectileScaleIndex >> 1]); if (doNotScaleWithKineticEnergy) { warning("IGNORED CODE F0493_CACHE_AddDerivedBitmap"); @@ -2784,7 +2784,7 @@ continue; flipBitmapVertical(AL_6_bitmapRedBanana, AL_4_normalizdByteWidth, heightRedEagle); } if (flipHorizontal) { - flipBitmapHorizontal(AL_6_bitmapRedBanana, AL_4_normalizdByteWidth, heightRedEagle); + f103_flipBitmapHorizontal(AL_6_bitmapRedBanana, AL_4_normalizdByteWidth, heightRedEagle); } } boxByteGreen._y2 = (heightRedEagle >> 1) + 47 + 1; @@ -2803,7 +2803,7 @@ the bitmap is flipped horizontally (flipHorizontal = C1_TRUE) then a wrong part screen. To fix this bug, "+ paddingPixelCount" must be added to the second parameter of this function call */ AL_4_xPos = MAX(paddingPixelCount, (int16)(byteWidth - projectilePosX - 1)); } - blitToBitmap(AL_6_bitmapRedBanana, byteWidth, AL_4_xPos, 0, _g296_bitmapViewport, k112_byteWidthViewport * 2, boxByteGreen, k10_ColorFlesh); + f132_blitToBitmap(AL_6_bitmapRedBanana, byteWidth, AL_4_xPos, 0, _g296_bitmapViewport, k112_byteWidthViewport * 2, boxByteGreen, k10_ColorFlesh); } else { /* Positive value: projectile aspect is the index of a OBJECT_ASPECT */ useAlcoveObjectImage = false; projectileCoordinates[0] = projectilePosX; @@ -2817,7 +2817,7 @@ screen. To fix this bug, "+ paddingPixelCount" must be added to the second param } } T0115171_BackFromT0115015_DrawProjectileAsObject:; - } while ((thingParam = dunMan.getNextThing(thingParam)) != Thing::_endOfList); + } while ((thingParam = dunMan.f159_getNextThing(thingParam)) != Thing::_endOfList); } while (remainingViewCellOrdinalsToProcess); @@ -2832,7 +2832,7 @@ T0115171_BackFromT0115015_DrawProjectileAsObject:; do { if (thingParam.getType() == k15_ExplosionThingType) { AL_2_cellPurpleMan = thingParam.getCell(); - explosion = (Explosion*)dunMan.getThingData(thingParam); + explosion = (Explosion*)dunMan.f156_getThingData(thingParam); if ((rebirthExplosion = ((unsigned int)(AL_4_explosionType = explosion->getType()) >= k100_ExplosionType_RebirthStep1)) && ((AL_1_viewSquareExplosionIndex < k3_ViewSquare_D3C_Explosion) || (AL_1_viewSquareExplosionIndex > k9_ViewSquare_D1C_Explosion) @@ -2850,13 +2850,13 @@ T0115171_BackFromT0115015_DrawProjectileAsObject:; AL_4_explosionAspectIndex = k3_ExplosionAspectSmoke; } else { if (AL_4_explosionType == k100_ExplosionType_RebirthStep1) { - objectAspect = (ObjectAspect*)&g210_ProjectileAspect[_vm->ordinalToIndex(-dunMan.getProjectileAspect(Thing::_explLightningBolt))]; - AL_6_bitmapRedBanana = getBitmap(((ProjectileAspect*)objectAspect)->_firstNativeBitmapRelativeIndex + (k316_FirstProjectileGraphicIndice + 1)); + objectAspect = (ObjectAspect*)&g210_ProjectileAspect[_vm->M1_ordinalToIndex(-dunMan.f142_getProjectileAspect(Thing::_explLightningBolt))]; + AL_6_bitmapRedBanana = f489_getBitmap(((ProjectileAspect*)objectAspect)->_firstNativeBitmapRelativeIndex + (k316_FirstProjectileGraphicIndice + 1)); explosionCoordinates = g228_RebirthStep1ExplosionCoordinates[AL_1_viewSquareExplosionIndex - 3]; - byteWidth = getScaledDimension((((ProjectileAspect*)objectAspect)->_width), explosionCoordinates[2]); - heightRedEagle = getScaledDimension((((ProjectileAspect*)objectAspect)->_height), explosionCoordinates[2]); + byteWidth = M78_getScaledDimension((((ProjectileAspect*)objectAspect)->_width), explosionCoordinates[2]); + heightRedEagle = M78_getScaledDimension((((ProjectileAspect*)objectAspect)->_height), explosionCoordinates[2]); if (AL_1_viewSquareExplosionIndex != k9_ViewSquare_D1C_Explosion) { - blitToBitmapShrinkWithPalChange(AL_6_bitmapRedBanana, + f129_blitToBitmapShrinkWithPalChange(AL_6_bitmapRedBanana, ((ProjectileAspect*)objectAspect)->_width, ((ProjectileAspect*)objectAspect)->_height, _g74_tmpBitmap, byteWidth, heightRedEagle, g17_PalChangesNoChanges); AL_6_bitmapRedBanana = _g74_tmpBitmap; @@ -2885,12 +2885,12 @@ T0115171_BackFromT0115015_DrawProjectileAsObject:; } } warning("IGNORED CODE: F0491_CACHE_IsDerivedBitmapInCache"); - AL_6_bitmapRedBanana = getBitmap(AL_4_explosionAspectIndex + k351_FirstExplosionPatternGraphicIndice); + AL_6_bitmapRedBanana = f489_getBitmap(AL_4_explosionAspectIndex + k351_FirstExplosionPatternGraphicIndice); if (smoke) { - blitToBitmapShrinkWithPalChange(AL_6_bitmapRedBanana, 48, 32, _g74_tmpBitmap, 48, 32, g212_PalChangeSmoke); + f129_blitToBitmapShrinkWithPalChange(AL_6_bitmapRedBanana, 48, 32, _g74_tmpBitmap, 48, 32, g212_PalChangeSmoke); AL_6_bitmapRedBanana = _g74_tmpBitmap; } - blitBoxFilledWithMaskedBitmap(AL_6_bitmapRedBanana, _g296_bitmapViewport, nullptr, getDerivedBitmap(k0_DerivedBitmapViewport), g105_BoxExplosionPattern_D0C, + f133_blitBoxFilledWithMaskedBitmap(AL_6_bitmapRedBanana, _g296_bitmapViewport, nullptr, f492_getDerivedBitmap(k0_DerivedBitmapViewport), g105_BoxExplosionPattern_D0C, _vm->_rnd->getRandomNumber(4) + 87, _vm->_rnd->getRandomNumber(64), 224, (Color)(k0x0080_BlitDoNotUseMask | k10_ColorFlesh), 0, 0, 136, 93); warning("IGNORED CODE: F0493_CACHE_AddDerivedBitmap"); @@ -2912,7 +2912,7 @@ T0115171_BackFromT0115015_DrawProjectileAsObject:; } explosionScale = MAX(4, (MAX(48, explosion->getAttack() + 1) * g216_ExplosionBaseScales[explosionScaleIndex]) >> 8) & (int16)0xFFFE; } - AL_6_bitmapRedBanana = getExplosionBitmap(AL_4_explosionAspectIndex, explosionScale, byteWidth, heightRedEagle); + AL_6_bitmapRedBanana = f114_getExplosionBitmap(AL_4_explosionAspectIndex, explosionScale, byteWidth, heightRedEagle); T0115200_DrawExplosion: flipVertical = _vm->_rnd->getRandomNumber(2); paddingPixelCount = 0; @@ -2950,37 +2950,37 @@ then a wrong part of the bitmap is drawn on screen. To fix this bug, "+ paddingP AL_6_bitmapRedBanana = _g74_tmpBitmap; } if (flipHorizontal) { - flipBitmapHorizontal(AL_6_bitmapRedBanana, byteWidth, heightRedEagle); + f103_flipBitmapHorizontal(AL_6_bitmapRedBanana, byteWidth, heightRedEagle); } if (flipVertical) { flipBitmapVertical(AL_6_bitmapRedBanana, byteWidth, heightRedEagle); } - blitToBitmap(AL_6_bitmapRedBanana, byteWidth, AL_4_xPos, 0, _g296_bitmapViewport, k112_byteWidthViewport * 2, boxByteGreen, k10_ColorFlesh); + f132_blitToBitmap(AL_6_bitmapRedBanana, byteWidth, AL_4_xPos, 0, _g296_bitmapViewport, k112_byteWidthViewport * 2, boxByteGreen, k10_ColorFlesh); } } - } while ((thingParam = dunMan.getNextThing(thingParam)) != Thing::_endOfList); + } while ((thingParam = dunMan.f159_getNextThing(thingParam)) != Thing::_endOfList); /* Fluxcage is an explosion displayed as a field (like teleporters), above all other graphics */ if ((fluxcageExplosion != 0) && (doorFrontViewDrawingPass != 1) && !_g77_doNotDrawFluxcagesDuringEndgame) { AL_1_viewSquareExplosionIndex -= 3; /* Convert square index for explosions back to square index */ fieldAspect = g188_FieldAspects[viewSquareIndex]; (fieldAspect._nativeBitmapRelativeIndex)++; /* NativeBitmapRelativeIndex is now the index of the Fluxcage field graphic */ - drawField(&fieldAspect, *(Box*)&g163_FrameWalls[viewSquareIndex]); + f113_drawField(&fieldAspect, *(Box*)&g163_FrameWalls[viewSquareIndex]); } } -uint16 DisplayMan::getNormalizedByteWidthM77(uint16 byteWidth) { +uint16 DisplayMan::M77_getNormalizedByteWidth(uint16 byteWidth) { return (byteWidth + 7) & 0xFFF8; } -uint16 DisplayMan::getVerticalOffsetM23(uint16 val) { +uint16 DisplayMan::M23_getVerticalOffsetM23(uint16 val) { return (val >> 3) & 0x7; } -uint16 DisplayMan::getHorizontalOffsetM22(uint16 val) { +uint16 DisplayMan::M22_getHorizontalOffsetM22(uint16 val) { return (val & 0x7); } -bool DisplayMan::isDerivedBitmapInCache(int16 derivedBitmapIndex) { +bool DisplayMan::f491_isDerivedBitmapInCache(int16 derivedBitmapIndex) { if (_g638_derivedBitmaps[derivedBitmapIndex] == nullptr) { // * 2, because the original uses 4 bits instead of 8 bits to store a pixel _g638_derivedBitmaps[derivedBitmapIndex] = new byte[_g639_derivedBitmapByteCount[derivedBitmapIndex] * 2]; @@ -2989,7 +2989,7 @@ bool DisplayMan::isDerivedBitmapInCache(int16 derivedBitmapIndex) { return true; } -byte* DisplayMan::getDerivedBitmap(int16 derivedBitmapIndex) { +byte* DisplayMan::f492_getDerivedBitmap(int16 derivedBitmapIndex) { return _g638_derivedBitmaps[derivedBitmapIndex]; } diff --git a/engines/dm/gfx.h b/engines/dm/gfx.h index df48bec0ea..a0a61ba78f 100644 --- a/engines/dm/gfx.h +++ b/engines/dm/gfx.h @@ -433,27 +433,27 @@ class DisplayMan { void f565_viewportSetPalette(uint16 * middleScreenPalette, uint16 * topAndBottomScreen); // @ F0565_VIEWPORT_SetPalette void f566_viewportBlitToScreen(); // @ F0566_VIEWPORT_BlitToScreen - void drawFloorPitOrStairsBitmapFlippedHorizontally(uint16 nativeIndex, Frame &frame); // @ F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally - void drawFloorPitOrStairsBitmap(uint16 nativeIndex, Frame &frame); // @ F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap - void drawWallSetBitmap(byte *bitmap, Frame &f); // @ F0100_DUNGEONVIEW_DrawWallSetBitmap - void drawWallSetBitmapWithoutTransparency(byte *bitmap, Frame &f); // @ F0101_DUNGEONVIEW_DrawWallSetBitmapWithoutTransparency - void drawSquareD3L(direction dir, int16 posX, int16 posY); // @ F0116_DUNGEONVIEW_DrawSquareD3L - void drawSquareD3R(direction dir, int16 posX, int16 posY); // @ F0117_DUNGEONVIEW_DrawSquareD3R - void drawSquareD3C(direction dir, int16 posX, int16 posY); // @ F0118_DUNGEONVIEW_DrawSquareD3C_CPSF - void drawSquareD2L(direction dir, int16 posX, int16 posY); // @ F0119_DUNGEONVIEW_DrawSquareD2L - void drawSquareD2R(direction dir, int16 posX, int16 posY); // @ F0120_DUNGEONVIEW_DrawSquareD2R_CPSF - void drawSquareD2C(direction dir, int16 posX, int16 posY); // @ F0121_DUNGEONVIEW_DrawSquareD2C - void drawSquareD1L(direction dir, int16 posX, int16 posY); // @ F0122_DUNGEONVIEW_DrawSquareD1L - void drawSquareD1R(direction dir, int16 posX, int16 posY); // @ F0122_DUNGEONVIEW_DrawSquareD1R - void drawSquareD1C(direction dir, int16 posX, int16 posY); // @ F0124_DUNGEONVIEW_DrawSquareD1C - void drawSquareD0L(direction dir, int16 posX, int16 posY); // @ F0125_DUNGEONVIEW_DrawSquareD0L - void drawSquareD0R(direction dir, int16 posX, int16 posY); // @ F0126_DUNGEONVIEW_DrawSquareD0R - void drawSquareD0C(direction dir, int16 posX, int16 posY); // @ F0127_DUNGEONVIEW_DrawSquareD0C - - - void applyCreatureReplColors(int replacedColor, int replacementColor); // @ F0093_DUNGEONVIEW_ApplyCreatureReplacementColors - - bool isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex); // @ F0107_DUNGEONVIEW_IsDrawnWallOrnamentAnAlcove_CPSF + void f105_drawFloorPitOrStairsBitmapFlippedHorizontally(uint16 nativeIndex, Frame &frame); // @ F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally + void f104_drawFloorPitOrStairsBitmap(uint16 nativeIndex, Frame &frame); // @ F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap + void f100_drawWallSetBitmap(byte *bitmap, Frame &f); // @ F0100_DUNGEONVIEW_DrawWallSetBitmap + void f101_drawWallSetBitmapWithoutTransparency(byte *bitmap, Frame &f); // @ F0101_DUNGEONVIEW_DrawWallSetBitmapWithoutTransparency + void f116_drawSquareD3L(direction dir, int16 posX, int16 posY); // @ F0116_DUNGEONVIEW_DrawSquareD3L + void f117_drawSquareD3R(direction dir, int16 posX, int16 posY); // @ F0117_DUNGEONVIEW_DrawSquareD3R + void f118_drawSquareD3C(direction dir, int16 posX, int16 posY); // @ F0118_DUNGEONVIEW_DrawSquareD3C_CPSF + void f119_drawSquareD2L(direction dir, int16 posX, int16 posY); // @ F0119_DUNGEONVIEW_DrawSquareD2L + void f120_drawSquareD2R(direction dir, int16 posX, int16 posY); // @ F0120_DUNGEONVIEW_DrawSquareD2R_CPSF + void f121_drawSquareD2C(direction dir, int16 posX, int16 posY); // @ F0121_DUNGEONVIEW_DrawSquareD2C + void f122_drawSquareD1L(direction dir, int16 posX, int16 posY); // @ F0122_DUNGEONVIEW_DrawSquareD1L + void f123_drawSquareD1R(direction dir, int16 posX, int16 posY); // @ F0123_DUNGEONVIEW_DrawSquareD1R + void f124_drawSquareD1C(direction dir, int16 posX, int16 posY); // @ F0124_DUNGEONVIEW_DrawSquareD1C + void f125_drawSquareD0L(direction dir, int16 posX, int16 posY); // @ F0125_DUNGEONVIEW_DrawSquareD0L + void f126_drawSquareD0R(direction dir, int16 posX, int16 posY); // @ F0126_DUNGEONVIEW_DrawSquareD0R + void f127_drawSquareD0C(direction dir, int16 posX, int16 posY); // @ F0127_DUNGEONVIEW_DrawSquareD0C + + + void f93_applyCreatureReplColors(int replacedColor, int replacementColor); // @ F0093_DUNGEONVIEW_ApplyCreatureReplacementColors + + bool f107_isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex); // @ F0107_DUNGEONVIEW_IsDrawnWallOrnamentAnAlcove_CPSF uint16 *_g639_derivedBitmapByteCount; // @ G0639_pui_DerivedBitmapByteCount byte **_g638_derivedBitmaps; // @ G0638_pui_DerivedBitmapBlockIndices @@ -527,14 +527,14 @@ public: explicit DisplayMan(DMEngine *dmEngine); ~DisplayMan(); - void loadWallSet(WallSet set); // @ F0095_DUNGEONVIEW_LoadWallSet - void loadFloorSet(FloorSet set); // @ F0094_DUNGEONVIEW_LoadFloorSet + void f95_loadWallSet(WallSet set); // @ F0095_DUNGEONVIEW_LoadWallSet + void f94_loadFloorSet(FloorSet set); // @ F0094_DUNGEONVIEW_LoadFloorSet - void loadIntoBitmap(uint16 index, byte *destBitmap); // @ F0466_EXPAND_GraphicToBitmap + void f466_loadIntoBitmap(uint16 index, byte *destBitmap); // @ F0466_EXPAND_GraphicToBitmap void setUpScreens(uint16 width, uint16 height); - void loadGraphics(); // @ F0479_MEMORY_ReadGraphicsDatHeader, F0460_START_InitializeGraphicData - void initializeGraphicData(); // @ F0460_START_InitializeGraphicData - void loadCurrentMapGraphics(); // @ F0096_DUNGEONVIEW_LoadCurrentMapGraphics_CPSDF + void f479_loadGraphics(); // @ F0479_MEMORY_ReadGraphicsDatHeader + void f460_initializeGraphicData(); // @ F0460_START_InitializeGraphicData + void f96_loadCurrentMapGraphics(); // @ F0096_DUNGEONVIEW_LoadCurrentMapGraphics_CPSDF void loadPalette(uint16 *palette); void f461_allocateFlippedWallBitmaps(); // @ F0461_START_AllocateFlippedWallBitmaps @@ -547,40 +547,40 @@ public: void f99_copyBitmapAndFlipHorizontal(byte *srcBitmap, byte *destBitmap, uint16 byteWidth, uint16 height); - void blitToBitmap(byte *srcBitmap, uint16 srcWidth, uint16 srcX, uint16 srcY, - byte *destBitmap, uint16 destWidth, Box &box, Color transparent = k255_ColorNoTransparency); + void f132_blitToBitmap(byte *srcBitmap, uint16 srcWidth, uint16 srcX, uint16 srcY, + byte *destBitmap, uint16 destWidth, Box &box, Color transparent = k255_ColorNoTransparency); // @ F0132_VIDEO_Blit - void blitBoxFilledWithMaskedBitmap(byte *src, byte *dest, byte *mask, byte *tmp, Box &box, int16 lastUnitIndex, + void f133_blitBoxFilledWithMaskedBitmap(byte *src, byte *dest, byte *mask, byte *tmp, Box &box, int16 lastUnitIndex, int16 firstUnitIndex, int16 destPixelWidth, Color transparent, int16 xPos, int16 yPos, int16 destHeight, int16 height2); // @ F0133_VIDEO_BlitBoxFilledWithMaskedBitmap - void blitToBitmapShrinkWithPalChange(byte *srcBitmap, int16 srcWidth, int16 srcHight, + void f129_blitToBitmapShrinkWithPalChange(byte *srcBitmap, int16 srcWidth, int16 srcHight, byte *destBitmap, int16 destWidth, int16 destHeight, byte *palChange); // @ F0129_VIDEO_BlitShrinkWithPaletteChanges - void flipBitmapHorizontal(byte *bitmap, uint16 width, uint16 height); // @ F0103_DUNGEONVIEW_DrawDoorFrameBitmapFlippedHorizontally + void f103_flipBitmapHorizontal(byte *bitmap, uint16 width, uint16 height); // @ F0103_DUNGEONVIEW_DrawDoorFrameBitmapFlippedHorizontally void flipBitmapVertical(byte *bitmap, uint16 width, uint16 height); - byte *getExplosionBitmap(uint16 explosionAspIndex, uint16 scale, int16 &returnPixelWidth, int16 &returnHeight); // @ F0114_DUNGEONVIEW_GetExplosionBitmap + byte *f114_getExplosionBitmap(uint16 explosionAspIndex, uint16 scale, int16 &returnPixelWidth, int16 &returnHeight); // @ F0114_DUNGEONVIEW_GetExplosionBitmap void f134_fillBitmap(byte *bitmap, uint16 width, uint16 height, Color color); // @ F0134_VIDEO_FillBitmap void clearScreen(Color color); - void clearScreenBox(Color color, Box &box); // @ D24_FillScreenBox, F0550_VIDEO_FillScreenBox + void D24_clearScreenBox(Color color, Box &box); // @ D24_FillScreenBox, F0550_VIDEO_FillScreenBox void f135_fillBoxBitmap(byte *destBitmap, Box &box, Color color, int16 pixelWidth, int16 height); - void drawDungeon(direction dir, int16 posX, int16 posY); // @ F0128_DUNGEONVIEW_Draw_CPSF + void f128_drawDungeon(direction dir, int16 posX, int16 posY); // @ F0128_DUNGEONVIEW_Draw_CPSF void updateScreen(); void f97_drawViewport(int16 palSwitchingRequestedState); // @ F0097_DUNGEONVIEW_DrawViewport - byte* getBitmap(uint16 index); + byte* f489_getBitmap(uint16 index); // @ F0489_MEMORY_GetNativeBitmapOrGraphic Common::MemoryReadStream getCompressedData(uint16 index); uint32 getCompressedDataSize(uint16 index); - void drawField(FieldAspect *fieldAspect, Box &box); // @ F0113_DUNGEONVIEW_DrawField + void f113_drawField(FieldAspect *fieldAspect, Box &box); // @ F0113_DUNGEONVIEW_DrawField - int16 getScaledBitmapPixelCount(int16 pixelWidth, int16 pixelHeight, int16 scale); // @ F0459_START_GetScaledBitmapByteCount - int16 getScaledDimension(int16 dimension, int16 scale); // @ M78_SCALED_DIMENSION - void cthulhu(Thing thingParam, direction directionParam, + int16 f459_getScaledBitmapPixelCount(int16 pixelWidth, int16 pixelHeight, int16 scale); // @ F0459_START_GetScaledBitmapByteCount + int16 M78_getScaledDimension(int16 dimension, int16 scale); // @ M78_SCALED_DIMENSION + void f115_cthulhu(Thing thingParam, direction directionParam, int16 mapXpos, int16 mapYpos, int16 viewSquareIndex, uint16 orderedViewCellOrdinals); // @ F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF - uint16 getNormalizedByteWidthM77(uint16 byteWidth); // @ M77_NORMALIZED_BYTE_WIDTH - uint16 getVerticalOffsetM23(uint16 val); // @ M23_VERTICAL_OFFSET - uint16 getHorizontalOffsetM22(uint16 val); // @ M22_HORIZONTAL_OFFSET + uint16 M77_getNormalizedByteWidth(uint16 byteWidth); // @ M77_NORMALIZED_BYTE_WIDTH + uint16 M23_getVerticalOffsetM23(uint16 val); // @ M23_VERTICAL_OFFSET + uint16 M22_getHorizontalOffsetM22(uint16 val); // @ M22_HORIZONTAL_OFFSET int16 _g289_championPortraitOrdinal; // @ G0289_i_DungeonView_ChampionPortraitOrdinal int16 _g267_currMapAlcoveOrnIndices[k3_AlcoveOrnCount]; // @ G0267_ai_CurrentMapAlcoveOrnamentIndices @@ -602,8 +602,8 @@ public: bool _g578_useByteBoxCoordinates; // @ G0578_B_UseByteBoxCoordinates bool _g77_doNotDrawFluxcagesDuringEndgame; // @ G0077_B_DoNotDrawFluxcagesDuringEndgame - bool isDerivedBitmapInCache(int16 derivedBitmapIndex); // @ F0491_CACHE_IsDerivedBitmapInCache - byte *getDerivedBitmap(int16 derivedBitmapIndex); // @ F0492_CACHE_GetDerivedBitmap + bool f491_isDerivedBitmapInCache(int16 derivedBitmapIndex); // @ F0491_CACHE_IsDerivedBitmapInCache + byte *f492_getDerivedBitmap(int16 derivedBitmapIndex); // @ F0492_CACHE_GetDerivedBitmap diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp index 2cc2646a1a..3fa8c4a3b1 100644 --- a/engines/dm/group.cpp +++ b/engines/dm/group.cpp @@ -42,7 +42,7 @@ GroupMan::~GroupMan() { delete[] _g375_activeGroups; } -void GroupMan::initActiveGroups() { +void GroupMan::f196_initActiveGroups() { if (_vm->_g298_newGame) _g376_maxActiveGroupCount = 60; if (_g375_activeGroups) @@ -52,7 +52,7 @@ void GroupMan::initActiveGroups() { _g375_activeGroups[i]._groupThingIndex = -1; } -uint16 GroupMan::getGroupCells(Group* group, int16 mapIndex) { +uint16 GroupMan::f145_getGroupCells(Group* group, int16 mapIndex) { byte cells; cells = group->_cells; if (mapIndex == _vm->_dungeonMan->_g309_partyMapIndex) @@ -62,39 +62,39 @@ uint16 GroupMan::getGroupCells(Group* group, int16 mapIndex) { byte gGroupDirections[4] = {0x00, 0x55, 0xAA, 0xFF}; // @ G0258_auc_Graphic559_GroupDirections -uint16 GroupMan::getGroupDirections(Group* group, int16 mapIndex) { +uint16 GroupMan::f147_getGroupDirections(Group* group, int16 mapIndex) { if (mapIndex == _vm->_dungeonMan->_g309_partyMapIndex) return _g375_activeGroups[group->getActiveGroupIndex()]._directions; return gGroupDirections[group->getDir()]; } -int16 GroupMan::getCreatureOrdinalInCell(Group* group, uint16 cell) { +int16 GroupMan::f176_getCreatureOrdinalInCell(Group* group, uint16 cell) { uint16 currMapIndex = _vm->_dungeonMan->_g272_currMapIndex; - byte groupCells = getGroupCells(group, currMapIndex); + byte groupCells = f145_getGroupCells(group, currMapIndex); if (groupCells == k255_CreatureTypeSingleCenteredCreature) - return _vm->indexToOrdinal(0); + return _vm->M0_indexToOrdinal(0); byte creatureIndex = group->getCount(); if (getFlag(g243_CreatureInfo[group->_type]._attributes, k0x0003_MaskCreatureInfo_size) == k1_MaskCreatureSizeHalf) { - if ((getGroupDirections(group, currMapIndex) & 1) == (cell & 1)) + if ((f147_getGroupDirections(group, currMapIndex) & 1) == (cell & 1)) cell = returnPrevVal(cell); do { - byte creatureCell = getCreatureValue(groupCells, creatureIndex); + byte creatureCell = M50_getCreatureValue(groupCells, creatureIndex); if (creatureCell == cell || creatureCell == returnNextVal(cell)) - return _vm->indexToOrdinal(creatureIndex); + return _vm->M0_indexToOrdinal(creatureIndex); } while (creatureIndex--); } else { do { - if (getCreatureValue(groupCells, creatureIndex) == cell) - return _vm->indexToOrdinal(creatureIndex); + if (M50_getCreatureValue(groupCells, creatureIndex) == cell) + return _vm->M0_indexToOrdinal(creatureIndex); } while (creatureIndex--); } return 0; } -uint16 GroupMan::getCreatureValue(uint16 groupVal, uint16 creatureIndex) { +uint16 GroupMan::M50_getCreatureValue(uint16 groupVal, uint16 creatureIndex) { return (groupVal >> (creatureIndex << 1)) & 0x3; } } diff --git a/engines/dm/group.h b/engines/dm/group.h index af7a4eb622..76cb8b2649 100644 --- a/engines/dm/group.h +++ b/engines/dm/group.h @@ -137,11 +137,11 @@ public: ActiveGroup *_g375_activeGroups; // @ G0375_ps_ActiveGroups GroupMan(DMEngine *vm); ~GroupMan(); - void initActiveGroups(); // @ F0196_GROUP_InitializeActiveGroups - uint16 getGroupCells(Group *group, int16 mapIndex); // @ F0145_DUNGEON_GetGroupCells - uint16 getGroupDirections(Group *group, int16 mapIndex); // @ F0147_DUNGEON_GetGroupDirections - int16 getCreatureOrdinalInCell(Group *group, uint16 cell); // @ F0176_GROUP_GetCreatureOrdinalInCell - uint16 getCreatureValue(uint16 groupVal, uint16 creatureIndex); // @ M50_CREATURE_VALUE + void f196_initActiveGroups(); // @ F0196_GROUP_InitializeActiveGroups + uint16 f145_getGroupCells(Group *group, int16 mapIndex); // @ F0145_DUNGEON_GetGroupCells + uint16 f147_getGroupDirections(Group *group, int16 mapIndex); // @ F0147_DUNGEON_GetGroupDirections + int16 f176_getCreatureOrdinalInCell(Group *group, uint16 cell); // @ F0176_GROUP_GetCreatureOrdinalInCell + uint16 M50_getCreatureValue(uint16 groupVal, uint16 creatureIndex); // @ M50_CREATURE_VALUE }; diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp index 8118356bd0..1d1eb5e8c9 100644 --- a/engines/dm/inventory.cpp +++ b/engines/dm/inventory.cpp @@ -50,36 +50,36 @@ InventoryMan::InventoryMan(DMEngine *vm) : _vm(vm) { _g426_openChest = Thing::_none; } -void InventoryMan::toggleInventory(ChampionIndex championIndex) { +void InventoryMan::f355_toggleInventory(ChampionIndex championIndex) { ChampionMan &cm = *_vm->_championMan; EventManager &em = *_vm->_eventMan; DisplayMan &dm = *_vm->_displayMan; - if ((championIndex != k4_ChampionCloseInventory) && !cm._champions[championIndex]._currHealth) + if ((championIndex != k4_ChampionCloseInventory) && !cm._gK71_champions[championIndex]._currHealth) return; if (_vm->_g331_pressingEye || _vm->_g333_pressingMouth) return; _vm->_g321_stopWaitingForPlayerInput = true; int16 invChampOrdinal = _g432_inventoryChampionOrdinal; // copy, as the original will be edited - if (_vm->indexToOrdinal(championIndex) == invChampOrdinal) { + if (_vm->M0_indexToOrdinal(championIndex) == invChampOrdinal) { championIndex = k4_ChampionCloseInventory; } Champion *champion; if (invChampOrdinal) { - _g432_inventoryChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone); - closeChest(); - champion = &cm._champions[_vm->ordinalToIndex(invChampOrdinal)]; + _g432_inventoryChampionOrdinal = _vm->M0_indexToOrdinal(kM1_ChampionNone); + f334_closeChest(); + champion = &cm._gK71_champions[_vm->M1_ordinalToIndex(invChampOrdinal)]; if (champion->_currHealth && !cm._g299_candidateChampionOrdinal) { champion->setAttributeFlag(k0x1000_ChampionAttributeStatusBox, true); - cm.drawChampionState((ChampionIndex)_vm->ordinalToIndex(invChampOrdinal)); + cm.f292_drawChampionState((ChampionIndex)_vm->M1_ordinalToIndex(invChampOrdinal)); } if (cm._g300_partyIsSleeping) { return; } if (championIndex == k4_ChampionCloseInventory) { em._g326_refreshMousePointerInMainLoop = true; - _vm->_menuMan->drawMovementArrows(); + _vm->_menuMan->f395_drawMovementArrows(); em._g442_secondaryMouseInput = g448_SecondaryMouseInput_Movement; warning("MISSING CODE: set G0444_ps_SecondaryKeyboardInput"); warning("MISSING CODE: F0357_COMMAND_DiscardAllInput"); @@ -88,22 +88,22 @@ void InventoryMan::toggleInventory(ChampionIndex championIndex) { } dm._g578_useByteBoxCoordinates = false; - _g432_inventoryChampionOrdinal = _vm->indexToOrdinal(championIndex); + _g432_inventoryChampionOrdinal = _vm->M0_indexToOrdinal(championIndex); if (!invChampOrdinal) { warning("MISSING CODE: F0136_VIDEO_ShadeScreenBox"); } - champion = &cm._champions[championIndex]; - dm.loadIntoBitmap(k17_InventoryGraphicIndice, dm._g296_bitmapViewport); + champion = &cm._gK71_champions[championIndex]; + dm.f466_loadIntoBitmap(k17_InventoryGraphicIndice, dm._g296_bitmapViewport); if (cm._g299_candidateChampionOrdinal) { dm.f135_fillBoxBitmap(dm._g296_bitmapViewport, g41_BoxFloppyZzzCross, k12_ColorDarkestGray, k112_byteWidthViewport * 2, k136_heightViewport); } - _vm->_textMan->printToViewport(5, 116, k13_ColorLightestGray, "HEALTH"); - _vm->_textMan->printToViewport(5, 124, k13_ColorLightestGray, "STAMINA"); - _vm->_textMan->printToViewport(5, 132, k13_ColorLightestGray, "MANA"); + _vm->_textMan->f52_printToViewport(5, 116, k13_ColorLightestGray, "HEALTH"); + _vm->_textMan->f52_printToViewport(5, 124, k13_ColorLightestGray, "STAMINA"); + _vm->_textMan->f52_printToViewport(5, 132, k13_ColorLightestGray, "MANA"); for (uint16 slotIndex = k0_ChampionSlotReadyHand; slotIndex < k30_ChampionSlotChest_1; slotIndex++) { - _vm->_championMan->drawSlot(championIndex, (ChampionSlot)slotIndex); + _vm->_championMan->f291_drawSlot(championIndex, (ChampionSlot)slotIndex); } champion->setAttributeFlag(k0x4000_ChampionAttributeViewport, true); @@ -113,14 +113,14 @@ void InventoryMan::toggleInventory(ChampionIndex championIndex) { champion->setAttributeFlag(k0x0100_ChampionAttributeStatistics, true); champion->setAttributeFlag(k0x0080_ChampionAttributeNameTitle, true); - cm.drawChampionState(championIndex); + cm.f292_drawChampionState(championIndex); em._g598_mousePointerBitmapUpdated = true; em._g442_secondaryMouseInput = g449_SecondaryMouseInput_ChampionInventory; warning("MISSING CODE: set G0444_ps_SecondaryKeyboardInput"); warning("MISSING CODE: F0357_COMMAND_DiscardAllInput"); } -void InventoryMan::drawStatusBoxPortrait(ChampionIndex championIndex) { +void InventoryMan::f354_drawStatusBoxPortrait(ChampionIndex championIndex) { DisplayMan &dispMan = *_vm->_displayMan; dispMan._g578_useByteBoxCoordinates = false; Box box; @@ -128,21 +128,21 @@ void InventoryMan::drawStatusBoxPortrait(ChampionIndex championIndex) { box._y2 = 28 + 1; box._x1 = championIndex * k69_ChampionStatusBoxSpacing + 7; box._x2 = box._x1 + 31 + 1; - dispMan.blitToBitmap(_vm->_championMan->_champions[championIndex]._portrait, 32, 0, 0, + dispMan.f132_blitToBitmap(_vm->_championMan->_gK71_champions[championIndex]._portrait, 32, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, box, k255_ColorNoTransparency); } -void InventoryMan::drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Color color) { +void InventoryMan::f343_drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Color color) { Box box; box._x1 = x; box._x2 = box._x1 + pixelWidth + 1; box._y1 = y; box._y2 = box._y1 + 6 + 1; _vm->_displayMan->_g578_useByteBoxCoordinates = false; - _vm->_displayMan->clearScreenBox(color, box); + _vm->_displayMan->D24_clearScreenBox(color, box); } -void InventoryMan::drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color) { +void InventoryMan::f344_drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color) { if (amount < -512) { color = k8_ColorRed; } else if (amount < 0) { @@ -154,45 +154,45 @@ void InventoryMan::drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color) { pixelWidth = 3071; } pixelWidth /= 32; - drawPanelHorizontalBar(115, y + 2, pixelWidth, k0_ColorBlack); - drawPanelHorizontalBar(113, y, pixelWidth, color); + f343_drawPanelHorizontalBar(115, y + 2, pixelWidth, k0_ColorBlack); + f343_drawPanelHorizontalBar(113, y, pixelWidth, color); } -void InventoryMan::drawPanelFoodWaterPoisoned() { - Champion &champ = _vm->_championMan->_champions[_g432_inventoryChampionOrdinal]; - closeChest(); +void InventoryMan::f345_drawPanelFoodWaterPoisoned() { + Champion &champ = _vm->_championMan->_gK71_champions[_g432_inventoryChampionOrdinal]; + f334_closeChest(); DisplayMan &dispMan = *_vm->_displayMan; - dispMan.blitToBitmap(dispMan.getBitmap(k20_PanelEmptyIndice), 144, 0, 0, + dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k20_PanelEmptyIndice), 144, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g32_BoxPanel, k8_ColorRed); - dispMan.blitToBitmap(dispMan.getBitmap(k30_FoodLabelIndice), 48, 0, 0, + dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k30_FoodLabelIndice), 48, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g35_BoxFood, k12_ColorDarkestGray); - dispMan.blitToBitmap(dispMan.getBitmap(k31_WaterLabelIndice), 48, 0, 0, + dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k31_WaterLabelIndice), 48, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g36_BoxWater, k12_ColorDarkestGray); if (champ._poisonEventCount) { - dispMan.blitToBitmap(dispMan.getBitmap(k32_PoisionedLabelIndice), 96, 0, 0, + dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k32_PoisionedLabelIndice), 96, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g37_BoxPoisoned, k12_ColorDarkestGray); } - drawPanelFoodOrWaterBar(champ._food, 69, k5_ColorLightBrown); - drawPanelFoodOrWaterBar(champ._water, 92, k14_ColorBlue); + f344_drawPanelFoodOrWaterBar(champ._food, 69, k5_ColorLightBrown); + f344_drawPanelFoodOrWaterBar(champ._water, 92, k14_ColorBlue); } -void InventoryMan::drawPanelResurrectReincarnate() { +void InventoryMan::f346_drawPanelResurrectReincarnate() { _g424_panelContent = k5_PanelContentResurrectReincarnate; - _vm->_displayMan->blitToBitmap(_vm->_displayMan->getBitmap(k40_PanelResurectReincaranteIndice), 144, 0, 0, + _vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->f489_getBitmap(k40_PanelResurectReincaranteIndice), 144, 0, 0, _vm->_displayMan->_g296_bitmapViewport, k112_byteWidthViewport * 2, g32_BoxPanel, k6_ColorDarkGreen); } -void InventoryMan::drawPanel() { +void InventoryMan::f347_drawPanel() { warning("possible reintroduction of BUG0_48"); - closeChest(); // possibility of BUG0_48 + f334_closeChest(); // possibility of BUG0_48 ChampionMan &cm = *_vm->_championMan; if (cm._g299_candidateChampionOrdinal) { - drawPanelResurrectReincarnate(); + f346_drawPanelResurrectReincarnate(); return; } - Thing thing = cm._champions[_vm->ordinalToIndex(_g432_inventoryChampionOrdinal)].getSlot(k1_ChampionSlotActionHand); + Thing thing = cm._gK71_champions[_vm->M1_ordinalToIndex(_g432_inventoryChampionOrdinal)].getSlot(k1_ChampionSlotActionHand); _g424_panelContent = k0_PanelContentFoodWaterPoisoned; switch (thing.getType()) { @@ -207,19 +207,19 @@ void InventoryMan::drawPanel() { break; } if (thing == Thing::_none) { - drawPanelFoodWaterPoisoned(); + f345_drawPanelFoodWaterPoisoned(); } else { - drawPanelObject(thing, false); + f342_drawPanelObject(thing, false); } } -void InventoryMan::closeChest() { +void InventoryMan::f334_closeChest() { DungeonMan &dunMan = *_vm->_dungeonMan; bool processFirstChestSlot = true; if (_g426_openChest == Thing::_none) return; - Container *container = (Container*)dunMan.getThingData(_g426_openChest); + Container *container = (Container*)dunMan.f156_getThingData(_g426_openChest); _g426_openChest = Thing::_none; container->getSlot() = Thing::_endOfList; Thing prevThing; @@ -230,17 +230,17 @@ void InventoryMan::closeChest() { if (processFirstChestSlot) { processFirstChestSlot = false; - *dunMan.getThingData(thing) = Thing::_endOfList.toUint16(); + *dunMan.f156_getThingData(thing) = Thing::_endOfList.toUint16(); container->getSlot() = prevThing = thing; } else { - dunMan.linkThingToList(thing, prevThing, kM1_MapXNotOnASquare, 0); + dunMan.f163_linkThingToList(thing, prevThing, kM1_MapXNotOnASquare, 0); prevThing = thing; } } } } -void InventoryMan::drawPanelScrollTextLine(int16 yPos, char* text) { +void InventoryMan::f340_drawPanelScrollTextLine(int16 yPos, char* text) { warning("CHANGE5_03_IMPROVEMENT"); for (char* iter = text; *iter != '\0'; ++iter) { if ((*iter >= 'A') && (*iter <= 'Z')) { @@ -249,20 +249,20 @@ void InventoryMan::drawPanelScrollTextLine(int16 yPos, char* text) { *iter -= 96; } } - _vm->_textMan->printToViewport(162 - (6 * strlen(text) / 2), yPos, k0_ColorBlack, text, k15_ColorWhite); + _vm->_textMan->f52_printToViewport(162 - (6 * strlen(text) / 2), yPos, k0_ColorBlack, text, k15_ColorWhite); } -void InventoryMan::drawPanelScroll(Scroll* scroll) { +void InventoryMan::f341_drawPanelScroll(Scroll* scroll) { DisplayMan &dispMan = *_vm->_displayMan; char stringFirstLine[300]; - _vm->_dungeonMan->decodeText(stringFirstLine, Thing(scroll->getTextStringThingIndex()), (TextType)(k2_TextTypeScroll | k0x8000_DecodeEvenIfInvisible)); + _vm->_dungeonMan->f168_decodeText(stringFirstLine, Thing(scroll->getTextStringThingIndex()), (TextType)(k2_TextTypeScroll | k0x8000_DecodeEvenIfInvisible)); char *charRed = stringFirstLine; while (*charRed && (*charRed != '\n')) { charRed++; } *charRed = '\0'; - dispMan.blitToBitmap(dispMan.getBitmap(k23_PanelOpenScrollIndice), 144, 0, 0, dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, g32_BoxPanel, k8_ColorRed); + dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k23_PanelOpenScrollIndice), 144, 0, 0, dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, g32_BoxPanel, k8_ColorRed); int16 lineCount = 1; charRed++; char *charGreen = charRed; // first char of the second line @@ -283,7 +283,7 @@ void InventoryMan::drawPanelScroll(Scroll* scroll) { lineCount--; } int16 yPos = 92 - (7 * lineCount) / 2; // center the text vertically - drawPanelScrollTextLine(yPos, stringFirstLine); + f340_drawPanelScrollTextLine(yPos, stringFirstLine); charGreen = charRed; while (*charGreen) { yPos += 7; @@ -294,12 +294,12 @@ void InventoryMan::drawPanelScroll(Scroll* scroll) { charRed[1] = '\0'; } *charRed++ = '\0'; - drawPanelScrollTextLine(yPos, charGreen); + f340_drawPanelScrollTextLine(yPos, charGreen); charGreen = charRed; } } -void InventoryMan::openAndDrawChest(Thing thingToOpen, Container* chest, bool isPressingEye) { +void InventoryMan::f333_openAndDrawChest(Thing thingToOpen, Container* chest, bool isPressingEye) { DisplayMan &dispMan = *_vm->_displayMan; ObjectMan &objMan = *_vm->_objectMan; @@ -308,13 +308,13 @@ void InventoryMan::openAndDrawChest(Thing thingToOpen, Container* chest, bool is warning("CHANGE8_09_FIX"); if (_g426_openChest != Thing::_none) - closeChest(); // CHANGE8_09_FIX + f334_closeChest(); // CHANGE8_09_FIX _g426_openChest = thingToOpen; if (!isPressingEye) { - objMan.drawIconInSlotBox(k9_SlotBoxInventoryActionHand, k145_IconIndiceContainerChestOpen); + objMan.f38_drawIconInSlotBox(k9_SlotBoxInventoryActionHand, k145_IconIndiceContainerChestOpen); } - dispMan.blitToBitmap(dispMan.getBitmap(k25_PanelOpenChestIndice), 144, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g32_BoxPanel, k8_ColorRed); + dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k25_PanelOpenChestIndice), 144, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g32_BoxPanel, k8_ColorRed); int16 chestSlotIndex = 0; Thing thing = chest->getSlot(); @@ -324,27 +324,27 @@ void InventoryMan::openAndDrawChest(Thing thingToOpen, Container* chest, bool is if (++thingCount > 8) break; // CHANGE8_08_FIX, make sure that no more than the first 8 objects in a chest are drawn - objMan.drawIconInSlotBox(chestSlotIndex + k38_SlotBoxChestFirstSlot, objMan.getIconIndex(thing)); + objMan.f38_drawIconInSlotBox(chestSlotIndex + k38_SlotBoxChestFirstSlot, objMan.f33_getIconIndex(thing)); _g425_chestSlots[chestSlotIndex++] = thing; - thing = _vm->_dungeonMan->getNextThing(thing); + thing = _vm->_dungeonMan->f159_getNextThing(thing); } while (chestSlotIndex < 8) { - objMan.drawIconInSlotBox(chestSlotIndex + k38_SlotBoxChestFirstSlot, kM1_IconIndiceNone); + objMan.f38_drawIconInSlotBox(chestSlotIndex + k38_SlotBoxChestFirstSlot, kM1_IconIndiceNone); _g425_chestSlots[chestSlotIndex++] = Thing::_none; } } -void InventoryMan::drawIconToViewport(IconIndice iconIndex, int16 xPos, int16 yPos) { +void InventoryMan::f332_drawIconToViewport(IconIndice iconIndex, int16 xPos, int16 yPos) { static byte iconBitmap[16 * 16]; Box box; box._x2 = (box._x1 = xPos) + 15 + 1; box._y2 = (box._y1 = yPos) + 15 + 1; - _vm->_objectMan->extractIconFromBitmap(iconIndex, iconBitmap); - _vm->_displayMan->blitToBitmap(iconBitmap, 16, 0, 0, _vm->_displayMan->_g296_bitmapViewport, + _vm->_objectMan->f36_extractIconFromBitmap(iconIndex, iconBitmap); + _vm->_displayMan->f132_blitToBitmap(iconBitmap, 16, 0, 0, _vm->_displayMan->_g296_bitmapViewport, k112_byteWidthViewport * 2, box, k255_ColorNoTransparency); } -void InventoryMan::buildObjectAttributeString(int16 potentialAttribMask, int16 actualAttribMask, char** attribStrings, char* destString, char* prefixString, char* suffixString) { +void InventoryMan::f336_buildObjectAttributeString(int16 potentialAttribMask, int16 actualAttribMask, char** attribStrings, char* destString, char* prefixString, char* suffixString) { uint16 identicalBitCount = 0; int16 attribMask = 1; for (uint16 stringIndex = 0; stringIndex < 16; stringIndex++, attribMask <<= 1) { @@ -375,7 +375,7 @@ void InventoryMan::buildObjectAttributeString(int16 potentialAttribMask, int16 a strcat(destString, suffixString); } -void InventoryMan::drawPanelObjectDescriptionString(char* descString) { +void InventoryMan::f335_drawPanelObjectDescriptionString(char* descString) { if (descString[0] == '\f') { // form feed descString++; _g421_objDescTextXpos = 108; @@ -399,7 +399,7 @@ void InventoryMan::drawPanelObjectDescriptionString(char* descString) { severalLines = true; } - _vm->_textMan->printToViewport(_g421_objDescTextXpos, _g422_objDescTextYpos, k13_ColorLightestGray, stringLine); + _vm->_textMan->f52_printToViewport(_g421_objDescTextXpos, _g422_objDescTextYpos, k13_ColorLightestGray, stringLine); _g422_objDescTextYpos += 7; if (severalLines) { severalLines = false; @@ -413,9 +413,9 @@ void InventoryMan::drawPanelObjectDescriptionString(char* descString) { Box g33_BoxArrowOrEye = Box(83, 98, 57, 65); // @ G0033_s_Graphic562_Box_ArrowOrEye -void InventoryMan::drawPanelArrowOrEye(bool pressingEye) { +void InventoryMan::f339_drawPanelArrowOrEye(bool pressingEye) { DisplayMan &dispMan = *_vm->_displayMan; - dispMan.blitToBitmap(dispMan.getBitmap(pressingEye ? k19_EyeForObjectDescriptionIndice : k18_ArrowForChestContentIndice), + dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(pressingEye ? k19_EyeForObjectDescriptionIndice : k18_ArrowForChestContentIndice), 16, 0, 0, dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, g33_BoxArrowOrEye, k8_ColorRed); } @@ -427,7 +427,7 @@ Box g34_BoxObjectDescCircle = Box(105, 136, 53, 79); // @ G0034_s_Graphic562_Box #define k0x0004_DescriptionMaskBroken 0x0004 // @ MASK0x0004_DESCRIPTION_BROKEN #define k0x0008_DescriptionMaskCursed 0x0008 // @ MASK0x0008_DESCRIPTION_CURSED -void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) { +void InventoryMan::f342_drawPanelObject(Thing thingToDraw, bool pressingEye) { DungeonMan &dunMan = *_vm->_dungeonMan; ObjectMan &objMan = *_vm->_objectMan; DisplayMan &dispMan = *_vm->_displayMan; @@ -436,34 +436,34 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) { if (_vm->_g331_pressingEye || _vm->_g333_pressingMouth) { warning("BUG0_48 The contents of a chest are reorganized when an object with a statistic modifier is placed or removed on a champion"); - closeChest(); + f334_closeChest(); } - uint16 *rawThingPtr = dunMan.getThingData(thingToDraw); - drawPanelObjectDescriptionString("\f"); // form feed + uint16 *rawThingPtr = dunMan.f156_getThingData(thingToDraw); + f335_drawPanelObjectDescriptionString("\f"); // form feed ThingType thingType = thingToDraw.getType(); if (thingType == k7_ScrollThingType) { - drawPanelScroll((Scroll*)rawThingPtr); + f341_drawPanelScroll((Scroll*)rawThingPtr); } else if (thingType == k9_ContainerThingType) { - openAndDrawChest(thingToDraw, (Container*)rawThingPtr, pressingEye); + f333_openAndDrawChest(thingToDraw, (Container*)rawThingPtr, pressingEye); } else { - IconIndice iconIndex = objMan.getIconIndex(thingToDraw); - dispMan.blitToBitmap(dispMan.getBitmap(k20_PanelEmptyIndice), 144, 0, 0, + IconIndice iconIndex = objMan.f33_getIconIndex(thingToDraw); + dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k20_PanelEmptyIndice), 144, 0, 0, dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, g32_BoxPanel, k8_ColorRed); - dispMan.blitToBitmap(dispMan.getBitmap(k29_ObjectDescCircleIndice), 32, 0, 0, + dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k29_ObjectDescCircleIndice), 32, 0, 0, dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, g34_BoxObjectDescCircle, k12_ColorDarkestGray); char *descString = nullptr; char str[40]; if (iconIndex == k147_IconIndiceJunkChampionBones) { - strcpy(str, champMan._champions[((Junk*)rawThingPtr)->getChargeCount()]._name); // TODO: localization + strcpy(str, champMan._gK71_champions[((Junk*)rawThingPtr)->getChargeCount()]._name); // TODO: localization strcat(str, " "); // TODO: localization strcat(str, objMan._g352_objectNames[iconIndex]); // TODO: localization descString = str; } else if ((thingType == k8_PotionThingType) && (iconIndex != k163_IconIndicePotionWaterFlask) - && (champMan.getSkillLevel((ChampionIndex)_vm->ordinalToIndex(_g432_inventoryChampionOrdinal), k2_ChampionSkillPriest) > 1)) { + && (champMan.f303_getSkillLevel((ChampionIndex)_vm->M1_ordinalToIndex(_g432_inventoryChampionOrdinal), k2_ChampionSkillPriest) > 1)) { str[0] = '_' + ((Potion*)rawThingPtr)->getPower() / 40; str[1] = ' '; str[2] = '\0'; @@ -473,8 +473,8 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) { descString = objMan._g352_objectNames[iconIndex]; } - textMan.printToViewport(134, 68, k13_ColorLightestGray, descString); - drawIconToViewport(iconIndex, 111, 59); + textMan.f52_printToViewport(134, 68, k13_ColorLightestGray, descString); + f332_drawIconToViewport(iconIndex, 111, 59); char *attribString[4] = {"CONSUMABLE", "POISONED", "BROKEN", "CURSED"}; // TODO: localization @@ -490,7 +490,7 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) { if ((iconIndex >= k4_IconIndiceWeaponTorchUnlit) && (iconIndex <= k7_IconIndiceWeaponTorchLit) && (weapon->getChargeCount() == 0)) { - drawPanelObjectDescriptionString("(BURNT OUT)"); // TODO: localization + f335_drawPanelObjectDescriptionString("(BURNT OUT)"); // TODO: localization } break; } @@ -524,13 +524,13 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) { descString = "(FULL)"; // TODO: localization break; } - drawPanelObjectDescriptionString(descString); + f335_drawPanelObjectDescriptionString(descString); } else if ((iconIndex >= k0_IconIndiceJunkCompassNorth) && (iconIndex <= k3_IconIndiceJunkCompassWest)) { potentialAttribMask = 0; strcpy(str, "PARTY FACING "); // TODO: localization static char* directionName[4] = {"NORTH", "EAST", "SOUTH", "WEST"}; // G0430_apc_DirectionNames // TODO: localization strcat(str, directionName[iconIndex]); - drawPanelObjectDescriptionString(str); + f335_drawPanelObjectDescriptionString(str); } else { potentialAttribMask = k0x0001_DescriptionMaskConsumable; actualAttribMask = g237_ObjectInfo[k127_ObjectInfoIndexFirstJunk + junk->getType()].getAllowedSlots(); @@ -540,25 +540,25 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) { } // end of switch if (potentialAttribMask) { - buildObjectAttributeString(potentialAttribMask, actualAttribMask, attribString, str, "(", ")"); - drawPanelObjectDescriptionString(str); + f336_buildObjectAttributeString(potentialAttribMask, actualAttribMask, attribString, str, "(", ")"); + f335_drawPanelObjectDescriptionString(str); } strcpy(str, "WEIGHS "); // TODO: localization - uint16 weight = dunMan.getObjectWeight(thingToDraw); - strcat(str, champMan.getStringFromInteger(weight / 10, false, 3).c_str()); + uint16 weight = dunMan.f140_getObjectWeight(thingToDraw); + strcat(str, champMan.f288_getStringFromInteger(weight / 10, false, 3).c_str()); strcat(str, "."); // TODO: localization weight -= (weight / 10) * 10; - strcat(str, champMan.getStringFromInteger(weight, false, 1).c_str()); + strcat(str, champMan.f288_getStringFromInteger(weight, false, 1).c_str()); strcat(str, " KG."); // TODO: localization - drawPanelObjectDescriptionString(str); + f335_drawPanelObjectDescriptionString(str); } - drawPanelArrowOrEye(pressingEye); + f339_drawPanelArrowOrEye(pressingEye); } } diff --git a/engines/dm/inventory.h b/engines/dm/inventory.h index 82865f5cc5..df429af70b 100644 --- a/engines/dm/inventory.h +++ b/engines/dm/inventory.h @@ -61,23 +61,23 @@ public: int16 _g421_objDescTextXpos; // @ G0421_i_ObjectDescriptionTextX int16 _g422_objDescTextYpos; // @ G0422_i_ObjectDescriptionTextY - void toggleInventory(ChampionIndex championIndex); // @ F0355_INVENTORY_Toggle_CPSE - void drawStatusBoxPortrait(ChampionIndex championIndex); // @ F0354_INVENTORY_DrawStatusBoxPortrait - void drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Color color); // @ F0343_INVENTORY_DrawPanel_HorizontalBar - void drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color); // @ F0344_INVENTORY_DrawPanel_FoodOrWaterBar - void drawPanelFoodWaterPoisoned(); // @ F0345_INVENTORY_DrawPanel_FoodWaterPoisoned - void drawPanelResurrectReincarnate(); // @ F0346_INVENTORY_DrawPanel_ResurrectReincarnate - void drawPanel(); // @ F0347_INVENTORY_DrawPanel - void closeChest(); // @ F0334_INVENTORY_CloseChest - void drawPanelScrollTextLine(int16 yPos, char *text); // @ F0340_INVENTORY_DrawPanel_ScrollTextLine - void drawPanelScroll(Scroll *scoll); // @ F0341_INVENTORY_DrawPanel_Scroll - void openAndDrawChest(Thing thingToOpen, Container *chest, bool isPressingEye); // @ F0333_INVENTORY_OpenAndDrawChest - void drawIconToViewport(IconIndice iconIndex, int16 xPos, int16 yPos); // @ F0332_INVENTORY_DrawIconToViewport - void buildObjectAttributeString(int16 potentialAttribMask, int16 actualAttribMask, char ** attribStrings, + void f355_toggleInventory(ChampionIndex championIndex); // @ F0355_INVENTORY_Toggle_CPSE + void f354_drawStatusBoxPortrait(ChampionIndex championIndex); // @ F0354_INVENTORY_DrawStatusBoxPortrait + void f343_drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Color color); // @ F0343_INVENTORY_DrawPanel_HorizontalBar + void f344_drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color); // @ F0344_INVENTORY_DrawPanel_FoodOrWaterBar + void f345_drawPanelFoodWaterPoisoned(); // @ F0345_INVENTORY_DrawPanel_FoodWaterPoisoned + void f346_drawPanelResurrectReincarnate(); // @ F0346_INVENTORY_DrawPanel_ResurrectReincarnate + void f347_drawPanel(); // @ F0347_INVENTORY_DrawPanel + void f334_closeChest(); // @ F0334_INVENTORY_CloseChest + void f340_drawPanelScrollTextLine(int16 yPos, char *text); // @ F0340_INVENTORY_DrawPanel_ScrollTextLine + void f341_drawPanelScroll(Scroll *scoll); // @ F0341_INVENTORY_DrawPanel_Scroll + void f333_openAndDrawChest(Thing thingToOpen, Container *chest, bool isPressingEye); // @ F0333_INVENTORY_OpenAndDrawChest + void f332_drawIconToViewport(IconIndice iconIndex, int16 xPos, int16 yPos); // @ F0332_INVENTORY_DrawIconToViewport + void f336_buildObjectAttributeString(int16 potentialAttribMask, int16 actualAttribMask, char ** attribStrings, char *destString, char *prefixString, char *suffixString); // @ F0336_INVENTORY_DrawPanel_BuildObjectAttributesString - void drawPanelObjectDescriptionString(char *descString); // @ F0335_INVENTORY_DrawPanel_ObjectDescriptionString - void drawPanelArrowOrEye(bool pressingEye); // @ F0339_INVENTORY_DrawPanel_ArrowOrEye - void drawPanelObject(Thing thingToDraw, bool pressingEye); // @ F0342_INVENTORY_DrawPanel_Object + void f335_drawPanelObjectDescriptionString(char *descString); // @ F0335_INVENTORY_DrawPanel_ObjectDescriptionString + void f339_drawPanelArrowOrEye(bool pressingEye); // @ F0339_INVENTORY_DrawPanel_ArrowOrEye + void f342_drawPanelObject(Thing thingToDraw, bool pressingEye); // @ F0342_INVENTORY_DrawPanel_Object }; diff --git a/engines/dm/loadsave.cpp b/engines/dm/loadsave.cpp index a0cd569c37..81a914c040 100644 --- a/engines/dm/loadsave.cpp +++ b/engines/dm/loadsave.cpp @@ -38,30 +38,30 @@ namespace DM { LoadsaveMan::LoadsaveMan(DMEngine *vm) : _vm(vm) {} -LoadgameResponse LoadsaveMan::loadgame() { +LoadgameResponse LoadsaveMan::f435_loadgame() { bool newGame = _vm->_g298_newGame; ChampionMan &cm = *_vm->_championMan; if (newGame) { _vm->_g524_restartGameAllowed = false; cm._g305_partyChampionCount = 0; - cm._414_leaderHandObject = Thing::_none; + cm._g414_leaderHandObject = Thing::_none; _vm->_g525_gameId = _vm->_rnd->getRandomNumber(65536) * _vm->_rnd->getRandomNumber(65536); } else { assert(false); // MISSING CODE: load game } - _vm->_dungeonMan->loadDungeonFile(); + _vm->_dungeonMan->f434_loadDungeonFile(); if (newGame) { - _vm->_timeline->initTimeline(); - _vm->_groupMan->initActiveGroups(); + _vm->_timeline->f233_initTimeline(); + _vm->_groupMan->f196_initActiveGroups(); } else { assert(false); // MISSING CODE: load game } - cm._303_partyDead = false; + cm._g303_partyDead = false; return k1_LoadgameSuccess; } diff --git a/engines/dm/loadsave.h b/engines/dm/loadsave.h index 0ee7118582..c45b111ac9 100644 --- a/engines/dm/loadsave.h +++ b/engines/dm/loadsave.h @@ -42,7 +42,7 @@ class LoadsaveMan { public: explicit LoadsaveMan(DMEngine *vm); - LoadgameResponse loadgame(); // @ F0435_STARTEND_LoadGame_CPSF + LoadgameResponse f435_loadgame(); // @ F0435_STARTEND_LoadGame_CPSF }; } diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp index a512a90d07..1d93895e09 100644 --- a/engines/dm/menus.cpp +++ b/engines/dm/menus.cpp @@ -58,30 +58,30 @@ MenuMan::~MenuMan() { delete[] _gK72_bitmapSpellAreaLine; } -void MenuMan::drawMovementArrows() { +void MenuMan::f395_drawMovementArrows() { DisplayMan &disp = *_vm->_displayMan; - byte *arrowsBitmap = disp.getBitmap(k13_MovementArrowsIndice); + byte *arrowsBitmap = disp.f489_getBitmap(k13_MovementArrowsIndice); Box &dest = g2_BoxMovementArrows; uint16 w = disp.getWidth(k13_MovementArrowsIndice); - disp.blitToBitmap(arrowsBitmap, w, 0, 0, disp._g348_bitmapScreen, k160_byteWidthScreen * 2, dest, k255_ColorNoTransparency); + disp.f132_blitToBitmap(arrowsBitmap, w, 0, 0, disp._g348_bitmapScreen, k160_byteWidthScreen * 2, dest, k255_ColorNoTransparency); } -void MenuMan::clearActingChampion() { +void MenuMan::f388_clearActingChampion() { ChampionMan &cm = *_vm->_championMan; if (cm._g506_actingChampionOrdinal) { cm._g506_actingChampionOrdinal--; - cm._champions[cm._g506_actingChampionOrdinal].setAttributeFlag(k0x8000_ChampionAttributeActionHand, true); - cm.drawChampionState((ChampionIndex)cm._g506_actingChampionOrdinal); - cm._g506_actingChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone); + cm._gK71_champions[cm._g506_actingChampionOrdinal].setAttributeFlag(k0x8000_ChampionAttributeActionHand, true); + cm.f292_drawChampionState((ChampionIndex)cm._g506_actingChampionOrdinal); + cm._g506_actingChampionOrdinal = _vm->M0_indexToOrdinal(kM1_ChampionNone); _g508_refreshActionArea = true; } } -void MenuMan::drawActionIcon(ChampionIndex championIndex) { +void MenuMan::f386_drawActionIcon(ChampionIndex championIndex) { if (!_g509_actionAreaContainsIcons) return; DisplayMan &dm = *_vm->_displayMan; - Champion &champion = _vm->_championMan->_champions[championIndex]; + Champion &champion = _vm->_championMan->_gK71_champions[championIndex]; Box box; box._x1 = championIndex * 22 + 233; @@ -90,7 +90,7 @@ void MenuMan::drawActionIcon(ChampionIndex championIndex) { box._y2 = 120 + 1; dm._g578_useByteBoxCoordinates = false; if (!champion._currHealth) { - dm.clearScreenBox(k0_ColorBlack, box); + dm.D24_clearScreenBox(k0_ColorBlack, box); return; } byte *bitmapIcon = dm._g74_tmpBitmap; @@ -98,34 +98,34 @@ void MenuMan::drawActionIcon(ChampionIndex championIndex) { IconIndice iconIndex; if (thing == Thing::_none) { iconIndex = k201_IconIndiceActionEmptyHand; - } else if (g237_ObjectInfo[_vm->_dungeonMan->getObjectInfoIndex(thing)]._actionSetIndex) { - iconIndex = _vm->_objectMan->getIconIndex(thing); + } else if (g237_ObjectInfo[_vm->_dungeonMan->f141_getObjectInfoIndex(thing)]._actionSetIndex) { + iconIndex = _vm->_objectMan->f33_getIconIndex(thing); } else { dm.f134_fillBitmap(bitmapIcon, 16, 16, k4_ColorCyan); goto T0386006; } - _vm->_objectMan->extractIconFromBitmap(iconIndex, bitmapIcon); - dm.blitToBitmapShrinkWithPalChange(bitmapIcon, 16, 16, bitmapIcon, 16, 16, g498_PalChangesActionAreaObjectIcon); + _vm->_objectMan->f36_extractIconFromBitmap(iconIndex, bitmapIcon); + dm.f129_blitToBitmapShrinkWithPalChange(bitmapIcon, 16, 16, bitmapIcon, 16, 16, g498_PalChangesActionAreaObjectIcon); T0386006: - dm.clearScreenBox(k4_ColorCyan, box); + dm.D24_clearScreenBox(k4_ColorCyan, box); Box box2; box2._x1 = box._x1 + 2; box2._x2 = box._x2 - 2; // no need to add +1 for exclusive boundaries, box already has that box2._y1 = 95; box2._y2 = 110 + 1; - dm.blitToBitmap(bitmapIcon, 16, 0, 0, dm._g348_bitmapScreen, k160_byteWidthScreen * 2, box2); + dm.f132_blitToBitmap(bitmapIcon, 16, 0, 0, dm._g348_bitmapScreen, k160_byteWidthScreen * 2, box2); if (champion.getAttributes(k0x0008_ChampionAttributeDisableAction) || _vm->_championMan->_g299_candidateChampionOrdinal || _vm->_championMan->_g300_partyIsSleeping) { warning("MISSING CODE: F0136_VIDEO_ShadeScreenBox"); } } -void MenuMan::drawDisabledMenu() { +void MenuMan::f456_drawDisabledMenu() { if (!_vm->_championMan->_g300_partyIsSleeping) { warning("MISSING CODE: F0363_COMMAND_HighlightBoxDisable"); _vm->_displayMan->_g578_useByteBoxCoordinates = false; if (_vm->_inventoryMan->_g432_inventoryChampionOrdinal) { if (_vm->_inventoryMan->_g424_panelContent == k4_PanelContentChest) { - _vm->_inventoryMan->closeChest(); + _vm->_inventoryMan->f334_closeChest(); } } else { warning("MISSING CODE: F0136_VIDEO_ShadeScreenBox"); @@ -136,7 +136,7 @@ void MenuMan::drawDisabledMenu() { } } -void MenuMan::refreshActionAreaAndSetChampDirMaxDamageReceived() { +void MenuMan::f390_refreshActionAreaAndSetChampDirMaxDamageReceived() { ChampionMan &champMan = *_vm->_championMan; if (!champMan._g305_partyChampionCount) @@ -145,24 +145,24 @@ void MenuMan::refreshActionAreaAndSetChampDirMaxDamageReceived() { Champion *champ = nullptr; if (champMan._g300_partyIsSleeping || champMan._g299_candidateChampionOrdinal) { if (champMan._g506_actingChampionOrdinal) { - clearActingChampion(); + f388_clearActingChampion(); return; } if (!champMan._g299_candidateChampionOrdinal) return; } else { - champ = champMan._champions; + champ = champMan._gK71_champions; int16 champIndex = k0_ChampionFirst; do { if ((champIndex != champMan._g411_leaderIndex) - && (_vm->indexToOrdinal(champIndex) != champMan._g506_actingChampionOrdinal) + && (_vm->M0_indexToOrdinal(champIndex) != champMan._g506_actingChampionOrdinal) && (champ->_maximumDamageReceived) && (champ->_dir != champ->_directionMaximumDamageReceived)) { champ->_dir = (direction)champ->_directionMaximumDamageReceived; champ->setAttributeFlag(k0x0400_ChampionAttributeIcon, true); - champMan.drawChampionState((ChampionIndex)champIndex); + champMan.f292_drawChampionState((ChampionIndex)champIndex); } champ->_maximumDamageReceived = 0; champ++; @@ -177,12 +177,12 @@ void MenuMan::refreshActionAreaAndSetChampDirMaxDamageReceived() { _g513_actionDamage = 0; } else { _g509_actionAreaContainsIcons = true; - drawActionArea(); + f387_drawActionArea(); } } else { _g509_actionAreaContainsIcons = false; champ->setAttributeFlag(k0x8000_ChampionAttributeActionHand, true); - champMan.drawChampionState((ChampionIndex)_vm->ordinalToIndex(champMan._g506_actingChampionOrdinal)); + champMan.f292_drawChampionState((ChampionIndex)_vm->M1_ordinalToIndex(champMan._g506_actingChampionOrdinal)); warning("MISSING CODE: F0387_MENUS_DrawActionArea"); } } @@ -191,29 +191,29 @@ void MenuMan::refreshActionAreaAndSetChampDirMaxDamageReceived() { #define k7_ChampionNameMaximumLength 7 // @ C007_CHAMPION_NAME_MAXIMUM_LENGTH #define k12_ActionNameMaximumLength 12 // @ C012_ACTION_NAME_MAXIMUM_LENGTH -void MenuMan::drawActionArea() { +void MenuMan::f387_drawActionArea() { DisplayMan &dispMan = *_vm->_displayMan; ChampionMan &champMan = *_vm->_championMan; TextMan &textMan = *_vm->_textMan; warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE"); dispMan._g578_useByteBoxCoordinates = false; - dispMan.clearScreenBox(k0_ColorBlack, g1_BoxActionArea); + dispMan.D24_clearScreenBox(k0_ColorBlack, g1_BoxActionArea); if (_g509_actionAreaContainsIcons) { for (uint16 champIndex = k0_ChampionFirst; champIndex < champMan._g305_partyChampionCount; ++champIndex) - drawActionIcon((ChampionIndex)champIndex); + f386_drawActionIcon((ChampionIndex)champIndex); } else if (champMan._g506_actingChampionOrdinal) { Box box = g499_BoxActionArea3ActionMenu; if (_g713_actionList._actionIndices[2] == k255_ChampionActionNone) box = g500_BoxActionArea2ActionMenu; if (_g713_actionList._actionIndices[1] == k255_ChampionActionNone) box = g501_BoxActionArea1ActionMenu; - dispMan.blitToBitmap(dispMan.getBitmap(k10_MenuActionAreaIndice), 96, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, box, k255_ColorNoTransparency); - textMan.printWithTrailingSpaces(dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, 235, 83, k0_ColorBlack, k4_ColorCyan, champMan._champions[_vm->ordinalToIndex(champMan._g506_actingChampionOrdinal)]._name, + dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k10_MenuActionAreaIndice), 96, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, box, k255_ColorNoTransparency); + textMan.f41_printWithTrailingSpaces(dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, 235, 83, k0_ColorBlack, k4_ColorCyan, champMan._gK71_champions[_vm->M1_ordinalToIndex(champMan._g506_actingChampionOrdinal)]._name, k7_ChampionNameMaximumLength, k200_heightScreen); for (uint16 actionListIndex = 0; actionListIndex < 3; actionListIndex++) { - textMan.printWithTrailingSpaces(dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, 241, 93 + actionListIndex * 12, k4_ColorCyan, k0_ColorBlack, - getActionName(_g713_actionList._actionIndices[actionListIndex]), + textMan.f41_printWithTrailingSpaces(dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, 241, 93 + actionListIndex * 12, k4_ColorCyan, k0_ColorBlack, + f384_getActionName(_g713_actionList._actionIndices[actionListIndex]), k12_ActionNameMaximumLength, k200_heightScreen); } } @@ -231,24 +231,24 @@ const char *g490_ChampionActionNames[44] = { // @ G0490_ac_Graphic560_ActionName "FLUXCAGE", "HEAL", "CALM", "LIGHT", "WINDOW", "SPIT", "BRANDISH", "THROW", "FUSE"}; -const char* MenuMan::getActionName(ChampionAction actionIndex) { +const char* MenuMan::f384_getActionName(ChampionAction actionIndex) { return (actionIndex == k255_ChampionActionNone) ? "" : g490_ChampionActionNames[actionIndex]; } Box g504_BoxSpellAreaControls = Box(233, 319, 42, 49); // @ G0504_s_Graphic560_Box_SpellAreaControls -void MenuMan::drawSpellAreaControls(ChampionIndex champIndex) { +void MenuMan::f393_drawSpellAreaControls(ChampionIndex champIndex) { ChampionMan &champMan = *_vm->_championMan; DisplayMan &dispMan = *_vm->_displayMan; TextMan &textMan = *_vm->_textMan; - Champion &champ = champMan._champions[champIndex]; + Champion &champ = champMan._gK71_champions[champIndex]; int16 champCurrHealth[4]; for (uint16 i = 0; i < 4; ++i) - champCurrHealth[i] = champMan._champions[i]._currHealth; + champCurrHealth[i] = champMan._gK71_champions[i]._currHealth; warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE"); - dispMan.clearScreenBox(k0_ColorBlack, g504_BoxSpellAreaControls); + dispMan.D24_clearScreenBox(k0_ColorBlack, g504_BoxSpellAreaControls); int16 champCount = champMan._g305_partyChampionCount; switch (champIndex) { case k0_ChampionFirst: @@ -309,61 +309,61 @@ labelChamp3: #define k2_SpellAreaAvailableSymbols 2 // @ C2_SPELL_AREA_AVAILABLE_SYMBOLS #define k3_SpellAreaChampionSymbols 3 // @ C3_SPELL_AREA_CHAMPION_SYMBOLS -void MenuMan::buildSpellAreaLine(int16 spellAreaBitmapLine) { +void MenuMan::f392_buildSpellAreaLine(int16 spellAreaBitmapLine) { DisplayMan &dispMan = *_vm->_displayMan; - Champion &champ = _vm->_championMan->_champions[_vm->_championMan->_g514_magicCasterChampionIndex]; + Champion &champ = _vm->_championMan->_gK71_champions[_vm->_championMan->_g514_magicCasterChampionIndex]; if (spellAreaBitmapLine == k2_SpellAreaAvailableSymbols) { dispMan._g578_useByteBoxCoordinates = false; - dispMan.blitToBitmap(dispMan.getBitmap(k11_MenuSpellAreLinesIndice), 96, 0, 12, _gK72_bitmapSpellAreaLine, 96, gK74_BoxSpellAreaLine, k255_ColorNoTransparency); + dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k11_MenuSpellAreLinesIndice), 96, 0, 12, _gK72_bitmapSpellAreaLine, 96, gK74_BoxSpellAreaLine, k255_ColorNoTransparency); int16 x = 1; byte c = 96 + (6 * champ._symbolStep); char spellSymbolString[2] = {'\0', '\0'}; for (uint16 symbolIndex = 0; symbolIndex < 6; symbolIndex++) { spellSymbolString[0] = c++; - _vm->_textMan->printTextToBitmap(_gK72_bitmapSpellAreaLine, 96, x += 14, 8, k4_ColorCyan, k0_ColorBlack, spellSymbolString, 12); + _vm->_textMan->f40_printTextToBitmap(_gK72_bitmapSpellAreaLine, 96, x += 14, 8, k4_ColorCyan, k0_ColorBlack, spellSymbolString, 12); } } else if (spellAreaBitmapLine == k3_SpellAreaChampionSymbols) { dispMan._g578_useByteBoxCoordinates = false; - dispMan.blitToBitmap(dispMan.getBitmap(k11_MenuSpellAreLinesIndice), 96, 0, 24, _gK72_bitmapSpellAreaLine, 96, gK74_BoxSpellAreaLine, k255_ColorNoTransparency); + dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k11_MenuSpellAreLinesIndice), 96, 0, 24, _gK72_bitmapSpellAreaLine, 96, gK74_BoxSpellAreaLine, k255_ColorNoTransparency); char spellSymbolString[2] = {'\0', '\0'}; int16 x = 8; for (uint16 symbolIndex = 0; symbolIndex < 4; symbolIndex++) { if ((spellSymbolString[0] = champ._symbols[symbolIndex]) == '\0') break; - _vm->_textMan->printTextToBitmap(_gK72_bitmapSpellAreaLine, 96, x += 9, 8, k4_ColorCyan, k0_ColorBlack, spellSymbolString, 12); + _vm->_textMan->f40_printTextToBitmap(_gK72_bitmapSpellAreaLine, 96, x += 9, 8, k4_ColorCyan, k0_ColorBlack, spellSymbolString, 12); } } } -void MenuMan::setMagicCasterAndDrawSpellArea(int16 champIndex) { +void MenuMan::f394_setMagicCasterAndDrawSpellArea(int16 champIndex) { ChampionMan &champMan = *_vm->_championMan; DisplayMan &dispMan = *_vm->_displayMan; if ((champIndex == champMan._g514_magicCasterChampionIndex) - || ((champIndex != kM1_ChampionNone) && !champMan._champions[champIndex]._currHealth)) + || ((champIndex != kM1_ChampionNone) && !champMan._gK71_champions[champIndex]._currHealth)) return; if (champMan._g514_magicCasterChampionIndex == kM1_ChampionNone) { warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE"); - dispMan.blitToBitmap(dispMan.getBitmap(k9_MenuSpellAreaBackground), 96, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g0_BoxSpellArea); + dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k9_MenuSpellAreaBackground), 96, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g0_BoxSpellArea); warning("MISSING CODE: F0078_MOUSE_ShowPointer"); } if (champIndex == kM1_ChampionNone) { champMan._g514_magicCasterChampionIndex = kM1_ChampionNone; warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE"); dispMan._g578_useByteBoxCoordinates = false; - dispMan.clearScreenBox(k0_ColorBlack, g0_BoxSpellArea); + dispMan.D24_clearScreenBox(k0_ColorBlack, g0_BoxSpellArea); warning("MISSING CODE: F0078_MOUSE_ShowPointer"); return; } champMan._g514_magicCasterChampionIndex = (ChampionIndex)champIndex; - buildSpellAreaLine(k2_SpellAreaAvailableSymbols); + f392_buildSpellAreaLine(k2_SpellAreaAvailableSymbols); warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE"); - drawSpellAreaControls((ChampionIndex)champIndex); - dispMan.blitToBitmap(_gK72_bitmapSpellAreaLine, 96, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, gK75_BoxSpellAreaLine2); - buildSpellAreaLine(k3_SpellAreaChampionSymbols); - dispMan.blitToBitmap(_gK72_bitmapSpellAreaLine, 96, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, gK76_BoxSpellAreaLine3); + f393_drawSpellAreaControls((ChampionIndex)champIndex); + dispMan.f132_blitToBitmap(_gK72_bitmapSpellAreaLine, 96, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, gK75_BoxSpellAreaLine2); + f392_buildSpellAreaLine(k3_SpellAreaChampionSymbols); + dispMan.f132_blitToBitmap(_gK72_bitmapSpellAreaLine, 96, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, gK76_BoxSpellAreaLine3); warning("MISSING CODE: F0078_MOUSE_ShowPointer"); } } diff --git a/engines/dm/menus.h b/engines/dm/menus.h index 30bf01c542..ef5f86d153 100644 --- a/engines/dm/menus.h +++ b/engines/dm/menus.h @@ -60,17 +60,17 @@ public: ActionList _g713_actionList; // @ G0713_s_ActionList byte *_gK72_bitmapSpellAreaLine; // @ K0072_puc_Bitmap_SpellAreaLine - void clearActingChampion(); // @ F0388_MENUS_ClearActingChampion - void drawActionIcon(ChampionIndex championIndex); // @ F0386_MENUS_DrawActionIcon + void f388_clearActingChampion(); // @ F0388_MENUS_ClearActingChampion + void f386_drawActionIcon(ChampionIndex championIndex); // @ F0386_MENUS_DrawActionIcon - void drawMovementArrows(); // @ F0395_MENUS_DrawMovementArrows - void drawDisabledMenu(); // @ F0456_START_DrawDisabledMenus - void refreshActionAreaAndSetChampDirMaxDamageReceived(); // @ F0390_MENUS_RefreshActionAreaAndSetChampionDirectionMaximumDamageReceived - void drawActionArea(); // @ F0387_MENUS_DrawActionArea - const char* getActionName(ChampionAction actionIndex); // @ F0384_MENUS_GetActionName - void drawSpellAreaControls(ChampionIndex champIndex); // @ F0393_MENUS_DrawSpellAreaControls - void buildSpellAreaLine(int16 spellAreaBitmapLine);// @ F0392_MENUS_BuildSpellAreaLine - void setMagicCasterAndDrawSpellArea(int16 champIndex); // @ F0394_MENUS_SetMagicCasterAndDrawSpellArea + void f395_drawMovementArrows(); // @ F0395_MENUS_DrawMovementArrows + void f456_drawDisabledMenu(); // @ F0456_START_DrawDisabledMenus + void f390_refreshActionAreaAndSetChampDirMaxDamageReceived(); // @ F0390_MENUS_RefreshActionAreaAndSetChampionDirectionMaximumDamageReceived + void f387_drawActionArea(); // @ F0387_MENUS_DrawActionArea + const char* f384_getActionName(ChampionAction actionIndex); // @ F0384_MENUS_GetActionName + void f393_drawSpellAreaControls(ChampionIndex champIndex); // @ F0393_MENUS_DrawSpellAreaControls + void f392_buildSpellAreaLine(int16 spellAreaBitmapLine);// @ F0392_MENUS_BuildSpellAreaLine + void f394_setMagicCasterAndDrawSpellArea(int16 champIndex); // @ F0394_MENUS_SetMagicCasterAndDrawSpellArea }; } diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp index 5d37884557..9fab510ecf 100644 --- a/engines/dm/movesens.cpp +++ b/engines/dm/movesens.cpp @@ -37,21 +37,21 @@ namespace DM { MovesensMan::MovesensMan(DMEngine* vm) : _vm(vm) {} -bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 cellParam) { +bool MovesensMan::f275_sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 cellParam) { ChampionMan &champMan = *_vm->_championMan; DungeonMan &dunMan = *_vm->_dungeonMan; ObjectMan &objMan = *_vm->_objectMan; bool atLeastOneSensorWasTriggered = false; - Thing leaderHandObject = champMan._414_leaderHandObject; + Thing leaderHandObject = champMan._g414_leaderHandObject; int16 sensorCountToProcessPerCell[4]; uint16 cell; for (cell = k0_CellNorthWest; cell < k3_CellSouthWest; ++cell) { sensorCountToProcessPerCell[cell] = 0; } Thing squareFirstThing; - Thing thingBeingProcessed = squareFirstThing = dunMan.getSquareFirstThing(mapX, mapY); + Thing thingBeingProcessed = squareFirstThing = dunMan.f161_getSquareFirstThing(mapX, mapY); ThingType thingType; while (thingBeingProcessed != Thing::_endOfList) { thingType = thingBeingProcessed.getType(); @@ -60,7 +60,7 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 } else if (thingType >= k4_GroupThingType) { break; } - thingBeingProcessed = dunMan.getNextThing(thingBeingProcessed); + thingBeingProcessed = dunMan.f159_getNextThing(thingBeingProcessed); } Thing lastProcessedThing = thingBeingProcessed = squareFirstThing; @@ -69,7 +69,7 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 if (thingType == k3_SensorThingType) { cell = thingBeingProcessed.getCell(); sensorCountToProcessPerCell[cell]--; - Sensor *sensor = (Sensor*)dunMan.getThingData(thingBeingProcessed); // IF YOU CHECK ME, I'LL CALL THE COPS! + Sensor *sensor = (Sensor*)dunMan.f156_getThingData(thingBeingProcessed); // IF YOU CHECK ME, I'LL CALL THE COPS! SensorType sensorType = sensor->getType(); if (sensorType == k0_SensorDisabled) goto T0275058_ProceedToNextThing; @@ -96,11 +96,11 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 goto T0275058_ProceedToNextThing; case k3_SensorWallOrnClickWithSpecObj: case k4_SensorWallOrnClickWithSpecObjRemoved: - doNotTriggerSensor = ((sensorData == objMan.getObjectType(leaderHandObject)) == sensor->getRevertEffectA()); + doNotTriggerSensor = ((sensorData == objMan.f32_getObjectType(leaderHandObject)) == sensor->getRevertEffectA()); if (!doNotTriggerSensor && (sensorType == k17_SensorWallOrnClickWithSpecObjRemovedSensor)) { if (lastProcessedThing == thingBeingProcessed) break; - ((Sensor*)dunMan.getThingData(lastProcessedThing))->setNextThing(sensor->getNextThing()); + ((Sensor*)dunMan.f156_getThingData(lastProcessedThing))->setNextThing(sensor->getNextThing()); sensor->setNextThing(Thing::_none); thingBeingProcessed = lastProcessedThing; } @@ -137,8 +137,8 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 case k16_SensorWallObjExchanger: { if (sensorCountToProcessPerCell[cell]) goto T0275058_ProceedToNextThing; - Thing thingOnSquare = dunMan.getSquareFirstThing(mapX, mapY); - if ((objMan.getObjectType(leaderHandObject) != sensorData) || (thingOnSquare == Thing::_none)) + Thing thingOnSquare = dunMan.f161_getSquareFirstThing(mapX, mapY); + if ((objMan.f32_getObjectType(leaderHandObject) != sensorData) || (thingOnSquare == Thing::_none)) goto T0275058_ProceedToNextThing; warning("MISSING CODE: F0164_DUNGEON_UnlinkThingFromList"); warning("MISSING CODE: F0298_CHAMPION_GetObjectRemovedFromLeaderHand"); @@ -148,7 +148,7 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 break; } case k127_SensorWallChampionPortrait: - champMan.addCandidateChampionToParty(sensorData); + champMan.f280_addCandidateChampionToParty(sensorData); goto T0275058_ProceedToNextThing; default: goto T0275058_ProceedToNextThing; @@ -169,7 +169,7 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 (sensorType == k11_SensorWallOrnClickWithSpecObjRemovedRotateSensors) || (sensorType == k17_SensorWallOrnClickWithSpecObjRemovedSensor))) { - *((Thing*)dunMan.getThingData(leaderHandObject)) = Thing::_none; + *((Thing*)dunMan.f156_getThingData(leaderHandObject)) = Thing::_none; warning("MISSING CODE: F0298_CHAMPION_GetObjectRemovedFromLeaderHand"); leaderHandObject = Thing::_none; } else { @@ -186,7 +186,7 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 break; T0275058_ProceedToNextThing: lastProcessedThing = thingBeingProcessed; - thingBeingProcessed = dunMan.getNextThing(thingBeingProcessed); + thingBeingProcessed = dunMan.f159_getNextThing(thingBeingProcessed); } warning("MISSING CODE: F0271_SENSOR_ProcessRotationEffect"); return atLeastOneSensorWasTriggered; diff --git a/engines/dm/movesens.h b/engines/dm/movesens.h index b73f727f8b..6a8a53ac96 100644 --- a/engines/dm/movesens.h +++ b/engines/dm/movesens.h @@ -37,7 +37,7 @@ class MovesensMan { DMEngine *_vm; public: explicit MovesensMan(DMEngine *vm); - bool sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 cellParam); // @ F0275_SENSOR_IsTriggeredByClickOnWall + bool f275_sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 cellParam); // @ F0275_SENSOR_IsTriggeredByClickOnWall }; } diff --git a/engines/dm/objectman.cpp b/engines/dm/objectman.cpp index 2ce67ace6a..251401f069 100644 --- a/engines/dm/objectman.cpp +++ b/engines/dm/objectman.cpp @@ -121,11 +121,11 @@ void ObjectMan::loadObjectNames() { } } -IconIndice ObjectMan::getObjectType(Thing thing) { +IconIndice ObjectMan::f32_getObjectType(Thing thing) { if (thing == Thing::_none) return kM1_IconIndiceNone; - int16 objectInfoIndex = _vm->_dungeonMan->getObjectInfoIndex(thing); + int16 objectInfoIndex = _vm->_dungeonMan->f141_getObjectInfoIndex(thing); if (objectInfoIndex != -1) { objectInfoIndex = g237_ObjectInfo[objectInfoIndex]._type; } @@ -134,15 +134,15 @@ IconIndice ObjectMan::getObjectType(Thing thing) { byte g29_ChargeCountToTorchType[16] = {0, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3}; // @ G0029_auc_Graphic562_ChargeCountToTorchType -IconIndice ObjectMan::getIconIndex(Thing thing) { - IconIndice iconIndex = getObjectType(thing); +IconIndice ObjectMan::f33_getIconIndex(Thing thing) { + IconIndice iconIndex = f32_getObjectType(thing); if ((iconIndex != kM1_IconIndiceNone) && (((iconIndex < k32_IconIndiceWeaponDagger) && (iconIndex >= k0_IconIndiceJunkCompassNorth)) || // < instead of <= is no error ((iconIndex >= k148_IconIndicePotionMaPotionMonPotion) && (iconIndex <= k163_IconIndicePotionWaterFlask)) || (iconIndex == k195_IconIndicePotionEmptyFlask)) ) { - uint16 *rawType = _vm->_dungeonMan->getThingData(thing); + uint16 *rawType = _vm->_dungeonMan->f156_getThingData(thing); switch (iconIndex) { case k0_IconIndiceJunkCompassNorth: iconIndex = (IconIndice)(iconIndex + _vm->_dungeonMan->_g308_partyDir); @@ -184,7 +184,7 @@ IconIndice ObjectMan::getIconIndex(Thing thing) { return iconIndex; } -void ObjectMan::extractIconFromBitmap(uint16 iconIndex, byte *destBitmap) { +void ObjectMan::f36_extractIconFromBitmap(uint16 iconIndex, byte *destBitmap) { int16 i; for (i = 0; i < 7; ++i) { if (g26_IconGraphicFirstIndex[i] > iconIndex) @@ -192,14 +192,14 @@ void ObjectMan::extractIconFromBitmap(uint16 iconIndex, byte *destBitmap) { } --i; - byte *srcBitmap = _vm->_displayMan->getBitmap(k42_ObjectIcons_000_TO_031 + i); + byte *srcBitmap = _vm->_displayMan->f489_getBitmap(k42_ObjectIcons_000_TO_031 + i); iconIndex -= g26_IconGraphicFirstIndex[i]; _vm->_displayMan->_g578_useByteBoxCoordinates = true; Box box(0, 0, 15, 15); - _vm->_displayMan->blitToBitmap(srcBitmap, 256, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0, destBitmap, 16, box, k255_ColorNoTransparency); + _vm->_displayMan->f132_blitToBitmap(srcBitmap, 256, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0, destBitmap, 16, box, k255_ColorNoTransparency); } -void ObjectMan::drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex) { +void ObjectMan::f38_drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex) { SlotBox *slotBox = &_g30_slotBoxes[slotBoxIndex]; slotBox->_iconIndex = iconIndex; // yes, this modifies the global array if (slotBox->_iconIndex == kM1_IconIndiceNone) { @@ -219,39 +219,39 @@ void ObjectMan::drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex) { } } iconGraphicIndex--; - byte *iconsBitmap = _vm->_displayMan->getBitmap(iconGraphicIndex + k42_ObjectIcons_000_TO_031); + byte *iconsBitmap = _vm->_displayMan->f489_getBitmap(iconGraphicIndex + k42_ObjectIcons_000_TO_031); iconIndex -= g26_IconGraphicFirstIndex[iconGraphicIndex]; _vm->_displayMan->_g578_useByteBoxCoordinates = false; if (slotBoxIndex >= k8_SlotBoxInventoryFirstSlot) { - _vm->_displayMan->blitToBitmap(iconsBitmap, 256, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0, + _vm->_displayMan->f132_blitToBitmap(iconsBitmap, 256, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0, _vm->_displayMan->_g296_bitmapViewport, k112_byteWidthViewport * 2, box, k255_ColorNoTransparency); } else { - _vm->_displayMan->blitToBitmap(iconsBitmap, 256, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0, + _vm->_displayMan->f132_blitToBitmap(iconsBitmap, 256, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0, _vm->_displayMan->_g348_bitmapScreen, k160_byteWidthScreen * 2, box, k255_ColorNoTransparency); } } #define k14_ObjectNameMaximumLength 14 // @ C014_OBJECT_NAME_MAXIMUM_LENGTH -void ObjectMan::drawLeaderObjectName(Thing thing) { - IconIndice iconIndex = getIconIndex(thing); +void ObjectMan::f34_drawLeaderObjectName(Thing thing) { + IconIndice iconIndex = f33_getIconIndex(thing); char *objName; char objectNameBuffer[16]; if (iconIndex == k147_IconIndiceJunkChampionBones) { - Junk *junk = (Junk*)_vm->_dungeonMan->getThingData(thing); - strcpy(objectNameBuffer, _vm->_championMan->_champions[junk->getChargeCount()]._name); + Junk *junk = (Junk*)_vm->_dungeonMan->f156_getThingData(thing); + strcpy(objectNameBuffer, _vm->_championMan->_gK71_champions[junk->getChargeCount()]._name); strcat(objectNameBuffer, _g352_objectNames[iconIndex]); objName = objectNameBuffer; } else { objName = _g352_objectNames[iconIndex]; } - _vm->_textMan->printWithTrailingSpaces(_vm->_displayMan->_g348_bitmapScreen, k160_byteWidthScreen * 2, 233, 37, + _vm->_textMan->f41_printWithTrailingSpaces(_vm->_displayMan->_g348_bitmapScreen, k160_byteWidthScreen * 2, 233, 37, k4_ColorCyan, k0_ColorBlack, objName, k14_ObjectNameMaximumLength, k200_heightScreen); } -IconIndice ObjectMan::getIconIndexInSlotBox(uint16 slotBoxIndex) { +IconIndice ObjectMan::f39_getIconIndexInSlotBox(uint16 slotBoxIndex) { return (IconIndice)_g30_slotBoxes[slotBoxIndex]._iconIndex; } } diff --git a/engines/dm/objectman.h b/engines/dm/objectman.h index e4ce2cf019..b01957da8a 100644 --- a/engines/dm/objectman.h +++ b/engines/dm/objectman.h @@ -58,12 +58,12 @@ public: char *_g352_objectNames[k199_ObjectNameCount]; // @ G0352_apc_ObjectNames byte *_g412_objectIconForMousePointer; // @ G0412_puc_Bitmap_ObjectIconForMousePointer - IconIndice getObjectType(Thing thing); // @ F0032_OBJECT_GetType - IconIndice getIconIndex(Thing thing); // @ F0033_OBJECT_GetIconIndex - void extractIconFromBitmap(uint16 iconIndex, byte *destBitmap); // @ F0036_OBJECT_ExtractIconFromBitmap - void drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex); // @ F0038_OBJECT_DrawIconInSlotBox - void drawLeaderObjectName(Thing thing); // @ F0034_OBJECT_DrawLeaderHandObjectName - IconIndice getIconIndexInSlotBox(uint16 slotBoxIndex); // @ F0039_OBJECT_GetIconIndexInSlotBox + IconIndice f32_getObjectType(Thing thing); // @ F0032_OBJECT_GetType + IconIndice f33_getIconIndex(Thing thing); // @ F0033_OBJECT_GetIconIndex + void f36_extractIconFromBitmap(uint16 iconIndex, byte *destBitmap); // @ F0036_OBJECT_ExtractIconFromBitmap + void f38_drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex); // @ F0038_OBJECT_DrawIconInSlotBox + void f34_drawLeaderObjectName(Thing thing); // @ F0034_OBJECT_DrawLeaderHandObjectName + IconIndice f39_getIconIndexInSlotBox(uint16 slotBoxIndex); // @ F0039_OBJECT_GetIconIndexInSlotBox }; diff --git a/engines/dm/text.cpp b/engines/dm/text.cpp index ebda26850d..a97060e914 100644 --- a/engines/dm/text.cpp +++ b/engines/dm/text.cpp @@ -35,7 +35,7 @@ TextMan::TextMan(DMEngine* vm) : _vm(vm) {} #define k5_LetterWidth 5 #define k6_LetterHeight 6 -void TextMan::printTextToBitmap(byte* destBitmap, uint16 destPixelWidth, uint16 destX, uint16 destY, +void TextMan::f40_printTextToBitmap(byte* destBitmap, uint16 destPixelWidth, uint16 destX, uint16 destY, Color textColor, Color bgColor, const char* text, uint16 destHeight) { destX -= 1; // fixes missalignment, to be checked destY -= 4; // fixes missalignment, to be checked @@ -43,7 +43,7 @@ void TextMan::printTextToBitmap(byte* destBitmap, uint16 destPixelWidth, uint16 uint16 textLength = strlen(text); uint16 nextX = destX; uint16 nextY = destY; - byte *srcBitmap = _vm->_displayMan->getBitmap(k557_FontGraphicIndice); + byte *srcBitmap = _vm->_displayMan->f489_getBitmap(k557_FontGraphicIndice); byte *tmp = _vm->_displayMan->_g74_tmpBitmap; for (uint16 i = 0; i < (k5_LetterWidth + 1) * k6_LetterHeight * 128; ++i) { @@ -61,7 +61,7 @@ void TextMan::printTextToBitmap(byte* destBitmap, uint16 destPixelWidth, uint16 uint16 srcX = (1 + 5) * toupper(*begin); // 1 + 5 is not the letter width, arbitrary choice of the unpacking code Box box((nextX == destX) ? (nextX + 1) : nextX, nextX + k5_LetterWidth + 1, nextY, nextY + k6_LetterHeight - 1); - _vm->_displayMan->blitToBitmap(srcBitmap, 6 * 128, (nextX == destX) ? (srcX + 1) : srcX, 0, destBitmap, destPixelWidth, + _vm->_displayMan->f132_blitToBitmap(srcBitmap, 6 * 128, (nextX == destX) ? (srcX + 1) : srcX, 0, destBitmap, destPixelWidth, box, k255_ColorNoTransparency); nextX += k5_LetterWidth + 1; @@ -69,19 +69,19 @@ void TextMan::printTextToBitmap(byte* destBitmap, uint16 destPixelWidth, uint16 } void TextMan::f53_printToLogicalScreen(uint16 destX, uint16 destY, Color textColor, Color bgColor, const char* text) { - printTextToBitmap(_vm->_displayMan->_g348_bitmapScreen, _vm->_displayMan->_screenWidth, destX, destY, textColor, bgColor, text, _vm->_displayMan->_screenHeight); + f40_printTextToBitmap(_vm->_displayMan->_g348_bitmapScreen, _vm->_displayMan->_screenWidth, destX, destY, textColor, bgColor, text, _vm->_displayMan->_screenHeight); } -void TextMan::printToViewport(int16 posX, int16 posY, Color textColor, const char* text, Color bgColor) { - printTextToBitmap(_vm->_displayMan->_g296_bitmapViewport, k112_byteWidthViewport * 2, posX, posY, textColor, bgColor, text, k200_heightScreen); +void TextMan::f52_printToViewport(int16 posX, int16 posY, Color textColor, const char* text, Color bgColor) { + f40_printTextToBitmap(_vm->_displayMan->_g296_bitmapViewport, k112_byteWidthViewport * 2, posX, posY, textColor, bgColor, text, k200_heightScreen); } -void TextMan::printWithTrailingSpaces(byte* destBitmap, int16 destPixelWidth, int16 destX, int16 destY, Color textColor, +void TextMan::f41_printWithTrailingSpaces(byte* destBitmap, int16 destPixelWidth, int16 destX, int16 destY, Color textColor, Color bgColor, const char* text, int16 requiredTextLength, int16 destHeight) { Common::String str = text; for (int16 i = str.size(); i < requiredTextLength; ++i) str += ' '; - printTextToBitmap(destBitmap, destPixelWidth, destX, destY, textColor, bgColor, str.c_str(), destHeight); + f40_printTextToBitmap(destBitmap, destPixelWidth, destX, destY, textColor, bgColor, str.c_str(), destHeight); } } diff --git a/engines/dm/text.h b/engines/dm/text.h index c71f196658..adfc42635b 100644 --- a/engines/dm/text.h +++ b/engines/dm/text.h @@ -37,11 +37,11 @@ class TextMan { DMEngine *_vm; public: explicit TextMan(DMEngine *vm); - void printTextToBitmap(byte *destBitmap, uint16 destPixelWidth, uint16 destX, uint16 destY, + void f40_printTextToBitmap(byte *destBitmap, uint16 destPixelWidth, uint16 destX, uint16 destY, Color textColor, Color bgColor, const char *text, uint16 destHeight); // @ F0040_TEXT_Print void f53_printToLogicalScreen(uint16 destX, uint16 destY, Color textColor, Color bgColor, const char *text); // @ F0053_TEXT_PrintToLogicalScreen - void printToViewport(int16 posX, int16 posY, Color textColor, const char *text, Color bgColor = k12_ColorDarkestGray); // @ F0052_TEXT_PrintToViewport - void printWithTrailingSpaces(byte *destBitmap, int16 destPixelWidth, int16 destX, int16 destY, Color textColor, Color bgColor, + void f52_printToViewport(int16 posX, int16 posY, Color textColor, const char *text, Color bgColor = k12_ColorDarkestGray); // @ F0052_TEXT_PrintToViewport + void f41_printWithTrailingSpaces(byte *destBitmap, int16 destPixelWidth, int16 destX, int16 destY, Color textColor, Color bgColor, const char *text, int16 strLenght, int16 destHeight); // @ F0041_TEXT_PrintWithTrailingSpaces }; diff --git a/engines/dm/timeline.cpp b/engines/dm/timeline.cpp index 9803032a5c..4b5cfd411d 100644 --- a/engines/dm/timeline.cpp +++ b/engines/dm/timeline.cpp @@ -41,7 +41,7 @@ Timeline::~Timeline() { delete[] _g371_timeline; } -void Timeline::initTimeline() { +void Timeline::f233_initTimeline() { _g370_events = new TimelineEvent[_g369_eventMaxCount]; _g371_timeline = new uint16[_g369_eventMaxCount]; if (_vm->_g298_newGame) { diff --git a/engines/dm/timeline.h b/engines/dm/timeline.h index 47d339eb33..c2e06bcd9c 100644 --- a/engines/dm/timeline.h +++ b/engines/dm/timeline.h @@ -153,7 +153,7 @@ public: Timeline(DMEngine *vm); ~Timeline(); - void initTimeline(); // @ F0233_TIMELINE_Initialize + void f233_initTimeline(); // @ F0233_TIMELINE_Initialize }; -- cgit v1.2.3