aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/dm/champion.cpp164
-rw-r--r--engines/dm/console.cpp8
-rw-r--r--engines/dm/dialog.cpp56
-rw-r--r--engines/dm/dialog.h10
-rw-r--r--engines/dm/dm.cpp322
-rw-r--r--engines/dm/dm.h119
-rw-r--r--engines/dm/dmglobals.cpp4
-rw-r--r--engines/dm/dungeonman.cpp58
-rw-r--r--engines/dm/eventman.cpp106
-rw-r--r--engines/dm/gfx.cpp56
-rw-r--r--engines/dm/group.cpp88
-rw-r--r--engines/dm/inventory.cpp42
-rw-r--r--engines/dm/loadsave.cpp74
-rw-r--r--engines/dm/menus.cpp44
-rw-r--r--engines/dm/movesens.cpp48
-rw-r--r--engines/dm/projexpl.cpp14
-rw-r--r--engines/dm/sounds.cpp2
-rw-r--r--engines/dm/text.cpp4
-rw-r--r--engines/dm/timeline.cpp42
19 files changed, 626 insertions, 635 deletions
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp
index 3ef072f7d9..b6bcdf2593 100644
--- a/engines/dm/champion.cpp
+++ b/engines/dm/champion.cpp
@@ -234,13 +234,13 @@ bool ChampionMan::isObjectThrown(uint16 champIndex, int16 slotIndex, int16 side)
kineticEnergy += weaponKineticEnergy;
int16 skillLevel = getSkillLevel((ChampionIndex)champIndex, k10_ChampionSkillThrow);
kineticEnergy += _vm->getRandomNumber(16) + (kineticEnergy >> 1) + skillLevel;
- int16 attack = f26_getBoundedValue((uint16)40, (uint16)((skillLevel << 3) + _vm->getRandomNumber(32)), (uint16)200);
+ int16 attack = getBoundedValue((uint16)40, (uint16)((skillLevel << 3) + _vm->getRandomNumber(32)), (uint16)200);
int16 stepEnergy = MAX(5, 11 - skillLevel);
_vm->_projexpl->f212_projectileCreate(curThing, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY,
- M21_normalizeModulo4(_vm->_dungeonMan->_g308_partyDir + side),
+ normalizeModulo4(_vm->_dungeonMan->_g308_partyDir + side),
_vm->_dungeonMan->_g308_partyDir, kineticEnergy, attack, stepEnergy);
- _vm->_g311_projectileDisableMovementTicks = 4;
- _vm->_g312_lastProjectileDisabledMovementDirection = _vm->_dungeonMan->_g308_partyDir;
+ _vm->_projectileDisableMovementTicks = 4;
+ _vm->_lastProjectileDisabledMovementDirection = _vm->_dungeonMan->_g308_partyDir;
drawChampionState((ChampionIndex)champIndex);
return true;
}
@@ -480,7 +480,7 @@ void ChampionMan::drawChangedObjectIcons() {
for (uint16 slotBoxIndex = 0; slotBoxIndex < (_partyChampionCount * 2); ++slotBoxIndex) {
int16 champIndex = slotBoxIndex >> 1;
- if (invChampOrdinal == _vm->M0_indexToOrdinal(champIndex))
+ if (invChampOrdinal == _vm->indexToOrdinal(champIndex))
continue;
if (hasObjectIconInSlotBoxChanged(slotBoxIndex, _champions[champIndex].getSlot((ChampionSlot)getHandSlotIndex(slotBoxIndex)))
@@ -491,7 +491,7 @@ void ChampionMan::drawChangedObjectIcons() {
}
if (invChampOrdinal) {
- Champion *champ = &_champions[_vm->M1_ordinalToIndex(invChampOrdinal)];
+ Champion *champ = &_champions[_vm->ordinalToIndex(invChampOrdinal)];
Thing *thing = &champ->getSlot(k0_ChampionSlotReadyHand);
uint16 drawViewport = 0;
@@ -499,7 +499,7 @@ void ChampionMan::drawChangedObjectIcons() {
uint16 objIconChanged = hasObjectIconInSlotBoxChanged(slotIndex + k8_SlotBoxInventoryFirstSlot, *thing) ? 1 : 0;
drawViewport |= objIconChanged;
if (objIconChanged && (slotIndex == k1_ChampionSlotActionHand)) {
- menuMan.f386_drawActionIcon((ChampionIndex)_vm->M1_ordinalToIndex(invChampOrdinal));
+ menuMan.f386_drawActionIcon((ChampionIndex)_vm->ordinalToIndex(invChampOrdinal));
}
}
@@ -512,7 +512,7 @@ void ChampionMan::drawChangedObjectIcons() {
if (drawViewport) {
champ->setAttributeFlag(k0x4000_ChampionAttributeViewport, true);
- drawChampionState((ChampionIndex)_vm->M1_ordinalToIndex(invChampOrdinal));
+ drawChampionState((ChampionIndex)_vm->ordinalToIndex(invChampOrdinal));
}
}
@@ -540,14 +540,14 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio
champ->_load += dunMan.f140_getObjectWeight(thing);
champ->setAttributeFlag(k0x0200_ChampionAttributeLoad, true);
IconIndice iconIndex = objMan.f33_getIconIndex(thing);
- bool isInventoryChampion = (_vm->M0_indexToOrdinal(champIndex) == invMan._g432_inventoryChampionOrdinal);
+ bool isInventoryChampion = (_vm->indexToOrdinal(champIndex) == invMan._g432_inventoryChampionOrdinal);
applyModifiersToStatistics(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 (_actingChampionOrdinal == _vm->M0_indexToOrdinal(champIndex))
+ if (_actingChampionOrdinal == _vm->indexToOrdinal(champIndex))
menuMan.f388_clearActingChampion();
if ((iconIndex >= k30_IconIndiceScrollOpen) && (iconIndex <= k31_IconIndiceScrollClosed)) {
@@ -593,7 +593,7 @@ int16 ChampionMan::getScentOrdinal(int16 mapX, int16 mapY) {
Scent *scent = &_party._scents[scentIndex--];
do {
if ((*(--scent)).toUint16() == searchedScentRedEagle) {
- return _vm->M0_indexToOrdinal(scentIndex);
+ return _vm->indexToOrdinal(scentIndex);
}
} while (scentIndex--);
}
@@ -657,7 +657,7 @@ uint16 ChampionMan::getStrength(int16 champIndex, int16 slotIndex) {
if (getFlag(curChampion->_wounds, (slotIndex == k0_ChampionSlotReadyHand) ? k0x0001_ChampionWoundReadHand : k0x0002_ChampionWoundActionHand)) {
strength >>= 1;
}
- return f26_getBoundedValue(0, strength >> 1, 100);
+ return getBoundedValue(0, strength >> 1, 100);
}
Thing ChampionMan::getObjectRemovedFromSlot(uint16 champIndex, uint16 slotIndex) {
@@ -675,7 +675,7 @@ Thing ChampionMan::getObjectRemovedFromSlot(uint16 champIndex, uint16 slotIndex)
if (curThing == Thing::_none)
return Thing::_none;
- bool isInventoryChampion = (_vm->M0_indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal);
+ bool isInventoryChampion = (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal);
int16 curIconIndex = _vm->_objectMan->f33_getIconIndex(curThing);
// Remove object modifiers
applyModifiersToStatistics(curChampion, slotIndex, curIconIndex, -1, curThing);
@@ -698,7 +698,7 @@ Thing ChampionMan::getObjectRemovedFromSlot(uint16 champIndex, uint16 slotIndex)
if (slotIndex < k2_ChampionSlotHead) {
if (slotIndex == k1_ChampionSlotActionHand) {
setFlag(curChampion->_attributes, k0x8000_ChampionAttributeActionHand);
- if (_actingChampionOrdinal == _vm->M0_indexToOrdinal(champIndex))
+ if (_actingChampionOrdinal == _vm->indexToOrdinal(champIndex))
_vm->_menuMan->f388_clearActingChampion();
if ((curIconIndex >= k30_IconIndiceScrollOpen) && (curIconIndex <= k31_IconIndiceScrollClosed)) {
@@ -778,7 +778,7 @@ int16 ChampionMan::addPendingDamageAndWounds_getDamage(int16 champIndex, int16 a
if (wisdomFactor <= 0) {
attack = 0;
} else {
- attack = _vm->f30_getScaledProduct(attack, 6, wisdomFactor);
+ attack = _vm->getScaledProduct(attack, 6, wisdomFactor);
}
skipScaling = true;
@@ -804,7 +804,7 @@ int16 ChampionMan::addPendingDamageAndWounds_getDamage(int16 champIndex, int16 a
if (attack <= 0)
return 0;
- attack = _vm->f30_getScaledProduct(attack, 6, 130 - defense);
+ attack = _vm->getScaledProduct(attack, 6, 130 - defense);
}
/* BUG0_44
A champion may take much more damage than expected after a Black Flame attack or an impact
@@ -877,7 +877,7 @@ int16 ChampionMan::getWoundDefense(int16 champIndex, uint16 woundIndex) {
if (_partyIsSleeping)
woundDefense >>= 1;
- return f26_getBoundedValue(0, woundDefense >> 1, 100);
+ return getBoundedValue(0, woundDefense >> 1, 100);
}
uint16 ChampionMan::getStatisticAdjustedAttack(Champion *champ, uint16 statIndex, uint16 attack) {
@@ -893,14 +893,14 @@ uint16 ChampionMan::getStatisticAdjustedAttack(Champion *champ, uint16 statIndex
if (factor < 16)
return attack >> 3;
- return _vm->f30_getScaledProduct(attack, 7, factor);
+ return _vm->getScaledProduct(attack, 7, factor);
}
void ChampionMan::wakeUp() {
- _vm->_g321_stopWaitingForPlayerInput = true;
+ _vm->_stopWaitingForPlayerInput = true;
_partyIsSleeping = false;
- _vm->_g318_waitForInputMaxVerticalBlankCount = 10;
- _vm->f22_delay(10);
+ _vm->_waitForInputMaxVerticalBlankCount = 10;
+ _vm->delay(10);
_vm->_displayMan->f98_drawFloorAndCeiling();
_vm->_eventMan->_g441_primaryMouseInput = _vm->_eventMan->_primaryMouseInputInterface;
_vm->_eventMan->_g442_secondaryMouseInput = _vm->_eventMan->_secondaryMouseInputMovement;
@@ -912,7 +912,7 @@ void ChampionMan::wakeUp() {
int16 ChampionMan::getThrowingStaminaCost(Thing thing) {
int16 weight = _vm->_dungeonMan->f140_getObjectWeight(thing) >> 1;
- int16 staminaCost = f26_getBoundedValue<int16>(1, weight, 10);
+ int16 staminaCost = getBoundedValue<int16>(1, weight, 10);
while ((weight -= 10) > 0)
staminaCost += weight >> 1;
@@ -922,7 +922,7 @@ int16 ChampionMan::getThrowingStaminaCost(Thing thing) {
void ChampionMan::disableAction(uint16 champIndex, uint16 ticks) {
Champion *curChampion = &_champions[champIndex];
- int32 updatedEnableActionEventTime = _vm->_g313_gameTime + ticks;
+ int32 updatedEnableActionEventTime = _vm->_gameTime + ticks;
TimelineEvent curEvent;
curEvent._type = k11_TMEventTypeEnableChampionAction;
@@ -931,9 +931,9 @@ void ChampionMan::disableAction(uint16 champIndex, uint16 ticks) {
int16 eventIndex = curChampion->_enableActionEventIndex;
if (eventIndex >= 0) {
- int32 currentEnableActionEventTime = M30_time(_vm->_timeline->_g370_events[eventIndex]._mapTime);
+ int32 currentEnableActionEventTime = filterTime(_vm->_timeline->_g370_events[eventIndex]._mapTime);
if (updatedEnableActionEventTime >= currentEnableActionEventTime) {
- updatedEnableActionEventTime += (currentEnableActionEventTime - _vm->_g313_gameTime) >> 1;
+ updatedEnableActionEventTime += (currentEnableActionEventTime - _vm->_gameTime) >> 1;
} else {
updatedEnableActionEventTime = currentEnableActionEventTime + (ticks >> 1);
}
@@ -942,12 +942,12 @@ void ChampionMan::disableAction(uint16 champIndex, uint16 ticks) {
setFlag(curChampion->_attributes, k0x8000_ChampionAttributeActionHand | k0x0008_ChampionAttributeDisableAction);
drawChampionState((ChampionIndex)champIndex);
}
- M33_setMapAndTime(curEvent._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, updatedEnableActionEventTime);
+ setMapAndTime(curEvent._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, updatedEnableActionEventTime);
curChampion->_enableActionEventIndex = _vm->_timeline->f238_addEventGetEventIndex(&curEvent);
}
void ChampionMan::addSkillExperience(uint16 champIndex, uint16 skillIndex, uint16 exp) {
- if ((skillIndex >= k4_ChampionSkillSwing) && (skillIndex <= k11_ChampionSkillShoot) && (_vm->_projexpl->_g361_lastCreatureAttackTime < _vm->_g313_gameTime - 150))
+ if ((skillIndex >= k4_ChampionSkillSwing) && (skillIndex <= k11_ChampionSkillShoot) && (_vm->_projexpl->_g361_lastCreatureAttackTime < _vm->_gameTime - 150))
exp >>= 1;
if (exp) {
@@ -963,13 +963,13 @@ void ChampionMan::addSkillExperience(uint16 champIndex, uint16 skillIndex, uint1
uint16 skillLevelBefore = getSkillLevel(champIndex, baseSkillIndex | (k0x4000_IgnoreObjectModifiers | k0x8000_IgnoreTemporaryExperience));
- if ((skillIndex >= k4_ChampionSkillSwing) && (_vm->_projexpl->_g361_lastCreatureAttackTime > _vm->_g313_gameTime - 25))
+ if ((skillIndex >= k4_ChampionSkillSwing) && (_vm->_projexpl->_g361_lastCreatureAttackTime > _vm->_gameTime - 25))
exp <<= 1;
Skill *curSkill = &curChampion->_skills[skillIndex];
curSkill->_experience += exp;
if (curSkill->_temporaryExperience < 32000)
- curSkill->_temporaryExperience += f26_getBoundedValue(1, exp >> 3, 100);
+ curSkill->_temporaryExperience += getBoundedValue(1, exp >> 3, 100);
curSkill = &curChampion->_skills[baseSkillIndex];
if (skillIndex >= k4_ChampionSkillSwing)
@@ -1070,7 +1070,7 @@ int16 ChampionMan::getDamagedChampionCount(uint16 attack, int16 wounds, int16 at
}
int16 ChampionMan::getTargetChampionIndex(int16 mapX, int16 mapY, uint16 cell) {
- if (_partyChampionCount && (M38_distance(mapX, mapY, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY) <= 1)) {
+ if (_partyChampionCount && (getDistance(mapX, mapY, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY) <= 1)) {
signed char orderedCellsToAttack[4];
_vm->_groupMan->f229_setOrderedCellsToAttack(orderedCellsToAttack, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, mapX, mapY, cell);
for (uint16 i = 0; i < 4; i++) {
@@ -1088,7 +1088,7 @@ int16 ChampionMan::getDexterity(Champion* champ) {
if (_partyIsSleeping)
dexterity >>= 1;
- return f26_getBoundedValue(1 + _vm->getRandomNumber(8), dexterity >> 1, 100 - _vm->getRandomNumber(8));
+ return getBoundedValue(1 + _vm->getRandomNumber(8), dexterity >> 1, 100 - _vm->getRandomNumber(8));
}
bool ChampionMan::isLucky(Champion* champ, uint16 percentage) {
@@ -1097,18 +1097,18 @@ bool ChampionMan::isLucky(Champion* champ, uint16 percentage) {
unsigned char *curStat = champ->_statistics[k0_ChampionStatLuck];
bool isLucky = (_vm->getRandomNumber(curStat[k1_ChampionStatCurrent]) > percentage);
- curStat[k1_ChampionStatCurrent] = f26_getBoundedValue<char>(curStat[k2_ChampionStatMinimum], curStat[k1_ChampionStatCurrent] + (isLucky ? -2 : 2), curStat[k0_ChampionStatMaximum]);
+ curStat[k1_ChampionStatCurrent] = getBoundedValue<char>(curStat[k2_ChampionStatMinimum], curStat[k1_ChampionStatCurrent] + (isLucky ? -2 : 2), curStat[k0_ChampionStatMaximum]);
return isLucky;
}
void ChampionMan::championPoison(int16 champIndex, uint16 attack) {
- if ((champIndex == kM1_ChampionNone) || (_vm->M0_indexToOrdinal(champIndex) == _candidateChampionOrdinal))
+ if ((champIndex == kM1_ChampionNone) || (_vm->indexToOrdinal(champIndex) == _candidateChampionOrdinal))
return;
Champion *curChampion = &_champions[champIndex];
addPendingDamageAndWounds_getDamage(champIndex, MAX(1, attack >> 6), k0x0000_ChampionWoundNone, k0_attackType_NORMAL);
setFlag(curChampion->_attributes, k0x0100_ChampionAttributeStatistics);
- if ((_vm->M0_indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) && (_vm->_inventoryMan->_g424_panelContent == k0_PanelContentFoodWaterPoisoned)) {
+ if ((_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) && (_vm->_inventoryMan->_g424_panelContent == k0_PanelContentFoodWaterPoisoned)) {
setFlag(curChampion->_attributes, k0x0800_ChampionAttributePanel);
}
@@ -1117,7 +1117,7 @@ void ChampionMan::championPoison(int16 champIndex, uint16 attack) {
TimelineEvent newEvent;
newEvent._type = k75_TMEventTypePoisonChampion;
newEvent._priority = champIndex;
- M33_setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_g313_gameTime + 36);
+ setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_gameTime + 36);
newEvent._B._attack = attack;
_vm->_timeline->f238_addEventGetEventIndex(&newEvent);
}
@@ -1135,8 +1135,8 @@ void ChampionMan::setPartyDirection(int16 dir) {
Champion *curChampion = _champions;
for (int16 i = k0_ChampionFirst; i < _partyChampionCount; i++) {
- curChampion->_cell = (ViewCell)M21_normalizeModulo4(curChampion->_cell + L0834_i_Delta);
- curChampion->_dir = (Direction)M21_normalizeModulo4(curChampion->_dir + L0834_i_Delta);
+ curChampion->_cell = (ViewCell)normalizeModulo4(curChampion->_cell + L0834_i_Delta);
+ curChampion->_dir = (Direction)normalizeModulo4(curChampion->_dir + L0834_i_Delta);
curChampion++;
}
@@ -1201,7 +1201,7 @@ void ChampionMan::putObjectInLeaderHand(Thing thing, bool setMousePointer) {
_vm->_objectMan->f34_drawLeaderObjectName(thing);
if (setMousePointer)
- _vm->_g325_setMousePointerToObjectInMainLoop = true;
+ _vm->_setMousePointerToObjectInMainLoop = true;
else
_vm->_eventMan->f68_setPointerToObject(_vm->_objectMan->_g412_objectIconForMousePointer);
@@ -1299,12 +1299,12 @@ void ChampionMan::clickOnSlotBox(uint16 slotBoxIndex) {
return;
champIndex = slotBoxIndex >> 1;
- if ((champIndex >= _partyChampionCount) || (_vm->M0_indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) || !_champions[champIndex]._currHealth)
+ if ((champIndex >= _partyChampionCount) || (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) || !_champions[champIndex]._currHealth)
return;
slotIndex = getHandSlotIndex(slotBoxIndex);
} else {
- champIndex = _vm->M1_ordinalToIndex(_vm->_inventoryMan->_g432_inventoryChampionOrdinal);
+ champIndex = _vm->ordinalToIndex(_vm->_inventoryMan->_g432_inventoryChampionOrdinal);
slotIndex = slotBoxIndex - k8_SlotBoxInventoryFirstSlot;
}
@@ -1357,9 +1357,9 @@ bool ChampionMan::isProjectileSpellCast(uint16 champIndex, Thing thing, int16 ki
void ChampionMan::championShootProjectile(Champion* champ, Thing thing, int16 kineticEnergy, int16 attack, int16 stepEnergy) {
Direction newDirection = champ->_dir;
- _vm->_projexpl->f212_projectileCreate(thing, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, M21_normalizeModulo4((((champ->_cell - newDirection + 1) & 0x0002) >> 1) + newDirection), newDirection, kineticEnergy, attack, stepEnergy);
- _vm->_g311_projectileDisableMovementTicks = 4;
- _vm->_g312_lastProjectileDisabledMovementDirection = newDirection;
+ _vm->_projexpl->f212_projectileCreate(thing, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, normalizeModulo4((((champ->_cell - newDirection + 1) & 0x0002) >> 1) + newDirection), newDirection, kineticEnergy, attack, stepEnergy);
+ _vm->_projectileDisableMovementTicks = 4;
+ _vm->_lastProjectileDisabledMovementDirection = newDirection;
}
void ChampionMan::applyAndDrawPendingDamageAndWounds() {
@@ -1397,7 +1397,7 @@ void ChampionMan::applyAndDrawPendingDamageAndWounds() {
blitBox._y1 = 0;
_vm->_eventMan->f78_showMouse();
- if (_vm->M0_indexToOrdinal(championIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) {
+ if (_vm->indexToOrdinal(championIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) {
blitBox._y2 = 28;
blitBox._x1 = textPosX + 7;
blitBox._x2 = blitBox._x1 + 31; /* Box is over the champion portrait in the status box */
@@ -1432,12 +1432,12 @@ void ChampionMan::applyAndDrawPendingDamageAndWounds() {
if (eventIndex == -1) {
TimelineEvent newEvent;
newEvent._type = k12_TMEventTypeHideDamageReceived;
- M33_setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_g313_gameTime + 5);
+ setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_gameTime + 5);
newEvent._priority = championIndex;
championPtr->_hideDamageReceivedIndex = _vm->_timeline->f238_addEventGetEventIndex(&newEvent);
} else {
TimelineEvent *curEvent = &_vm->_timeline->_g370_events[eventIndex];
- M33_setMapAndTime(curEvent->_mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_g313_gameTime + 5);
+ setMapAndTime(curEvent->_mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_gameTime + 5);
_vm->_timeline->f236_fixChronology(_vm->_timeline->f235_getIndex(eventIndex));
}
drawChampionState((ChampionIndex)championIndex);
@@ -1450,17 +1450,17 @@ void ChampionMan::championKill(uint16 champIndex) {
Champion *curChampion = &_champions[champIndex];
curChampion->_currHealth = 0;
setFlag(curChampion->_attributes, k0x1000_ChampionAttributeStatusBox);
- if (_vm->M0_indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) {
- if (_vm->_g331_pressingEye) {
- _vm->_g331_pressingEye = false;
+ if (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) {
+ if (_vm->_pressingEye) {
+ _vm->_pressingEye = false;
_vm->_eventMan->_g597_ignoreMouseMovements = false;
if (!_leaderEmptyHanded) {
_vm->_objectMan->f34_drawLeaderObjectName(_leaderHandObject);
}
_vm->_eventMan->_g587_hideMousePointerRequestCount = 1;
_vm->_eventMan->f77_hideMouse();
- } else if (_vm->_g333_pressingMouth) {
- _vm->_g333_pressingMouth = false;
+ } else if (_vm->_pressingMouth) {
+ _vm->_pressingMouth = false;
_vm->_eventMan->_g597_ignoreMouseMovements = false;
_vm->_eventMan->_g587_hideMousePointerRequestCount = 1;
_vm->_eventMan->f77_hideMouse();
@@ -1476,16 +1476,16 @@ void ChampionMan::championKill(uint16 champIndex) {
L0966_ps_Junk->setDoNotDiscard(true);
L0966_ps_Junk->setChargeCount(champIndex);
curCell = curChampion->_cell;
- _vm->_moveSens->f267_getMoveResult(M15_thingWithNewCell(unusedThing, curCell), kM1_MapXNotOnASquare, 0, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY);
+ _vm->_moveSens->f267_getMoveResult(thingWithNewCell(unusedThing, curCell), kM1_MapXNotOnASquare, 0, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY);
}
curChampion->_symbolStep = 0;
curChampion->_symbols[0] = '\0';
curChampion->_dir = _vm->_dungeonMan->_g308_partyDir;
curChampion->_maximumDamageReceived = 0;
uint16 curChampionIconIndex = getChampionIconIndex(curCell, _vm->_dungeonMan->_g308_partyDir);
- if (_vm->M0_indexToOrdinal(curChampionIconIndex) == _vm->_eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap) {
+ if (_vm->indexToOrdinal(curChampionIconIndex) == _vm->_eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap) {
_vm->_eventMan->_g598_mousePointerBitmapUpdated = true;
- _vm->_eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap = _vm->M0_indexToOrdinal(kM1_ChampionNone);
+ _vm->_eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(kM1_ChampionNone);
}
if (curChampion->_poisonEventCount)
@@ -1553,7 +1553,7 @@ void ChampionMan::dropAllObjects(uint16 champIndex) {
for (uint16 slotIndex = k0_ChampionSlotReadyHand; slotIndex < k30_ChampionSlotChest_1; slotIndex++) {
Thing curThing = getObjectRemovedFromSlot(champIndex, slotDropOrder[slotIndex]);
if (curThing != Thing::_none)
- _vm->_moveSens->f267_getMoveResult(M15_thingWithNewCell(curThing, curCell), kM1_MapXNotOnASquare, 0, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY);
+ _vm->_moveSens->f267_getMoveResult(thingWithNewCell(curThing, curCell), kM1_MapXNotOnASquare, 0, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY);
}
}
@@ -1588,11 +1588,11 @@ void ChampionMan::applyTimeEffects() {
}
}
- uint16 gameTime = _vm->_g313_gameTime & 0xFFFF;
+ uint16 gameTime = _vm->_gameTime & 0xFFFF;
uint16 timeCriteria = (((gameTime & 0x0080) + ((gameTime & 0x0100) >> 2)) + ((gameTime & 0x0040) << 2)) >> 2;
Champion *championPtr = _champions;
for (uint16 championIndex = k0_ChampionFirst; championIndex < _partyChampionCount; championIndex++, championPtr++) {
- if (championPtr->_currHealth && (_vm->M0_indexToOrdinal(championIndex) != _candidateChampionOrdinal)) {
+ if (championPtr->_currHealth && (_vm->indexToOrdinal(championIndex) != _candidateChampionOrdinal)) {
uint16 wizardSkillLevel = getSkillLevel(championIndex, k3_ChampionSkillWizard) + getSkillLevel(championIndex, k2_ChampionSkillPriest);
if ((championPtr->_currMana < championPtr->_maxMana)
&& (timeCriteria < championPtr->_statistics[k3_ChampionStatWisdom][k1_ChampionStatCurrent] + wizardSkillLevel)) {
@@ -1616,11 +1616,11 @@ void ChampionMan::applyTimeEffects() {
staminaGainCycleCount += 2;
int16 staminaLoss = 0;
- int16 staminaAmount = f26_getBoundedValue(1, (championPtr->_maxStamina >> 8) - 1, 6);
+ int16 staminaAmount = getBoundedValue(1, (championPtr->_maxStamina >> 8) - 1, 6);
if (_partyIsSleeping)
staminaAmount <<= 1;
- int32 compDelay = _vm->_g313_gameTime - _vm->_projexpl->_g362_lastPartyMovementTime;
+ int32 compDelay = _vm->_gameTime - _vm->_projexpl->_g362_lastPartyMovementTime;
if (compDelay > 80) {
staminaAmount++;
if (compDelay > 250)
@@ -1668,7 +1668,7 @@ void ChampionMan::applyTimeEffects() {
championPtr->_currHealth += MIN(healthGain, (int16)(championPtr->_maxHealth - championPtr->_currHealth));
}
- if (!((int)_vm->_g313_gameTime & (_partyIsSleeping ? 63 : 255))) {
+ if (!((int)_vm->_gameTime & (_partyIsSleeping ? 63 : 255))) {
for (uint16 i = k0_ChampionStatLuck; i <= k6_ChampionStatAntifire; i++) {
byte *curStatistic = championPtr->_statistics[i];
uint16 statisticMaximum = curStatistic[k0_ChampionStatMaximum];
@@ -1678,14 +1678,14 @@ void ChampionMan::applyTimeEffects() {
curStatistic[k1_ChampionStatCurrent] -= curStatistic[k1_ChampionStatCurrent] / statisticMaximum;
}
}
- if (!_partyIsSleeping && (championPtr->_dir != _vm->_dungeonMan->_g308_partyDir) && (_vm->_projexpl->_g361_lastCreatureAttackTime + 60 < _vm->_g313_gameTime)) {
+ if (!_partyIsSleeping && (championPtr->_dir != _vm->_dungeonMan->_g308_partyDir) && (_vm->_projexpl->_g361_lastCreatureAttackTime + 60 < _vm->_gameTime)) {
championPtr->_dir = _vm->_dungeonMan->_g308_partyDir;
championPtr->_maximumDamageReceived = 0;
setFlag(championPtr->_attributes, k0x0400_ChampionAttributeIcon);
}
setFlag(championPtr->_attributes, k0x0100_ChampionAttributeStatistics);
- if (_vm->M0_indexToOrdinal(championIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) {
- if (_vm->_g333_pressingMouth || _vm->_g331_pressingEye || (_vm->_inventoryMan->_g424_panelContent == k0_PanelContentFoodWaterPoisoned)) {
+ if (_vm->indexToOrdinal(championIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) {
+ if (_vm->_pressingMouth || _vm->_pressingEye || (_vm->_inventoryMan->_g424_panelContent == k0_PanelContentFoodWaterPoisoned)) {
setFlag(championPtr->_attributes, k0x0800_ChampionAttributePanel);
}
}
@@ -1828,7 +1828,7 @@ ChampionIndex ChampionMan::getIndexInCell(int16 cell) {
}
void ChampionMan::resetDataToStartGame() {
- if (!_vm->_g298_newGame) {
+ if (!_vm->_newGameFl) {
Thing L0787_T_Thing;
if ((L0787_T_Thing = _leaderHandObject) == Thing::_none) {
_leaderEmptyHanded = true;
@@ -1878,10 +1878,10 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) {
championPtr->_hideDamageReceivedIndex = -1;
championPtr->_dir = _vm->_dungeonMan->_g308_partyDir;
uint16 viewCell = k0_ViewCellFronLeft;
- while (getIndexInCell(M21_normalizeModulo4(viewCell + _vm->_dungeonMan->_g308_partyDir)) != kM1_ChampionNone)
+ while (getIndexInCell(normalizeModulo4(viewCell + _vm->_dungeonMan->_g308_partyDir)) != kM1_ChampionNone)
viewCell++;
- championPtr->_cell = (ViewCell)M21_normalizeModulo4(viewCell + _vm->_dungeonMan->_g308_partyDir);
+ championPtr->_cell = (ViewCell)normalizeModulo4(viewCell + _vm->_dungeonMan->_g308_partyDir);
championPtr->_attributes = k0x0400_ChampionAttributeIcon;
championPtr->_directionMaximumDamageReceived = _vm->_dungeonMan->_g308_partyDir;
championPtr->_food = 1500 + _vm->getRandomNumber(256);
@@ -2119,7 +2119,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
if (!getFlag(championAttributes, k0x0080_ChampionAttributeNameTitle | k0x0100_ChampionAttributeStatistics | k0x0200_ChampionAttributeLoad | k0x0400_ChampionAttributeIcon | k0x0800_ChampionAttributePanel | k0x1000_ChampionAttributeStatusBox | k0x2000_ChampionAttributeWounds | k0x4000_ChampionAttributeViewport | k0x8000_ChampionAttributeActionHand))
return;
- bool isInventoryChampion = (_vm->M0_indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal);
+ bool isInventoryChampion = (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal);
_vm->_displayMan->_g578_useByteBoxCoordinates = false;
_vm->_eventMan->f78_showMouse();
if (getFlag(championAttributes, k0x1000_ChampionAttributeStatusBox)) {
@@ -2237,33 +2237,33 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
}
maxLoad = curChampion->_load / 10;
- strcpy(_vm->_g353_stringBuildBuffer, getStringFromInteger(maxLoad, true, 3).c_str());
+ strcpy(_vm->_stringBuildBuffer, getStringFromInteger(maxLoad, true, 3).c_str());
switch (_vm->getGameLanguage()) { // localized
default:
- case Common::EN_ANY: strcat(_vm->_g353_stringBuildBuffer, "."); break;
- case Common::DE_DEU: strcat(_vm->_g353_stringBuildBuffer, ","); break;
- case Common::FR_FRA: strcat(_vm->_g353_stringBuildBuffer, "KG,"); break;
+ case Common::EN_ANY: strcat(_vm->_stringBuildBuffer, "."); break;
+ case Common::DE_DEU: strcat(_vm->_stringBuildBuffer, ","); break;
+ case Common::FR_FRA: strcat(_vm->_stringBuildBuffer, "KG,"); break;
}
maxLoad = curChampion->_load - (maxLoad * 10);
- strcat(_vm->_g353_stringBuildBuffer, getStringFromInteger(maxLoad, false, 1).c_str());
- strcat(_vm->_g353_stringBuildBuffer, "/");
+ strcat(_vm->_stringBuildBuffer, getStringFromInteger(maxLoad, false, 1).c_str());
+ strcat(_vm->_stringBuildBuffer, "/");
maxLoad = (getMaximumLoad(curChampion) + 5) / 10;
- strcat(_vm->_g353_stringBuildBuffer, getStringFromInteger(maxLoad, true, 3).c_str());
- strcat(_vm->_g353_stringBuildBuffer, " KG");
- _vm->_textMan->f52_printToViewport(148, 132, loadColor, _vm->_g353_stringBuildBuffer);
+ strcat(_vm->_stringBuildBuffer, getStringFromInteger(maxLoad, true, 3).c_str());
+ strcat(_vm->_stringBuildBuffer, " KG");
+ _vm->_textMan->f52_printToViewport(148, 132, loadColor, _vm->_stringBuildBuffer);
setFlag(championAttributes, k0x4000_ChampionAttributeViewport);
}
uint16 championIconIndex = getChampionIconIndex(curChampion->_cell, _vm->_dungeonMan->_g308_partyDir);
- if (getFlag(championAttributes, k0x0400_ChampionAttributeIcon) && (_vm->_eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap != _vm->M0_indexToOrdinal(championIconIndex))) {
+ if (getFlag(championAttributes, k0x0400_ChampionAttributeIcon) && (_vm->_eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap != _vm->indexToOrdinal(championIconIndex))) {
_vm->_displayMan->D24_fillScreenBox(_boxChampionIcons[championIconIndex], _championColor[champIndex]);
_vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->f489_getNativeBitmapOrGraphic(k28_ChampionIcons), _vm->_displayMan->_g348_bitmapScreen, _boxChampionIcons[championIconIndex], getChampionIconIndex(curChampion->_dir, _vm->_dungeonMan->_g308_partyDir) * 19, 0, k40_byteWidth, k160_byteWidthScreen, k12_ColorDarkestGray, 14, k200_heightScreen);
}
if (getFlag(championAttributes, k0x0800_ChampionAttributePanel) && isInventoryChampion) {
- if (_vm->_g333_pressingMouth)
+ if (_vm->_pressingMouth)
_vm->_inventoryMan->f345_drawPanelFoodWaterPoisoned();
- else if (_vm->_g331_pressingEye) {
+ else if (_vm->_pressingEye) {
if (_leaderEmptyHanded)
_vm->_inventoryMan->f351_drawChampionSkillsAndStatistics();
} else
@@ -2297,12 +2297,12 @@ void ChampionMan::drawHealthStaminaManaValues(Champion* champ) {
void ChampionMan::drawSlot(uint16 champIndex, int16 slotIndex) {
int16 nativeBitmapIndex = -1;
Champion *champ = &_champions[champIndex];
- bool isInventoryChamp = (_vm->_inventoryMan->_g432_inventoryChampionOrdinal == _vm->M0_indexToOrdinal(champIndex));
+ bool isInventoryChamp = (_vm->_inventoryMan->_g432_inventoryChampionOrdinal == _vm->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) || (_candidateChampionOrdinal == _vm->M0_indexToOrdinal(champIndex)))
+ if ((slotIndex > k1_ChampionSlotActionHand) || (_candidateChampionOrdinal == _vm->indexToOrdinal(champIndex)))
return;
slotBoxIndex = (champIndex << 1) + slotIndex;
} else
@@ -2352,7 +2352,7 @@ void ChampionMan::drawSlot(uint16 champIndex, int16 slotIndex) {
}
}
- if ((slotIndex == k1_ChampionSlotActionHand) && (_vm->M0_indexToOrdinal(champIndex) == _actingChampionOrdinal))
+ if ((slotIndex == k1_ChampionSlotActionHand) && (_vm->indexToOrdinal(champIndex) == _actingChampionOrdinal))
nativeBitmapIndex = k35_SlotBoxActingHandIndice;
if (nativeBitmapIndex != -1) {
diff --git a/engines/dm/console.cpp b/engines/dm/console.cpp
index a32bcb7055..9874708e0e 100644
--- a/engines/dm/console.cpp
+++ b/engines/dm/console.cpp
@@ -178,12 +178,12 @@ bool Console::Cmd_map(int argc, const char** argv) {
debugPrintf("Map set to %d\n", index);
_vm->_moveSens->f267_getMoveResult(Thing::_party, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, kM1_MapXNotOnASquare, 0);
- _vm->_g327_newPartyMapIndex = _vm->_dungeonMan->f154_getLocationAfterLevelChange(
+ _vm->_newPartyMapIndex = _vm->_dungeonMan->f154_getLocationAfterLevelChange(
_vm->_dungeonMan->_g309_partyMapIndex, index - _vm->_dungeonMan->_g309_partyMapIndex,
&_vm->_dungeonMan->_g306_partyMapX, &_vm->_dungeonMan->_g307_partyMapY);
- if (_vm->_g327_newPartyMapIndex == -1)
- _vm->_g327_newPartyMapIndex = index;
- _vm->_dungeonMan->f173_setCurrentMap(_vm->_g327_newPartyMapIndex);
+ if (_vm->_newPartyMapIndex == -1)
+ _vm->_newPartyMapIndex = index;
+ _vm->_dungeonMan->f173_setCurrentMap(_vm->_newPartyMapIndex);
_vm->_championMan->setPartyDirection(_vm->_dungeonMan->f155_getStairsExitDirection(_vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY));
_vm->_dungeonMan->f173_setCurrentMap(_vm->_dungeonMan->_g309_partyMapIndex);
} else
diff --git a/engines/dm/dialog.cpp b/engines/dm/dialog.cpp
index 6772d32f04..bf9ea5524a 100644
--- a/engines/dm/dialog.cpp
+++ b/engines/dm/dialog.cpp
@@ -34,10 +34,10 @@
namespace DM {
DialogMan::DialogMan(DMEngine *vm) : _vm(vm) {
- _g335_selectedDialogChoice = 0;
+ _selectedDialogChoice = 0;
}
-void DialogMan::f427_dialogDraw(const char *msg1, const char *msg2, const char *choice1, const char *choice2, const char *choice3, const char *choice4, bool screenDialog, bool clearScreen, bool fading) {
+void DialogMan::dialogDraw(const char *msg1, const char *msg2, const char *choice1, const char *choice2, const char *choice3, const char *choice4, bool screenDialog, bool clearScreen, bool fading) {
static Box constBox1 = Box(0, 223, 101, 125);
static Box constBox2 = Box(0, 223, 76, 100);
static Box constBox3 = Box(0, 223, 51, 75);
@@ -69,21 +69,21 @@ void DialogMan::f427_dialogDraw(const char *msg1, const char *msg2, const char *
_vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->_g296_bitmapViewport, _vm->_displayMan->_g296_bitmapViewport, constBox1, 0, 64, k112_byteWidthViewport, k112_byteWidthViewport, kM1_ColorNoTransparency, k136_heightViewport, k136_heightViewport);
_vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->_g296_bitmapViewport, _vm->_displayMan->_g296_bitmapViewport, constBox2, 0, 39, k112_byteWidthViewport, k112_byteWidthViewport, kM1_ColorNoTransparency, k136_heightViewport, k136_heightViewport);
_vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->_g296_bitmapViewport, _vm->_displayMan->_g296_bitmapViewport, constBox3, 0, 14, k112_byteWidthViewport, k112_byteWidthViewport, kM1_ColorNoTransparency, k136_heightViewport, k136_heightViewport);
- f425_printCenteredChoice(_vm->_displayMan->_g296_bitmapViewport, choice1, 112, 114);
+ printCenteredChoice(_vm->_displayMan->_g296_bitmapViewport, choice1, 112, 114);
} else if (choiceCount == 2) {
_vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->_g296_bitmapViewport, _vm->_displayMan->_g296_bitmapViewport, dialog2ChoicesPatch, 102, 52, k112_byteWidthViewport, k112_byteWidthViewport, kM1_ColorNoTransparency, k136_heightViewport, k136_heightViewport);
- f425_printCenteredChoice(_vm->_displayMan->_g296_bitmapViewport, choice1, 112, 77);
- f425_printCenteredChoice(_vm->_displayMan->_g296_bitmapViewport, choice2, 112, 114);
+ printCenteredChoice(_vm->_displayMan->_g296_bitmapViewport, choice1, 112, 77);
+ printCenteredChoice(_vm->_displayMan->_g296_bitmapViewport, choice2, 112, 114);
} else if (choiceCount == 3) {
- f425_printCenteredChoice(_vm->_displayMan->_g296_bitmapViewport, choice1, 112, 77);
- f425_printCenteredChoice(_vm->_displayMan->_g296_bitmapViewport, choice2, 59, 114);
- f425_printCenteredChoice(_vm->_displayMan->_g296_bitmapViewport, choice3, 166, 114);
+ printCenteredChoice(_vm->_displayMan->_g296_bitmapViewport, choice1, 112, 77);
+ printCenteredChoice(_vm->_displayMan->_g296_bitmapViewport, choice2, 59, 114);
+ printCenteredChoice(_vm->_displayMan->_g296_bitmapViewport, choice3, 166, 114);
} else if (choiceCount == 4) {
_vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->_g296_bitmapViewport, _vm->_displayMan->_g296_bitmapViewport, dialog4ChoicesPatch, 102, 99, k112_byteWidthViewport, k112_byteWidthViewport, kM1_ColorNoTransparency, k136_heightViewport, k136_heightViewport);
- f425_printCenteredChoice(_vm->_displayMan->_g296_bitmapViewport, choice1, 59, 77);
- f425_printCenteredChoice(_vm->_displayMan->_g296_bitmapViewport, choice2, 166, 77);
- f425_printCenteredChoice(_vm->_displayMan->_g296_bitmapViewport, choice3, 59, 114);
- f425_printCenteredChoice(_vm->_displayMan->_g296_bitmapViewport, choice4, 166, 114);
+ printCenteredChoice(_vm->_displayMan->_g296_bitmapViewport, choice1, 59, 77);
+ printCenteredChoice(_vm->_displayMan->_g296_bitmapViewport, choice2, 166, 77);
+ printCenteredChoice(_vm->_displayMan->_g296_bitmapViewport, choice3, 59, 114);
+ printCenteredChoice(_vm->_displayMan->_g296_bitmapViewport, choice4, 166, 114);
}
int16 textPosX;
@@ -91,7 +91,7 @@ void DialogMan::f427_dialogDraw(const char *msg1, const char *msg2, const char *
if (msg1) {
char L1312_ac_StringPart1[70];
char L1313_ac_StringPart2[70];
- if (f426_isMessageOnTwoLines(msg1, L1312_ac_StringPart1, L1313_ac_StringPart2)) {
+ if (isMessageOnTwoLines(msg1, L1312_ac_StringPart1, L1313_ac_StringPart2)) {
textPosY = 21;
textPosX = 113 - ((strlen(L1312_ac_StringPart1) * 6) >> 1);
_vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_g296_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, k11_ColorYellow, k5_ColorLightBrown, L1312_ac_StringPart1, k136_heightViewport);
@@ -108,7 +108,7 @@ void DialogMan::f427_dialogDraw(const char *msg1, const char *msg2, const char *
if (msg2) {
char L1312_ac_StringPart1[70];
char L1313_ac_StringPart2[70];
- if (f426_isMessageOnTwoLines(msg2, L1312_ac_StringPart1, L1313_ac_StringPart2)) {
+ if (isMessageOnTwoLines(msg2, L1312_ac_StringPart1, L1313_ac_StringPart2)) {
textPosX = 113 - ((strlen(L1312_ac_StringPart1) * 6) >> 1);
_vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_g296_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, k9_ColorGold, k5_ColorLightBrown, L1312_ac_StringPart1, k136_heightViewport);
textPosY += 8;
@@ -130,7 +130,7 @@ void DialogMan::f427_dialogDraw(const char *msg1, const char *msg2, const char *
_vm->_eventMan->f77_hideMouse();
} else {
_vm->_displayMan->f97_drawViewport(k0_viewportNotDungeonView);
- _vm->f22_delay(1);
+ _vm->delay(1);
}
if (fading)
@@ -140,14 +140,14 @@ void DialogMan::f427_dialogDraw(const char *msg1, const char *msg2, const char *
_vm->_displayMan->updateScreen();
}
-void DialogMan::f425_printCenteredChoice(byte *bitmap, const char *str, int16 posX, int16 posY) {
+void DialogMan::printCenteredChoice(byte *bitmap, const char *str, int16 posX, int16 posY) {
if (str) {
posX -= (strlen(str) * 6) >> 1;
_vm->_textMan->f40_printTextToBitmap(bitmap, k112_byteWidthViewport, posX, posY, k9_ColorGold, k5_ColorLightBrown, str, k136_heightViewport);
}
}
-bool DialogMan::f426_isMessageOnTwoLines(const char *str, char *part1, char *part2) {
+bool DialogMan::isMessageOnTwoLines(const char *str, char *part1, char *part2) {
uint16 strLength = strlen(str);
if (strLength <= 30)
return false;
@@ -162,7 +162,7 @@ bool DialogMan::f426_isMessageOnTwoLines(const char *str, char *part1, char *par
return true;
}
-int16 DialogMan::f424_dialogGetChoice(uint16 choiceCount, uint16 dialogSetIndex, int16 driveType, int16 automaticChoiceIfFlopyInDrive) {
+int16 DialogMan::getChoice(uint16 choiceCount, uint16 dialogSetIndex, int16 driveType, int16 automaticChoiceIfFlopyInDrive) {
MouseInput *L1298_ps_PrimaryMouseInputBackup;
MouseInput *L1299_ps_SecondaryMouseInputBackup;
KeyboardInput *L1300_ps_PrimaryKeyboardInputBackup;
@@ -180,21 +180,21 @@ int16 DialogMan::f424_dialogGetChoice(uint16 choiceCount, uint16 dialogSetIndex,
_vm->_eventMan->_g444_secondaryKeyboardInput = nullptr;
_vm->_eventMan->_g441_primaryMouseInput = _vm->_eventMan->_primaryMouseInputDialogSets[dialogSetIndex][choiceCount - 1];
_vm->_eventMan->f357_discardAllInput();
- _g335_selectedDialogChoice = 99;
+ _selectedDialogChoice = 99;
do {
Common::Event key;
Common::EventType eventType = _vm->_eventMan->processInput(&key);
_vm->_eventMan->f380_processCommandQueue();
- _vm->f22_delay(1);
+ _vm->delay(1);
_vm->_displayMan->updateScreen();
- if ((_g335_selectedDialogChoice == 99) && (choiceCount == 1)
+ if ((_selectedDialogChoice == 99) && (choiceCount == 1)
&& (eventType != Common::EVENT_INVALID) && key.kbd.keycode == Common::KEYCODE_RETURN) {
/* If a choice has not been made yet with the mouse and the dialog has only one possible choice and carriage return was pressed on the keyboard */
- _g335_selectedDialogChoice = k1_DIALOG_CHOICE_1;
+ _selectedDialogChoice = k1_DIALOG_CHOICE_1;
}
- } while (_g335_selectedDialogChoice == 99);
+ } while (_selectedDialogChoice == 99);
_vm->_displayMan->_g578_useByteBoxCoordinates = false;
- L1304_s_BoxA = _vm->_eventMan->_g441_primaryMouseInput[_g335_selectedDialogChoice - 1]._hitbox;
+ L1304_s_BoxA = _vm->_eventMan->_g441_primaryMouseInput[_selectedDialogChoice - 1]._hitbox;
L1304_s_BoxA._x1 -= 3;
L1304_s_BoxA._x2 += 3;
L1304_s_BoxA._y1 -= 3;
@@ -207,7 +207,7 @@ int16 DialogMan::f424_dialogGetChoice(uint16 choiceCount, uint16 dialogSetIndex,
L1303_s_BoxB._x2 = L1304_s_BoxA._x2 - L1304_s_BoxA._x1 + 3;
_vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->_g348_bitmapScreen, _vm->_displayMan->_g296_bitmapViewport,
L1303_s_BoxB, L1304_s_BoxA._x1, L1304_s_BoxA._y1, k160_byteWidthScreen, k160_byteWidthScreen, kM1_ColorNoTransparency, 200, 25);
- _vm->f22_delay(1);
+ _vm->delay(1);
L1303_s_BoxB = L1304_s_BoxA;
L1303_s_BoxB._y2 = L1303_s_BoxB._y1;
_vm->_displayMan->D24_fillScreenBox(L1303_s_BoxB, k5_ColorLightBrown);
@@ -223,7 +223,7 @@ int16 DialogMan::f424_dialogGetChoice(uint16 choiceCount, uint16 dialogSetIndex,
L1303_s_BoxB = L1304_s_BoxA;
L1303_s_BoxB._x1 = L1303_s_BoxB._x2;
_vm->_displayMan->D24_fillScreenBox(L1303_s_BoxB, k0_ColorBlack);
- _vm->f22_delay(2);
+ _vm->delay(2);
L1303_s_BoxB = L1304_s_BoxA;
L1303_s_BoxB._y1++;
L1303_s_BoxB._y2 = L1303_s_BoxB._y1;
@@ -251,7 +251,7 @@ int16 DialogMan::f424_dialogGetChoice(uint16 choiceCount, uint16 dialogSetIndex,
L1303_s_BoxB._x1 = L1303_s_BoxB._x2 = L1303_s_BoxB._x2 + 3;
L1303_s_BoxB._y2 += 2;
_vm->_displayMan->D24_fillScreenBox(L1303_s_BoxB, k13_ColorLightestGray);
- _vm->f22_delay(2);
+ _vm->delay(2);
L1304_s_BoxA._x2 += 3;
L1304_s_BoxA._y2 += 3;
_vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->_g296_bitmapViewport, _vm->_displayMan->_g348_bitmapScreen,
@@ -263,6 +263,6 @@ int16 DialogMan::f424_dialogGetChoice(uint16 choiceCount, uint16 dialogSetIndex,
_vm->_eventMan->_g444_secondaryKeyboardInput = L1301_ps_SecondaryKeyboardInputBackup;
_vm->_eventMan->f357_discardAllInput();
_vm->_eventMan->f78_showMouse();
- return _g335_selectedDialogChoice;
+ return _selectedDialogChoice;
}
}
diff --git a/engines/dm/dialog.h b/engines/dm/dialog.h
index 1ac88fec7f..647ae8dd3e 100644
--- a/engines/dm/dialog.h
+++ b/engines/dm/dialog.h
@@ -45,13 +45,13 @@ namespace DM {
class DialogMan {
DMEngine *_vm;
public:
- uint16 _g335_selectedDialogChoice; // @ G0335_ui_SelectedDialogChoice
+ uint16 _selectedDialogChoice; // @ G0335_ui_SelectedDialogChoice
explicit DialogMan(DMEngine *vm);
- void f427_dialogDraw(const char *msg1, const char *msg2, const char *choice1, const char *choice2,
+ void dialogDraw(const char *msg1, const char *msg2, const char *choice1, const char *choice2,
const char *choice3, const char *choice4, bool screenDialog, bool clearScreen, bool fading); // @ F0427_DIALOG_Draw
- void f425_printCenteredChoice(byte *bitmap, const char *str, int16 posX, int16 posY); // @ F0425_DIALOG_PrintCenteredChoice
- bool f426_isMessageOnTwoLines(const char *str, char *part1, char *part2); // @ F0426_DIALOG_IsMessageOnTwoLines
- int16 f424_dialogGetChoice(uint16 choiceCount, uint16 dialogSetIndex, int16 driveType, int16 automaticChoiceIfFlopyInDrive); // @ F0424_DIALOG_GetChoice
+ void printCenteredChoice(byte *bitmap, const char *str, int16 posX, int16 posY); // @ F0425_DIALOG_PrintCenteredChoice
+ bool isMessageOnTwoLines(const char *str, char *part1, char *part2); // @ F0426_DIALOG_IsMessageOnTwoLines
+ int16 getChoice(uint16 choiceCount, uint16 dialogSetIndex, int16 driveType, int16 automaticChoiceIfFlopyInDrive); // @ F0424_DIALOG_GetChoice
};
}
diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp
index e4fa21050c..37f03056ea 100644
--- a/engines/dm/dm.cpp
+++ b/engines/dm/dm.cpp
@@ -118,31 +118,31 @@ uint16 toggleFlag(uint16& val, uint16 mask) {
return val ^= mask;
}
-uint16 M75_bitmapByteCount(uint16 pixelWidth, uint16 height) {
+uint16 bitmapByteCount(uint16 pixelWidth, uint16 height) {
return pixelWidth / 2 * height;
}
-uint16 M21_normalizeModulo4(uint16 val) {
+uint16 normalizeModulo4(uint16 val) {
return val & 3;
}
-int32 M30_time(int32 mapTime) {
+int32 filterTime(int32 mapTime) {
return mapTime & 0x00FFFFFF;
}
-int32 M33_setMapAndTime(int32 &mapTime, uint32 map, uint32 time) {
+int32 setMapAndTime(int32 &mapTime, uint32 map, uint32 time) {
return (mapTime) = ((time) | (((long)(map)) << 24));
}
-uint16 M29_map(int32 mapTime) {
+uint16 getMap(int32 mapTime) {
return ((uint16)((mapTime) >> 24));
}
-Thing M15_thingWithNewCell(Thing thing, int16 cell) {
+Thing thingWithNewCell(Thing thing, int16 cell) {
return Thing(((thing.toUint16()) & 0x3FFF) | ((cell) << 14));
}
-int16 M38_distance(int16 mapx1, int16 mapy1, int16 mapx2, int16 mapy2) {
+int16 getDistance(int16 mapx1, int16 mapy1, int16 mapx2, int16 mapy2) {
return ABS(mapx1 - mapx2) + ABS(mapy1 - mapy2);
}
@@ -166,32 +166,32 @@ DMEngine::DMEngine(OSystem *syst, const DMADGameDescription *desc) : Engine(syst
_sound = nullptr;
_engineShouldQuit = false;
- _g526_dungeonId = 0;
-
- _g298_newGame = 0;
- _g523_restartGameRequest = false;
- _g321_stopWaitingForPlayerInput = true;
- _g301_gameTimeTicking = false;
- _g524_restartGameAllowed = false;
- _g525_gameId = 0;
- _g331_pressingEye = false;
- _g332_stopPressingEye = false;
- _g333_pressingMouth = false;
- _g334_stopPressingMouth = false;
- _g340_highlightBoxInversionRequested = false;
- _g311_projectileDisableMovementTicks = 0;
- _g312_lastProjectileDisabledMovementDirection = 0;
- _g302_gameWon = false;
- _g327_newPartyMapIndex = kM1_mapIndexNone;
- _g325_setMousePointerToObjectInMainLoop = false;
- _g310_disabledMovementTicks = 0;
- _g313_gameTime = 0;
- _g353_stringBuildBuffer[0] = '\0';
- _g318_waitForInputMaxVerticalBlankCount = 0;
+ _dungeonId = 0;
+
+ _newGameFl = 0;
+ _restartGameRequest = false;
+ _stopWaitingForPlayerInput = true;
+ _gameTimeTicking = false;
+ _restartGameAllowed = false;
+ _gameId = 0;
+ _pressingEye = false;
+ _stopPressingEye = false;
+ _pressingMouth = false;
+ _stopPressingMouth = false;
+ _highlightBoxInversionRequested = false;
+ _projectileDisableMovementTicks = 0;
+ _lastProjectileDisabledMovementDirection = 0;
+ _gameWon = false;
+ _newPartyMapIndex = kM1_mapIndexNone;
+ _setMousePointerToObjectInMainLoop = false;
+ _disabledMovementTicks = 0;
+ _gameTime = 0;
+ _stringBuildBuffer[0] = '\0';
+ _waitForInputMaxVerticalBlankCount = 0;
_savedScreenForOpenEntranceDoors = nullptr;
for (uint16 i = 0; i < 10; ++i)
- _g562_entranceDoorAnimSteps[i] = nullptr;
- _g564_interfaceCredits = nullptr;
+ _entranceDoorAnimSteps[i] = nullptr;
+ _interfaceCredits = nullptr;
debug("DMEngine::DMEngine");
_saveThumbnail = nullptr;
@@ -234,13 +234,13 @@ bool DMEngine::hasFeature(EngineFeature f) const {
}
Common::Error DMEngine::loadGameState(int slot) {
- if (f435_loadgame(slot) != kM1_LoadgameFailure) {
+ if (loadgame(slot) != kM1_LoadgameFailure) {
_displayMan->fillScreen(k0_ColorBlack);
_displayMan->f436_STARTEND_FadeToPalette(_displayMan->_palDungeonView[0]);
- _g298_newGame = k0_modeLoadSavedGame;
+ _newGameFl = k0_modeLoadSavedGame;
- f462_startGame();
- _g523_restartGameRequest = false;
+ startGame();
+ _restartGameRequest = false;
_eventMan->f77_hideMouse();
_eventMan->f357_discardAllInput();
return Common::kNoError;
@@ -253,7 +253,7 @@ bool DMEngine::canLoadGameStateCurrently() {
return _canLoadFromGMM;
}
-void DMEngine::f22_delay(uint16 verticalBlank) {
+void DMEngine::delay(uint16 verticalBlank) {
for (uint16 i = 0; i < verticalBlank * 2; ++i) {
_eventMan->processInput();
_displayMan->updateScreen();
@@ -261,12 +261,12 @@ void DMEngine::f22_delay(uint16 verticalBlank) {
}
}
-uint16 DMEngine::f30_getScaledProduct(uint16 val, uint16 scale, uint16 vale2) {
+uint16 DMEngine::getScaledProduct(uint16 val, uint16 scale, uint16 vale2) {
return ((uint32)val * vale2) >> scale;
}
-void DMEngine::f463_initializeGame() {
- f448_initMemoryManager();
+void DMEngine::initializeGame() {
+ initMemoryManager();
_displayMan->f479_loadGraphics();
_displayMan->f460_initializeGraphicData();
_displayMan->f94_loadFloorSet(k0_FloorSetStone);
@@ -275,7 +275,7 @@ void DMEngine::f463_initializeGame() {
_sound->f503_loadSounds(); // @ F0506_AMIGA_AllocateData
if (!ConfMan.hasKey("save_slot")) // skip drawing title if loading from launcher
- f437_STARTEND_drawTittle();
+ drawTittle();
_textMan->f54_textInitialize();
_objectMan->loadObjectNames();
@@ -287,31 +287,31 @@ void DMEngine::f463_initializeGame() {
if (ConfMan.hasKey("save_slot")) {
saveSlot = ConfMan.getInt("save_slot");
} else { // else show the entrance
- f441_processEntrance();
+ processEntrance();
if (_engineShouldQuit)
return;
- if (_g298_newGame == k0_modeLoadSavedGame) { // if resume was clicked, bring up ScummVM load screen
+ if (_newGameFl == k0_modeLoadSavedGame) { // if resume was clicked, bring up ScummVM load screen
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false);
saveSlot = dialog->runModalWithCurrentTarget();
delete dialog;
}
}
- } while (f435_loadgame(saveSlot) != k1_LoadgameSuccess);
+ } while (loadgame(saveSlot) != k1_LoadgameSuccess);
_displayMan->f466_loadIntoBitmap(k11_MenuSpellAreLinesIndice, _menuMan->_gK73_bitmapSpellAreaLines); // @ F0396_MENUS_LoadSpellAreaLinesBitmap
// There was some memory wizardy for the Amiga platform, I skipped that part
_displayMan->f461_allocateFlippedWallBitmaps();
- f462_startGame();
- if (_g298_newGame)
+ startGame();
+ if (_newGameFl)
_moveSens->f267_getMoveResult(Thing::_party, kM1_MapXNotOnASquare, 0, _dungeonMan->_g306_partyMapX, _dungeonMan->_g307_partyMapY);
_eventMan->f78_showMouse();
_eventMan->f357_discardAllInput();
}
-void DMEngine::f448_initMemoryManager() {
+void DMEngine::initMemoryManager() {
static uint16 palSwoosh[16] = {0x000, 0xFFF, 0xFFF, 0xFFF, 0xFFF, 0xFFF, 0xFFF, 0xFFF, 0x000, 0xFFF, 0xAAA, 0xFFF, 0xAAA, 0x444, 0xFF0, 0xFF0}; // @ K0057_aui_Palette_Swoosh
_displayMan->f508_buildPaletteChangeCopperList(palSwoosh, palSwoosh);
@@ -321,33 +321,33 @@ void DMEngine::f448_initMemoryManager() {
}
}
-void DMEngine::f462_startGame() {
+void DMEngine::startGame() {
static Box boxScreenTop(0, 319, 0, 32); // @ G0061_s_Graphic562_Box_ScreenTop
static Box boxScreenRight(224, 319, 33, 169); // @ G0062_s_Graphic562_Box_ScreenRight
static Box boxScreenBottom(0, 319, 169, 199); // @ G0063_s_Graphic562_Box_ScreenBottom
- _g331_pressingEye = false;
- _g332_stopPressingEye = false;
- _g333_pressingMouth = false;
- _g334_stopPressingMouth = false;
- _g340_highlightBoxInversionRequested = false;
+ _pressingEye = false;
+ _stopPressingEye = false;
+ _pressingMouth = false;
+ _stopPressingMouth = false;
+ _highlightBoxInversionRequested = false;
_eventMan->_g341_highlightBoxEnabled = false;
_championMan->_partyIsSleeping = false;
- _championMan->_actingChampionOrdinal = M0_indexToOrdinal(kM1_ChampionNone);
+ _championMan->_actingChampionOrdinal = indexToOrdinal(kM1_ChampionNone);
_menuMan->_g509_actionAreaContainsIcons = true;
- _eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap = M0_indexToOrdinal(kM1_ChampionNone);
+ _eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap = indexToOrdinal(kM1_ChampionNone);
_eventMan->_g441_primaryMouseInput = _eventMan->_primaryMouseInputInterface;
_eventMan->_g442_secondaryMouseInput = _eventMan->_secondaryMouseInputMovement;
_eventMan->_g443_primaryKeyboardInput = _eventMan->_primaryKeyboardInputInterface;
_eventMan->_g444_secondaryKeyboardInput = _eventMan->_secondaryKeyboardInputMovement;
- f3_processNewPartyMap(_dungeonMan->_g309_partyMapIndex);
+ processNewPartyMap(_dungeonMan->_g309_partyMapIndex);
- if (!_g298_newGame) {
+ if (!_newGameFl) {
_displayMan->f436_STARTEND_FadeToPalette(_displayMan->_g347_paletteTopAndBottomScreen);
_displayMan->_g578_useByteBoxCoordinates = false;
- f22_delay(1);
+ delay(1);
_displayMan->D24_fillScreenBox(boxScreenTop, k0_ColorBlack);
_displayMan->D24_fillScreenBox(boxScreenRight, k0_ColorBlack);
_displayMan->D24_fillScreenBox(boxScreenBottom, k0_ColorBlack);
@@ -361,10 +361,10 @@ void DMEngine::f462_startGame() {
_displayMan->f508_buildPaletteChangeCopperList(_displayMan->_palDungeonView[0], _displayMan->_g347_paletteTopAndBottomScreen);
_menuMan->f395_drawMovementArrows();
_championMan->resetDataToStartGame();
- _g301_gameTimeTicking = true;
+ _gameTimeTicking = true;
}
-void DMEngine::f3_processNewPartyMap(uint16 mapIndex) {
+void DMEngine::processNewPartyMap(uint16 mapIndex) {
_groupMan->f194_removeAllActiveGroups();
_dungeonMan->f174_setCurrentMapAndPartyMap(mapIndex);
_displayMan->f96_loadCurrentMapGraphics();
@@ -373,7 +373,7 @@ void DMEngine::f3_processNewPartyMap(uint16 mapIndex) {
}
Common::Error DMEngine::run() {
- initArrays();
+ initConstants();
// scummvm/engine specific
initGraphics(320, 200, false);
@@ -394,15 +394,15 @@ Common::Error DMEngine::run() {
_sound = SoundMan::getSoundMan(this, _gameVersion);
_displayMan->setUpScreens(320, 200);
- f463_initializeGame();
+ initializeGame();
while (true) {
- f2_gameloop();
+ gameloop();
if (_engineShouldQuit)
return Common::kNoError;
if (_loadSaveSlotAtRuntime == -1)
- f444_endGame(_championMan->_partyDead);
+ endGame(_championMan->_partyDead);
else {
loadGameState(_loadSaveSlotAtRuntime);
_menuMan->f457_drawEnabledMenus();
@@ -414,9 +414,9 @@ Common::Error DMEngine::run() {
return Common::kNoError;
}
-void DMEngine::f2_gameloop() {
+void DMEngine::gameloop() {
_canLoadFromGMM = true;
- _g318_waitForInputMaxVerticalBlankCount = 10;
+ _waitForInputMaxVerticalBlankCount = 10;
while (true) {
if (_engineShouldQuit) {
_canLoadFromGMM = false;
@@ -437,15 +437,15 @@ void DMEngine::f2_gameloop() {
for (;;) {
- if (_g327_newPartyMapIndex != kM1_mapIndexNone) {
- f3_processNewPartyMap(_g327_newPartyMapIndex);
+ if (_newPartyMapIndex != kM1_mapIndexNone) {
+ processNewPartyMap(_newPartyMapIndex);
_moveSens->f267_getMoveResult(Thing::_party, kM1_MapXNotOnASquare, 0, _dungeonMan->_g306_partyMapX, _dungeonMan->_g307_partyMapY);
- _g327_newPartyMapIndex = kM1_mapIndexNone;
+ _newPartyMapIndex = kM1_mapIndexNone;
_eventMan->f357_discardAllInput();
}
_timeline->f261_processTimeline();
- if (_g327_newPartyMapIndex == kM1_mapIndexNone)
+ if (_newPartyMapIndex == kM1_mapIndexNone)
break;
}
@@ -453,8 +453,8 @@ void DMEngine::f2_gameloop() {
Box box(0, 223, 0, 135);
_displayMan->f135_fillBoxBitmap(_displayMan->_g296_bitmapViewport, box, k0_ColorBlack, k112_byteWidthViewport, k136_heightViewport); // (possibly dummy code)
_displayMan->f128_drawDungeon(_dungeonMan->_g308_partyDir, _dungeonMan->_g306_partyMapX, _dungeonMan->_g307_partyMapY);
- if (_g325_setMousePointerToObjectInMainLoop) {
- _g325_setMousePointerToObjectInMainLoop = false;
+ if (_setMousePointerToObjectInMainLoop) {
+ _setMousePointerToObjectInMainLoop = false;
_eventMan->f78_showMouse();
_eventMan->f68_setPointerToObject(_objectMan->_g412_objectIconForMousePointer);
_eventMan->f77_hideMouse();
@@ -473,9 +473,9 @@ void DMEngine::f2_gameloop() {
if (_championMan->_partyDead)
break;
- _g313_gameTime++;
+ _gameTime++;
- if (!(_g313_gameTime & 511))
+ if (!(_gameTime & 511))
_inventoryMan->f338_decreaseTorchesLightPower();
if (_championMan->_party._freezeLifeTicks)
@@ -483,28 +483,28 @@ void DMEngine::f2_gameloop() {
_menuMan->f390_refreshActionAreaAndSetChampDirMaxDamageReceived();
- if (!(_g313_gameTime & (_championMan->_partyIsSleeping ? 15 : 63)))
+ if (!(_gameTime & (_championMan->_partyIsSleeping ? 15 : 63)))
_championMan->applyTimeEffects();
- if (_g310_disabledMovementTicks)
- _g310_disabledMovementTicks--;
+ if (_disabledMovementTicks)
+ _disabledMovementTicks--;
- if (_g311_projectileDisableMovementTicks)
- _g311_projectileDisableMovementTicks--;
+ if (_projectileDisableMovementTicks)
+ _projectileDisableMovementTicks--;
_textMan->f44_messageAreaClearExpiredRows();
- _g321_stopWaitingForPlayerInput = false;
+ _stopWaitingForPlayerInput = false;
uint16 vblankCounter = 0;
do {
_eventMan->processInput();
- if (_g332_stopPressingEye) {
- _g331_pressingEye = false;
- _g332_stopPressingEye = false;
+ if (_stopPressingEye) {
+ _pressingEye = false;
+ _stopPressingEye = false;
_inventoryMan->f353_drawStopPressingEye();
- } else if (_g334_stopPressingMouth) {
- _g333_pressingMouth = false;
- _g334_stopPressingMouth = false;
+ } else if (_stopPressingMouth) {
+ _pressingMouth = false;
+ _stopPressingMouth = false;
_inventoryMan->f350_drawStopPressingMouth();
}
@@ -514,42 +514,42 @@ void DMEngine::f2_gameloop() {
return;
}
_displayMan->updateScreen();
- if (!_g321_stopWaitingForPlayerInput) {
+ if (!_stopWaitingForPlayerInput) {
_eventMan->f363_highlightBoxDisable();
}
_system->delayMillis(2);
- if (++vblankCounter >= _g318_waitForInputMaxVerticalBlankCount * 4)
- _g321_stopWaitingForPlayerInput = true;
+ if (++vblankCounter >= _waitForInputMaxVerticalBlankCount * 4)
+ _stopWaitingForPlayerInput = true;
- } while (!_g321_stopWaitingForPlayerInput || !_g301_gameTimeTicking);
+ } while (!_stopWaitingForPlayerInput || !_gameTimeTicking);
}
_canLoadFromGMM = false;
}
-int16 DMEngine::M1_ordinalToIndex(int16 val) {
+int16 DMEngine::ordinalToIndex(int16 val) {
return val - 1;
}
-int16 DMEngine::M0_indexToOrdinal(int16 val) {
+int16 DMEngine::indexToOrdinal(int16 val) {
return val + 1;
}
-void DMEngine::f441_processEntrance() {
+void DMEngine::processEntrance() {
_eventMan->_g441_primaryMouseInput = _eventMan->_primaryMouseInputEntrance;
_eventMan->_g442_secondaryMouseInput = nullptr;
_eventMan->_g443_primaryKeyboardInput = nullptr;
_eventMan->_g444_secondaryKeyboardInput = nullptr;
- _g562_entranceDoorAnimSteps[0] = new byte[128 * 161 * 12];
+ _entranceDoorAnimSteps[0] = new byte[128 * 161 * 12];
for (uint16 idx = 1; idx < 8; idx++)
- _g562_entranceDoorAnimSteps[idx] = _g562_entranceDoorAnimSteps[idx - 1] + 128 * 161;
+ _entranceDoorAnimSteps[idx] = _entranceDoorAnimSteps[idx - 1] + 128 * 161;
- _g562_entranceDoorAnimSteps[8] = _g562_entranceDoorAnimSteps[7] + 128 * 161;
- _g562_entranceDoorAnimSteps[9] = _g562_entranceDoorAnimSteps[8] + 128 * 161 * 2;
+ _entranceDoorAnimSteps[8] = _entranceDoorAnimSteps[7] + 128 * 161;
+ _entranceDoorAnimSteps[9] = _entranceDoorAnimSteps[8] + 128 * 161 * 2;
- _displayMan->f466_loadIntoBitmap(k3_entranceRightDoorGraphicIndice, _g562_entranceDoorAnimSteps[4]);
- _displayMan->f466_loadIntoBitmap(k2_entranceLeftDoorGraphicIndice, _g562_entranceDoorAnimSteps[0]);
- _g564_interfaceCredits = _displayMan->f489_getNativeBitmapOrGraphic(k5_creditsGraphicIndice);
+ _displayMan->f466_loadIntoBitmap(k3_entranceRightDoorGraphicIndice, _entranceDoorAnimSteps[4]);
+ _displayMan->f466_loadIntoBitmap(k2_entranceLeftDoorGraphicIndice, _entranceDoorAnimSteps[0]);
+ _interfaceCredits = _displayMan->f489_getNativeBitmapOrGraphic(k5_creditsGraphicIndice);
_displayMan->_g578_useByteBoxCoordinates = false;
Box displayBox;
displayBox._x1 = 0;
@@ -557,42 +557,42 @@ void DMEngine::f441_processEntrance() {
displayBox._y1 = 0;
displayBox._y2 = 160;
for (uint16 idx = 1; idx < 4; idx++) {
- _displayMan->f132_blitToBitmap(_g562_entranceDoorAnimSteps[0], _g562_entranceDoorAnimSteps[idx], displayBox, idx << 2, 0, k64_byteWidth, k64_byteWidth, kM1_ColorNoTransparency, 161, 161);
+ _displayMan->f132_blitToBitmap(_entranceDoorAnimSteps[0], _entranceDoorAnimSteps[idx], displayBox, idx << 2, 0, k64_byteWidth, k64_byteWidth, kM1_ColorNoTransparency, 161, 161);
displayBox._x2 -= 4;
}
displayBox._x2 = 127;
for (uint16 idx = 5; idx < 8; idx++) {
displayBox._x1 += 4;
- _displayMan->f132_blitToBitmap(_g562_entranceDoorAnimSteps[4], _g562_entranceDoorAnimSteps[idx], displayBox, 0, 0, k64_byteWidth, k64_byteWidth, kM1_ColorNoTransparency, 161, 161);
+ _displayMan->f132_blitToBitmap(_entranceDoorAnimSteps[4], _entranceDoorAnimSteps[idx], displayBox, 0, 0, k64_byteWidth, k64_byteWidth, kM1_ColorNoTransparency, 161, 161);
}
do {
- f439_drawEntrance();
+ drawEntrance();
_eventMan->f78_showMouse();
_eventMan->f357_discardAllInput();
- _g298_newGame = k99_modeWaitingOnEntrance;
+ _newGameFl = k99_modeWaitingOnEntrance;
do {
_eventMan->processInput();
if (_engineShouldQuit)
return;
_eventMan->f380_processCommandQueue();
_displayMan->updateScreen();
- } while (_g298_newGame == k99_modeWaitingOnEntrance);
- } while (_g298_newGame == k202_CommandEntranceDrawCredits);
+ } while (_newGameFl == k99_modeWaitingOnEntrance);
+ } while (_newGameFl == k202_CommandEntranceDrawCredits);
//Strangerke: CHECKME: Earlier versions were using G0566_puc_Graphic534_Sound01Switch
_sound->f060_SOUND_Play(k01_soundSWITCH, 112, 0x40, 0x40);
- f22_delay(20);
+ delay(20);
_eventMan->f78_showMouse();
- if (_g298_newGame)
- f438_STARTEND_OpenEntranceDoors();
+ if (_newGameFl)
+ openEntranceDoors();
- delete[] _g562_entranceDoorAnimSteps[0];
+ delete[] _entranceDoorAnimSteps[0];
for (uint16 i = 0; i < 10; ++i)
- _g562_entranceDoorAnimSteps[i] = nullptr;
+ _entranceDoorAnimSteps[i] = nullptr;
}
-void DMEngine::f444_endGame(bool doNotDrawCreditsOnly) {
+void DMEngine::endGame(bool doNotDrawCreditsOnly) {
static Box boxEndgameRestartOuterEN(103, 217, 145, 159);
static Box boxEndgameRestartInnerEN(105, 215, 147, 157);
@@ -633,9 +633,9 @@ void DMEngine::f444_endGame(bool doNotDrawCreditsOnly) {
_eventMan->_g442_secondaryMouseInput = nullptr;
_eventMan->_g443_primaryKeyboardInput = nullptr;
_eventMan->_g444_secondaryKeyboardInput = nullptr;
- if (doNotDrawCreditsOnly && !_g302_gameWon) {
+ if (doNotDrawCreditsOnly && !_gameWon) {
_sound->f064_SOUND_RequestPlay_CPSD(k06_soundSCREAM, _dungeonMan->_g306_partyMapX, _dungeonMan->_g307_partyMapY, k0_soundModePlayImmediately);
- f22_delay(240);
+ delay(240);
}
if (_displayMan->_g322_paletteSwitchingEnabled) {
@@ -643,14 +643,14 @@ void DMEngine::f444_endGame(bool doNotDrawCreditsOnly) {
for (uint16 i = 0; i < 16; ++i)
oldPalTopAndBottomScreen[i] = _displayMan->_g347_paletteTopAndBottomScreen[i];
for (int i = 0; i <= 7; i++) {
- f22_delay(1);
+ delay(1);
for (int colIdx = 0; colIdx < 16; colIdx++) {
_displayMan->_g346_paletteMiddleScreen[colIdx] = _displayMan->f431_getDarkenedColor(_displayMan->_g346_paletteMiddleScreen[colIdx]);
_displayMan->_g347_paletteTopAndBottomScreen[colIdx] = _displayMan->f431_getDarkenedColor(_displayMan->_g347_paletteTopAndBottomScreen[colIdx]);
}
}
_displayMan->_g322_paletteSwitchingEnabled = false;
- f22_delay(1);
+ delay(1);
for (uint16 i = 0; i < 16; ++i)
_displayMan->_g347_paletteTopAndBottomScreen[i] = oldPalTopAndBottomScreen[i];
} else
@@ -658,7 +658,7 @@ void DMEngine::f444_endGame(bool doNotDrawCreditsOnly) {
uint16 darkBluePalette[16];
if (doNotDrawCreditsOnly) {
- if (_g302_gameWon) {
+ if (_gameWon) {
// Strangerke: Related to portraits. Game data could be missing for earlier versions of the game.
_displayMan->fillScreen(k12_ColorDarkestGray);
for (int16 championIndex = k0_ChampionFirst; championIndex < _championMan->_partyChampionCount; championIndex++) {
@@ -705,9 +705,9 @@ T0444017:
_displayMan->f436_STARTEND_FadeToPalette(curPalette);
_displayMan->updateScreen();
if (waitBeforeDrawingRestart)
- f22_delay(300);
+ delay(300);
- if (_g524_restartGameAllowed) {
+ if (_restartGameAllowed) {
_displayMan->_g578_useByteBoxCoordinates = false;
_displayMan->D24_fillScreenBox(restartOuterBox, k12_ColorDarkestGray);
_displayMan->D24_fillScreenBox(restartInnerBox, k0_ColorBlack);
@@ -725,18 +725,18 @@ T0444017:
_eventMan->f357_discardAllInput();
_eventMan->f77_hideMouse();
_displayMan->f436_STARTEND_FadeToPalette(curPalette);
- for (int16 verticalBlankCount = 900; --verticalBlankCount && !_g523_restartGameRequest; f22_delay(1))
+ for (int16 verticalBlankCount = 900; --verticalBlankCount && !_restartGameRequest; delay(1))
_eventMan->f380_processCommandQueue();
_eventMan->f78_showMouse();
- if (_g523_restartGameRequest) {
+ if (_restartGameRequest) {
_displayMan->f436_STARTEND_FadeToPalette(darkBluePalette);
_displayMan->fillScreen(k0_ColorBlack);
_displayMan->f436_STARTEND_FadeToPalette(_displayMan->_palDungeonView[0]);
- _g298_newGame = k0_modeLoadSavedGame;
- if (f435_loadgame(1) != kM1_LoadgameFailure) {
- f462_startGame();
- _g523_restartGameRequest = false;
+ _newGameFl = k0_modeLoadSavedGame;
+ if (loadgame(1) != kM1_LoadgameFailure) {
+ startGame();
+ _restartGameRequest = false;
_eventMan->f77_hideMouse();
_eventMan->f357_discardAllInput();
return;
@@ -754,7 +754,7 @@ T0444017:
if (_engineShouldQuit)
return;
- if (_g524_restartGameAllowed && doNotDrawCreditsOnly) {
+ if (_restartGameAllowed && doNotDrawCreditsOnly) {
waitBeforeDrawingRestart = false;
_displayMan->f436_STARTEND_FadeToPalette(darkBluePalette);
goto T0444017;
@@ -765,7 +765,7 @@ T0444017:
}
-void DMEngine::f439_drawEntrance() {
+void DMEngine::drawEntrance() {
static Box doorsUpperHalfBox = Box(0, 231, 0, 80);
static Box doorsLowerHalfBox = Box(0, 231, 81, 160);
static Box closedDoorLeftBox = Box(0, 104, 30, 190);
@@ -802,15 +802,15 @@ void DMEngine::f439_drawEntrance() {
_savedScreenForOpenEntranceDoors = new byte[k200_heightScreen * k160_byteWidthScreen * 2];
memcpy(_savedScreenForOpenEntranceDoors, _displayMan->_g348_bitmapScreen, 320 * 200);
- _displayMan->_g578_useByteBoxCoordinates = false, _displayMan->f132_blitToBitmap(_displayMan->_g348_bitmapScreen, _g562_entranceDoorAnimSteps[8], doorsUpperHalfBox, 0, 30, k160_byteWidthScreen, k128_byteWidth, kM1_ColorNoTransparency, 200, 161);
- _displayMan->_g578_useByteBoxCoordinates = false, _displayMan->f132_blitToBitmap(_displayMan->_g348_bitmapScreen, _g562_entranceDoorAnimSteps[8], doorsLowerHalfBox, 0, 111, k160_byteWidthScreen, k128_byteWidth, kM1_ColorNoTransparency, 200, 161);
+ _displayMan->_g578_useByteBoxCoordinates = false, _displayMan->f132_blitToBitmap(_displayMan->_g348_bitmapScreen, _entranceDoorAnimSteps[8], doorsUpperHalfBox, 0, 30, k160_byteWidthScreen, k128_byteWidth, kM1_ColorNoTransparency, 200, 161);
+ _displayMan->_g578_useByteBoxCoordinates = false, _displayMan->f132_blitToBitmap(_displayMan->_g348_bitmapScreen, _entranceDoorAnimSteps[8], doorsLowerHalfBox, 0, 111, k160_byteWidthScreen, k128_byteWidth, kM1_ColorNoTransparency, 200, 161);
- _displayMan->f21_blitToScreen(_g562_entranceDoorAnimSteps[0], &closedDoorLeftBox, k64_byteWidth, kM1_ColorNoTransparency, 161);
- _displayMan->f21_blitToScreen(_g562_entranceDoorAnimSteps[4], &closedDoorRightBox, k64_byteWidth, kM1_ColorNoTransparency, 161);
+ _displayMan->f21_blitToScreen(_entranceDoorAnimSteps[0], &closedDoorLeftBox, k64_byteWidth, kM1_ColorNoTransparency, 161);
+ _displayMan->f21_blitToScreen(_entranceDoorAnimSteps[4], &closedDoorRightBox, k64_byteWidth, kM1_ColorNoTransparency, 161);
_displayMan->f436_STARTEND_FadeToPalette(palEntrance);
}
-void DMEngine::f438_STARTEND_OpenEntranceDoors() {
+void DMEngine::openEntranceDoors() {
Box rightDoorBox(109, 231, 30, 193);
byte *rightDoorBitmap = _displayMan->f489_getNativeBitmapOrGraphic(k3_entranceRightDoorGraphicIndice);
Box leftDoorBox(0, 100, 30, 193);
@@ -837,13 +837,13 @@ void DMEngine::f438_STARTEND_OpenEntranceDoors() {
leftDoorBlitFrom += 4;
rightDoorBox._x1 += 4;
- f22_delay(3);
+ delay(3);
}
delete[] _savedScreenForOpenEntranceDoors;
_savedScreenForOpenEntranceDoors = nullptr;
}
-void DMEngine::f437_STARTEND_drawTittle() {
+void DMEngine::drawTittle() {
static Box G0003_s_Graphic562_Box_Title_StrikesBack_Destination(0, 319, 118, 174);
static Box G0004_s_Graphic562_Box_Title_StrikesBack_Source(0, 319, 0, 56);
static Box G0005_s_Graphic562_Box_Title_Presents(0, 319, 90, 105);
@@ -906,32 +906,32 @@ void DMEngine::f437_STARTEND_drawTittle() {
L1392_aui_Palette[10] = D01_RGB_DARK_BLUE;
L1392_aui_Palette[12] = D01_RGB_DARK_BLUE;
_displayMan->f436_STARTEND_FadeToPalette(L1392_aui_Palette);
- f22_delay(1);
+ delay(1);
for (L1380_i_Counter = 0; L1380_i_Counter < 18; L1380_i_Counter++) {
- f22_delay(2);
+ delay(2);
Box box(L1391_aai_Coordinates[L1380_i_Counter]);
_displayMan->f132_blitToBitmap(L1387_apuc_Bitmap_ShrinkedTitle[L1380_i_Counter], _displayMan->_g348_bitmapScreen, box, 0, 0, L1391_aai_Coordinates[L1380_i_Counter][4], k160_byteWidthScreen, kM1_ColorNoTransparency, L1391_aai_Coordinates[L1380_i_Counter][3] - L1391_aai_Coordinates[L1380_i_Counter][2] + 1, k200_heightScreen);
}
- f22_delay(25L);
+ delay(25L);
_displayMan->f132_blitToBitmap(L1389_puc_Bitmap_Master_StrikesBack, _displayMan->_g348_bitmapScreen, G0003_s_Graphic562_Box_Title_StrikesBack_Destination, 0, 0, k160_byteWidthScreen, k160_byteWidthScreen, k0_ColorBlack, 57, k200_heightScreen);
L1392_aui_Palette[10] = D00_RGB_BLACK;
L1392_aui_Palette[12] = D07_RGB_RED;
_displayMan->f436_STARTEND_FadeToPalette(L1392_aui_Palette);
delete[] alloactedMem;
- f22_delay(75L);
+ delay(75L);
}
-void DMEngine::f442_SARTEND_processCommand202_entranceDrawCredits() {
+void DMEngine::entranceDrawCredits() {
_eventMan->f78_showMouse();
_displayMan->f436_STARTEND_FadeToPalette(_displayMan->_g345_aui_BlankBuffer);
_displayMan->f466_loadIntoBitmap(k5_creditsGraphicIndice, _displayMan->_g348_bitmapScreen);
_displayMan->f436_STARTEND_FadeToPalette(_displayMan->_palCredits);
- f22_delay(50);
+ delay(50);
_eventMan->f541_waitForMouseOrKeyActivity();
- _g298_newGame = k202_modeEntranceDrawCredits;
+ _newGameFl = k202_modeEntranceDrawCredits;
}
-void DMEngine::f446_STARTEND_fuseSequnce() {
+void DMEngine::fuseSequnce() {
int16 L1424_i_Multiple;
#define AL1424_B_RemoveFluxcagesFromLoadChaosSquare L1424_i_Multiple
#define AL1424_i_Attack L1424_i_Multiple
@@ -959,7 +959,7 @@ void DMEngine::f446_STARTEND_fuseSequnce() {
char L1436_ac_String[200];
- _g302_gameWon = true;
+ _gameWon = true;
if (_inventoryMan->_g432_inventoryChampionOrdinal) {
_inventoryMan->f355_toggleInventory(k4_ChampionCloseInventory);
}
@@ -968,7 +968,7 @@ void DMEngine::f446_STARTEND_fuseSequnce() {
_inventoryMan->f337_setDungeonViewPalette();
_championMan->_party._fireShieldDefense = _championMan->_party._spellShieldDefense = _championMan->_party._shieldDefense = 100;
_timeline->f260_timelineRefreshAllChampionStatusBoxes();
- f445_STARTEND_fuseSequenceUpdate();
+ fuseSequenceUpdate();
L1431_i_LordChaosMapX = _dungeonMan->_g306_partyMapX;
L1432_i_LordChaosMapY = _dungeonMan->_g307_partyMapY;
L1431_i_LordChaosMapX += _dirIntoStepCountEast[_dungeonMan->_g308_partyDir], L1432_i_LordChaosMapY += _dirIntoStepCountNorth[_dungeonMan->_g308_partyDir];
@@ -1000,32 +1000,32 @@ T0446002:
goto T0446002;
}
- f445_STARTEND_fuseSequenceUpdate();
+ fuseSequenceUpdate();
for (AL1424_i_Attack = 55; AL1424_i_Attack <= 255; AL1424_i_Attack += 40) {
_projexpl->f213_explosionCreate(Thing::_explFireBall, AL1424_i_Attack, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k255_CreatureTypeSingleCenteredCreature);
- f445_STARTEND_fuseSequenceUpdate();
+ fuseSequenceUpdate();
}
_sound->f064_SOUND_RequestPlay_CPSD(k17_soundBUZZ, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k1_soundModePlayIfPrioritized);
L1428_ps_Group->_type = k25_CreatureTypeLordOrder;
- f445_STARTEND_fuseSequenceUpdate();
+ fuseSequenceUpdate();
for (AL1424_i_Attack = 55; AL1424_i_Attack <= 255; AL1424_i_Attack += 40) {
_projexpl->f213_explosionCreate(Thing::_explHarmNonMaterial, AL1424_i_Attack, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k255_CreatureTypeSingleCenteredCreature);
- f445_STARTEND_fuseSequenceUpdate();
+ fuseSequenceUpdate();
}
for (AL1425_i_CycleCount = 4; --AL1425_i_CycleCount; ) {
for (AL1424_i_CreatureTypeSwitchCount = 5; --AL1424_i_CreatureTypeSwitchCount; ) {
_sound->f064_SOUND_RequestPlay_CPSD(k17_soundBUZZ, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k1_soundModePlayIfPrioritized);
L1428_ps_Group->_type = (AL1424_i_CreatureTypeSwitchCount & 0x0001) ? k25_CreatureTypeLordOrder : k23_CreatureTypeLordChaos;
- for (AL1426_i_FuseSequenceUpdateCount = AL1425_i_CycleCount; AL1426_i_FuseSequenceUpdateCount--; f445_STARTEND_fuseSequenceUpdate());
+ for (AL1426_i_FuseSequenceUpdateCount = AL1425_i_CycleCount; AL1426_i_FuseSequenceUpdateCount--; fuseSequenceUpdate());
}
}
_projexpl->f213_explosionCreate(Thing::_explFireBall, 255, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k255_CreatureTypeSingleCenteredCreature);
_projexpl->f213_explosionCreate(Thing::_explHarmNonMaterial, 255, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k255_CreatureTypeSingleCenteredCreature);
- f445_STARTEND_fuseSequenceUpdate();
+ fuseSequenceUpdate();
L1428_ps_Group->_type = k26_CreatureTypeGreyLord;
- f445_STARTEND_fuseSequenceUpdate();
+ fuseSequenceUpdate();
_displayMan->_g77_doNotDrawFluxcagesDuringEndgame = true;
- f445_STARTEND_fuseSequenceUpdate();
+ fuseSequenceUpdate();
for (AL1424_i_MapX = 0; AL1424_i_MapX < _dungeonMan->_g273_currMapWidth; AL1424_i_MapX++) {
for (AL1425_i_MapY = 0; AL1425_i_MapY < _dungeonMan->_g274_currMapHeight; AL1425_i_MapY++) {
if (((L1427_T_Thing = _groupMan->f175_groupGetThing(AL1424_i_MapX, AL1425_i_MapY)) != Thing::_endOfList) && ((AL1424_i_MapX != L1431_i_LordChaosMapX) || (AL1425_i_MapY != L1432_i_LordChaosMapY))) {
@@ -1033,7 +1033,7 @@ T0446002:
}
}
}
- f445_STARTEND_fuseSequenceUpdate();
+ fuseSequenceUpdate();
/* Count and get list of text things located at 0, 0 in the current map. Their text is then printed as messages in the order specified by their first letter (which is not printed) */
L1427_T_Thing = _dungeonMan->f161_getSquareFirstThing(0, 0);
AL1424_i_TextStringThingCount = 0;
@@ -1052,8 +1052,8 @@ T0446002:
_textMan->f43_messageAreaClearAllRows();
L1436_ac_String[1] = '\n'; /* New line */
_textMan->f47_messageAreaPrintMessage(k15_ColorWhite, &L1436_ac_String[1]);
- f445_STARTEND_fuseSequenceUpdate();
- f22_delay(780);
+ fuseSequenceUpdate();
+ delay(780);
L1434_c_TextFirstCharacter++;
break;
}
@@ -1062,22 +1062,22 @@ T0446002:
for (AL1424_i_Attack = 55; AL1424_i_Attack <= 255; AL1424_i_Attack += 40) {
_projexpl->f213_explosionCreate(Thing::_explHarmNonMaterial, AL1424_i_Attack, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k255_CreatureTypeSingleCenteredCreature);
- f445_STARTEND_fuseSequenceUpdate();
+ fuseSequenceUpdate();
}
- f22_delay(600);
- _g524_restartGameAllowed = false;
- f444_endGame(true);
+ delay(600);
+ _restartGameAllowed = false;
+ endGame(true);
}
-void DMEngine::f445_STARTEND_fuseSequenceUpdate() {
+void DMEngine::fuseSequenceUpdate() {
_timeline->f261_processTimeline();
_displayMan->f128_drawDungeon(_dungeonMan->_g308_partyDir, _dungeonMan->_g306_partyMapX, _dungeonMan->_g307_partyMapY);
_sound->f65_playPendingSound();
_eventMan->f357_discardAllInput();
_displayMan->updateScreen();
- f22_delay(2);
- _g313_gameTime++; /* BUG0_71 Some timings are too short on fast computers.
+ delay(2);
+ _gameTime++; /* BUG0_71 Some timings are too short on fast computers.
The ending animation when Lord Chaos is fused plays too quickly because the execution speed is not limited */
}
diff --git a/engines/dm/dm.h b/engines/dm/dm.h
index e115c8f803..cc8b93a095 100644
--- a/engines/dm/dm.h
+++ b/engines/dm/dm.h
@@ -109,9 +109,8 @@ enum Direction {
kDirSouth = 2,
kDirWest = 3
};
-const char *debugGetDirectionName(Direction dir);
-
+const char *debugGetDirectionName(Direction dir);
enum ThingType {
kM1_PartyThingType = -1, // @ CM1_THING_TYPE_PARTY
@@ -173,8 +172,6 @@ public:
bool operator!=(const Thing &rhs) const { return _data != rhs._data; }
}; // @ THING
-
-
void turnDirRight(Direction &dir);
void turnDirLeft(Direction &dir);
Direction returnOppositeDir(Direction dir); // @ M18_OPPOSITE
@@ -182,20 +179,18 @@ uint16 returnPrevVal(uint16 val); // @ M19_PREVIOUS
uint16 returnNextVal(uint16 val); // @ M17_NEXT
bool isOrientedWestEast(Direction dir); // @ M16_IS_ORIENTED_WEST_EAST
-
#define setFlag(val, mask) ((val) |= (mask))
#define getFlag(val, mask) ((val) & (mask))
#define clearFlag(val, mask) ((val) &= (~(mask))) // @ M09_CLEAR
uint16 toggleFlag(uint16 &val, uint16 mask); // @ M10_TOGGLE
-uint16 M75_bitmapByteCount(uint16 pixelWidth, uint16 height); // @ M75_BITMAP_BYTE_COUNT
-uint16 M21_normalizeModulo4(uint16 val); // @ M21_NORMALIZE
-int32 M30_time(int32 map_time); // @ M30_TIME
-int32 M33_setMapAndTime(int32 &map_time, uint32 map, uint32 time); // @ M33_SET_MAP_AND_TIME
-uint16 M29_map(int32 map_time); // @ M29_MAP
-Thing M15_thingWithNewCell(Thing thing, int16 cell); // @ M15_THING_WITH_NEW_CELL
-int16 M38_distance(int16 mapx1, int16 mapy1, int16 mapx2, int16 mapy2);// @ M38_DISTANCE
-
+uint16 bitmapByteCount(uint16 pixelWidth, uint16 height); // @ M75_BITMAP_BYTE_COUNT
+uint16 normalizeModulo4(uint16 val); // @ M21_NORMALIZE
+int32 filterTime(int32 map_time); // @ M30_TIME
+int32 setMapAndTime(int32 &map_time, uint32 map, uint32 time); // @ M33_SET_MAP_AND_TIME
+uint16 getMap(int32 map_time); // @ M29_MAP
+Thing thingWithNewCell(Thing thing, int16 cell); // @ M15_THING_WITH_NEW_CELL
+int16 getDistance(int16 mapx1, int16 mapy1, int16 mapx2, int16 mapy2);// @ M38_DISTANCE
enum Cell {
kM1_CellAny = -1, // @ CM1_CELL_ANY
@@ -208,11 +203,9 @@ enum Cell {
#define kM1_mapIndexNone -1 // @ CM1_MAP_INDEX_NONE
#define k255_mapIndexEntrance 255 // @ C255_MAP_INDEX_ENTRANCE
-
-
//TODO: Directly use CLIP
template<typename T>
-inline T f26_getBoundedValue(T min, T val, T max) {
+inline T getBoundedValue(T min, T val, T max) {
return CLIP<T>(min, val, max);
} // @ F0026_MAIN_GetBoundedValue
@@ -228,24 +221,22 @@ enum LoadgameResponse {
k1_LoadgameSuccess = 1// @ C01_LOAD_GAME_SUCCESS
};
-
struct SaveGameHeader {
byte _version;
SaveStateDescriptor _descr;
};
-
class DMEngine : public Engine {
- 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 f2_gameloop(); // @ F0002_MAIN_GameLoop_CPSDF
- void initArrays();
+ void startGame(); // @ F0462_START_StartGame_CPSF
+ void processNewPartyMap(uint16 mapIndex); // @ F0003_MAIN_ProcessNewPartyMap_CPSE
+ void initializeGame(); // @ F0463_START_InitializeGame_CPSADEF
+ void initMemoryManager(); // @ F0448_STARTUP1_InitializeMemoryManager_CPSADEF
+ void gameloop(); // @ F0002_MAIN_GameLoop_CPSDF
+ void initConstants();
Common::String getSavefileName(uint16 slot);
void writeSaveGameHeader(Common::OutSaveFile *out, const Common::String &saveName);
bool writeCompleteSaveFile(int16 slot, Common::String &desc, int16 saveAndPlayChoice);
- void f439_drawEntrance(); // @ F0439_STARTEND_DrawEntrance
+ void drawEntrance(); // @ F0439_STARTEND_DrawEntrance
public:
explicit DMEngine(OSystem *syst, const DMADGameDescription *gameDesc);
~DMEngine();
@@ -256,29 +247,29 @@ public:
GUI::Debugger *getDebugger() { return _console; }
- void f22_delay(uint16 verticalBlank); // @ F0022_MAIN_Delay
- uint16 f30_getScaledProduct(uint16 val, uint16 scale, uint16 vale2); // @ F0030_MAIN_GetScaledProduct
+ void delay(uint16 verticalBlank); // @ F0022_MAIN_Delay
+ uint16 getScaledProduct(uint16 val, uint16 scale, uint16 vale2); // @ F0030_MAIN_GetScaledProduct
uint16 getRandomNumber(uint32 max) { return _rnd->getRandomNumber(max - 1); }
- int16 M1_ordinalToIndex(int16 val); // @ M01_ORDINAL_TO_INDEX
- int16 M0_indexToOrdinal(int16 val); // @ M00_INDEX_TO_ORDINAL
- void f19_displayErrorAndStop(int16 errorIndex); // @ F0019_MAIN_DisplayErrorAndStop
+ int16 ordinalToIndex(int16 val); // @ M01_ORDINAL_TO_INDEX
+ int16 indexToOrdinal(int16 val); // @ M00_INDEX_TO_ORDINAL
+ void displayErrorAndStop(int16 errorIndex); // @ F0019_MAIN_DisplayErrorAndStop
virtual Common::Error run(); // @ main
- void f433_processCommand140_saveGame(); // @ F0433_STARTEND_ProcessCommand140_SaveGame_CPSCDF
- LoadgameResponse f435_loadgame(int16 slot); // @ F0435_STARTEND_LoadGame_CPSF
- void f441_processEntrance(); // @ F0441_STARTEND_ProcessEntrance
- void f444_endGame(bool doNotDrawCreditsOnly); // @ F0444_STARTEND_Endgame
-
- void f438_STARTEND_OpenEntranceDoors(); // @ F0438_STARTEND_OpenEntranceDoors
- void f437_STARTEND_drawTittle(); // @ F0437_STARTEND_DrawTitle
- void f442_SARTEND_processCommand202_entranceDrawCredits();
- void f446_STARTEND_fuseSequnce(); // @ F0446_STARTEND_FuseSequence
- void f445_STARTEND_fuseSequenceUpdate(); // @ F0445_STARTEND_FuseSequenceUpdate
+ void saveGame(); // @ F0433_STARTEND_ProcessCommand140_SaveGame_CPSCDF
+ LoadgameResponse loadgame(int16 slot); // @ F0435_STARTEND_LoadGame_CPSF
+ void processEntrance(); // @ F0441_STARTEND_ProcessEntrance
+ void endGame(bool doNotDrawCreditsOnly); // @ F0444_STARTEND_Endgame
+
+ void openEntranceDoors(); // @ F0438_STARTEND_OpenEntranceDoors
+ void drawTittle(); // @ F0437_STARTEND_DrawTitle
+ void entranceDrawCredits();
+ void fuseSequnce(); // @ F0446_STARTEND_FuseSequence
+ void fuseSequenceUpdate(); // @ F0445_STARTEND_FuseSequenceUpdate
Common::Language getGameLanguage();
private:
- uint16 _g526_dungeonId; // @ G0526_ui_DungeonID
- byte *_g562_entranceDoorAnimSteps[10]; // @ G0562_apuc_Bitmap_EntranceDoorAnimationSteps
- byte *_g564_interfaceCredits; // @ G0564_puc_Graphic5_InterfaceCredits
+ uint16 _dungeonId; // @ G0526_ui_DungeonID
+ byte *_entranceDoorAnimSteps[10]; // @ G0562_apuc_Bitmap_EntranceDoorAnimationSteps
+ byte *_interfaceCredits; // @ G0564_puc_Graphic5_InterfaceCredits
Common::RandomSource *_rnd;
byte *_savedScreenForOpenEntranceDoors; // ad-hoc HACK
@@ -306,30 +297,30 @@ public:
bool _engineShouldQuit;
int _loadSaveSlotAtRuntime;
- int16 _g298_newGame; // @ G0298_B_NewGame
- bool _g523_restartGameRequest; // @ G0523_B_RestartGameRequested
-
- bool _g321_stopWaitingForPlayerInput; // @ G0321_B_StopWaitingForPlayerInput
- bool _g301_gameTimeTicking; // @ G0301_B_GameTimeTicking
- bool _g524_restartGameAllowed; // @ G0524_B_RestartGameAllowed
- int32 _g525_gameId; // @ G0525_l_GameID, probably useless here
- bool _g331_pressingEye; // @ G0331_B_PressingEye
- bool _g332_stopPressingEye; // @ G0332_B_StopPressingEye
- bool _g333_pressingMouth; // @ G0333_B_PressingMouth
- bool _g334_stopPressingMouth; // @ G0334_B_StopPressingMouth
- bool _g340_highlightBoxInversionRequested; // @ G0340_B_HighlightBoxInversionRequested
- int16 _g311_projectileDisableMovementTicks; // @ G0311_i_ProjectileDisabledMovementTicks
- int16 _g312_lastProjectileDisabledMovementDirection; // @ G0312_i_LastProjectileDisabledMovementDirection
- bool _g302_gameWon; // @ G0302_B_GameWon
- int16 _g327_newPartyMapIndex; // @ G0327_i_NewPartyMapIndex
- bool _g325_setMousePointerToObjectInMainLoop; // @ G0325_B_SetMousePointerToObjectInMainLoop
- int16 _g310_disabledMovementTicks; // @ G0310_i_DisabledMovementTicks
+ int16 _newGameFl; // @ G0298_B_NewGame
+ bool _restartGameRequest; // @ G0523_B_RestartGameRequested
+
+ bool _stopWaitingForPlayerInput; // @ G0321_B_StopWaitingForPlayerInput
+ bool _gameTimeTicking; // @ G0301_B_GameTimeTicking
+ bool _restartGameAllowed; // @ G0524_B_RestartGameAllowed
+ int32 _gameId; // @ G0525_l_GameID, probably useless here
+ bool _pressingEye; // @ G0331_B_PressingEye
+ bool _stopPressingEye; // @ G0332_B_StopPressingEye
+ bool _pressingMouth; // @ G0333_B_PressingMouth
+ bool _stopPressingMouth; // @ G0334_B_StopPressingMouth
+ bool _highlightBoxInversionRequested; // @ G0340_B_HighlightBoxInversionRequested
+ int16 _projectileDisableMovementTicks; // @ G0311_i_ProjectileDisabledMovementTicks
+ int16 _lastProjectileDisabledMovementDirection; // @ G0312_i_LastProjectileDisabledMovementDirection
+ bool _gameWon; // @ G0302_B_GameWon
+ int16 _newPartyMapIndex; // @ G0327_i_NewPartyMapIndex
+ bool _setMousePointerToObjectInMainLoop; // @ G0325_B_SetMousePointerToObjectInMainLoop
+ int16 _disabledMovementTicks; // @ G0310_i_DisabledMovementTicks
int8 _dirIntoStepCountEast[4]; // @ G0233_ai_Graphic559_DirectionToStepEastCount
int8 _dirIntoStepCountNorth[4]; // @ G0234_ai_Graphic559_DirectionToStepNorthCount
- int32 _g313_gameTime; // @ G0313_ul_GameTime
- char _g353_stringBuildBuffer[128]; // @ G0353_ac_StringBuildBuffer
- int16 _g318_waitForInputMaxVerticalBlankCount; // @ G0318_i_WaitForInputMaximumVerticalBlankCount
+ int32 _gameTime; // @ G0313_ul_GameTime
+ char _stringBuildBuffer[128]; // @ G0353_ac_StringBuildBuffer
+ int16 _waitForInputMaxVerticalBlankCount; // @ G0318_i_WaitForInputMaximumVerticalBlankCount
};
bool readSaveGameHeader(Common::InSaveFile* in, SaveGameHeader* header);
diff --git a/engines/dm/dmglobals.cpp b/engines/dm/dmglobals.cpp
index 6457c8510d..b55c4052ba 100644
--- a/engines/dm/dmglobals.cpp
+++ b/engines/dm/dmglobals.cpp
@@ -42,7 +42,7 @@
namespace DM {
-void DMEngine::initArrays() {
+void DMEngine::initConstants() {
// G0233_ai_Graphic559_DirectionToStepEastCount
_dirIntoStepCountEast[0] = 0; // North
_dirIntoStepCountEast[1] = 1; // East
@@ -56,7 +56,7 @@ void DMEngine::initArrays() {
_dirIntoStepCountNorth[3] = 0; // South
}
-void DMEngine::f19_displayErrorAndStop(int16 errorIndex) {
+void DMEngine::displayErrorAndStop(int16 errorIndex) {
debug("Stuff hit the fun: %d", errorIndex);
Common::Event event;
while (_system->getEventManager()->pollEvent(event) || true)
diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp
index f9d649a858..ef4aa6adc5 100644
--- a/engines/dm/dungeonman.cpp
+++ b/engines/dm/dungeonman.cpp
@@ -557,7 +557,7 @@ void DungeonMan::f434_loadDungeonFile(Common::InSaveFile *file) {
50 /* Explosion */
};
- if (_vm->_g298_newGame)
+ if (_vm->_newGameFl)
f455_decompressDungeonFile();
Common::ReadStream *dunDataStream = nullptr;
@@ -582,7 +582,7 @@ void DungeonMan::f434_loadDungeonFile(Common::InSaveFile *file) {
_g278_dungeonFileHeader._thingCounts[i] = dunDataStream->readUint16BE();
// init party position and mapindex
- if (_vm->_g298_newGame) {
+ if (_vm->_newGameFl) {
uint16 startLoc = _g278_dungeonFileHeader._partyStartLocation;
_g308_partyDir = (Direction)((startLoc >> 10) & 3);
_g306_partyMapX = startLoc & 0x1F;
@@ -591,7 +591,7 @@ void DungeonMan::f434_loadDungeonFile(Common::InSaveFile *file) {
}
// load map data
- if (!_vm->_g523_restartGameRequest) {
+ if (!_vm->_restartGameRequest) {
delete[] _g277_dungeonMaps;
_g277_dungeonMaps = new Map[_g278_dungeonFileHeader._mapCount];
}
@@ -626,7 +626,7 @@ void DungeonMan::f434_loadDungeonFile(Common::InSaveFile *file) {
}
// load column stuff thingy
- if (!_vm->_g523_restartGameRequest) {
+ if (!_vm->_restartGameRequest) {
delete[] _g281_dungeonMapsFirstColumnIndex;
_g281_dungeonMapsFirstColumnIndex = new uint16[_g278_dungeonFileHeader._mapCount];
}
@@ -638,10 +638,10 @@ void DungeonMan::f434_loadDungeonFile(Common::InSaveFile *file) {
_g282_dungeonColumCount = columCount;
uint32 actualSquareFirstThingCount = _g278_dungeonFileHeader._squareFirstThingCount;
- if (_vm->_g298_newGame)
+ if (_vm->_newGameFl)
_g278_dungeonFileHeader._squareFirstThingCount += 300;
- if (!_vm->_g523_restartGameRequest) {
+ if (!_vm->_restartGameRequest) {
delete[] _g280_dungeonColumnsCumulativeSquareThingCount;
_g280_dungeonColumnsCumulativeSquareThingCount = new uint16[columCount];
}
@@ -649,7 +649,7 @@ void DungeonMan::f434_loadDungeonFile(Common::InSaveFile *file) {
_g280_dungeonColumnsCumulativeSquareThingCount[i] = dunDataStream->readUint16BE();
// load square first things
- if (!_vm->_g523_restartGameRequest) {
+ if (!_vm->_restartGameRequest) {
delete[] _g283_squareFirstThings;
_g283_squareFirstThings = new Thing[_g278_dungeonFileHeader._squareFirstThingCount];
}
@@ -657,13 +657,13 @@ void DungeonMan::f434_loadDungeonFile(Common::InSaveFile *file) {
for (uint16 i = 0; i < actualSquareFirstThingCount; ++i)
_g283_squareFirstThings[i].set(dunDataStream->readUint16BE());
- if (_vm->_g298_newGame) {
+ if (_vm->_newGameFl) {
for (uint16 i = 0; i < 300; ++i)
_g283_squareFirstThings[actualSquareFirstThingCount + i] = Thing::_none;
}
// load text data
- if (!_vm->_g523_restartGameRequest) {
+ if (!_vm->_restartGameRequest) {
delete[] _g260_dungeonTextData;
_g260_dungeonTextData = new uint16[_g278_dungeonFileHeader._textDataWordCount];
}
@@ -671,13 +671,13 @@ void DungeonMan::f434_loadDungeonFile(Common::InSaveFile *file) {
for (uint16 i = 0; i < _g278_dungeonFileHeader._textDataWordCount; ++i)
_g260_dungeonTextData[i] = dunDataStream->readUint16BE();
- if (_vm->_g298_newGame)
+ if (_vm->_newGameFl)
_vm->_timeline->_g369_eventMaxCount = 100;
// load things
for (uint16 thingType = k0_DoorThingType; thingType < k16_ThingTypeTotal; ++thingType) {
uint16 thingCount = _g278_dungeonFileHeader._thingCounts[thingType];
- if (_vm->_g298_newGame)
+ if (_vm->_newGameFl)
_g278_dungeonFileHeader._thingCounts[thingType] = MIN((thingType == k15_ExplosionThingType) ? 768 : 1024, thingCount + additionalThingCounts[thingType]);
uint16 thingStoreWordCount = g235_ThingDataWordCount[thingType];
@@ -685,7 +685,7 @@ void DungeonMan::f434_loadDungeonFile(Common::InSaveFile *file) {
if (thingStoreWordCount == 0)
continue;
- if (!_vm->_g523_restartGameRequest) {
+ if (!_vm->_restartGameRequest) {
delete[] _g284_thingData[thingType];
_g284_thingData[thingType] = new uint16[_g278_dungeonFileHeader._thingCounts[thingType] * thingStoreWordCount];
}
@@ -708,7 +708,7 @@ void DungeonMan::f434_loadDungeonFile(Common::InSaveFile *file) {
}
}
- if (_vm->_g298_newGame) {
+ if (_vm->_newGameFl) {
if ((thingType == k4_GroupThingType) || thingType >= k14_ProjectileThingType)
_vm->_timeline->_g369_eventMaxCount += _g278_dungeonFileHeader._thingCounts[thingType];
@@ -718,7 +718,7 @@ void DungeonMan::f434_loadDungeonFile(Common::InSaveFile *file) {
}
// load map data
- if (!_vm->_g523_restartGameRequest) {
+ if (!_vm->_restartGameRequest) {
delete[] _g276_dungeonRawMapData;
_g276_dungeonRawMapData = new byte[_g278_dungeonFileHeader._rawMapDataSize];
}
@@ -726,7 +726,7 @@ void DungeonMan::f434_loadDungeonFile(Common::InSaveFile *file) {
for (uint32 i = 0; i < _g278_dungeonFileHeader._rawMapDataSize; ++i)
_g276_dungeonRawMapData[i] = dunDataStream->readByte();
- if (!_vm->_g523_restartGameRequest) {
+ if (!_vm->_restartGameRequest) {
uint8 mapCount = _g278_dungeonFileHeader._mapCount;
delete[] _g279_dungeonMapData;
_g279_dungeonMapData = new byte**[_g282_dungeonColumCount + mapCount];
@@ -890,7 +890,7 @@ T0172010_ClosedFakeWall:
f171_setSquareAspectOrnOrdinals(aspectArray, leftRandomWallOrnamentAllowed, frontRandomWallOrnamentAllowed, rightRandomWallOrnamentAllowed, dir, mapX, mapY, squareIsFakeWall);
while ((curThing != Thing::_endOfList) && (curThing.getType() <= k3_SensorThingType)) {
ThingType curThingType = curThing.getType();
- int16 AL0310_i_SideIndex = M21_normalizeModulo4(curThing.getCell() - dir);
+ int16 AL0310_i_SideIndex = normalizeModulo4(curThing.getCell() - dir);
if (AL0310_i_SideIndex) { /* Invisible on the back wall if 0 */
Sensor *curSensor = (Sensor*)f156_getThingData(curThing);
if (curThingType == k2_TextstringType) {
@@ -901,7 +901,7 @@ T0172010_ClosedFakeWall:
} else {
aspectArray[AL0310_i_SideIndex + 1] = curSensor->getOrnOrdinal();
if (curSensor->getType() == k127_SensorWallChampionPortrait) {
- _vm->_displayMan->_g289_championPortraitOrdinal = _vm->M0_indexToOrdinal(curSensor->getData());
+ _vm->_displayMan->_g289_championPortraitOrdinal = _vm->indexToOrdinal(curSensor->getData());
}
}
}
@@ -984,12 +984,12 @@ void DungeonMan::f171_setSquareAspectOrnOrdinals(uint16 *aspectArray, bool leftA
int16 mapX, int16 mapY, bool isFakeWall) {
int16 randomWallOrnamentCount = _g269_currMap->_randWallOrnCount;
- aspectArray[k2_RightWallOrnOrdAspect] = f170_getRandomOrnOrdinal(leftAllowed, randomWallOrnamentCount, mapX, ++mapY * (M21_normalizeModulo4(++dir) + 1), 30);
- aspectArray[k3_FrontWallOrnOrdAspect] = f170_getRandomOrnOrdinal(frontAllowed, randomWallOrnamentCount, mapX, mapY * (M21_normalizeModulo4(++dir) + 1), 30);
- aspectArray[k4_LeftWallOrnOrdAspect] = f170_getRandomOrnOrdinal(rightAllowed, randomWallOrnamentCount, mapX, mapY-- * (M21_normalizeModulo4(++dir) + 1), 30);
+ aspectArray[k2_RightWallOrnOrdAspect] = f170_getRandomOrnOrdinal(leftAllowed, randomWallOrnamentCount, mapX, ++mapY * (normalizeModulo4(++dir) + 1), 30);
+ aspectArray[k3_FrontWallOrnOrdAspect] = f170_getRandomOrnOrdinal(frontAllowed, randomWallOrnamentCount, mapX, mapY * (normalizeModulo4(++dir) + 1), 30);
+ aspectArray[k4_LeftWallOrnOrdAspect] = f170_getRandomOrnOrdinal(rightAllowed, randomWallOrnamentCount, mapX, mapY-- * (normalizeModulo4(++dir) + 1), 30);
if (isFakeWall || (mapX < 0) || (mapX >= _g273_currMapWidth) || (mapY < 0) || (mapY >= _g274_currMapHeight)) { /* If square is a fake wall or is out of map bounds */
for (int16 sideIndex = k2_RightWallOrnOrdAspect; sideIndex <= k4_LeftWallOrnOrdAspect; sideIndex++) { /* Loop to remove any random ornament that is an alcove */
- if (f149_isWallOrnAnAlcove(_vm->M1_ordinalToIndex(aspectArray[sideIndex])))
+ if (f149_isWallOrnAnAlcove(_vm->ordinalToIndex(aspectArray[sideIndex])))
aspectArray[sideIndex] = 0;
}
}
@@ -999,7 +999,7 @@ int16 DungeonMan::f170_getRandomOrnOrdinal(bool allowed, int16 count, int16 mapX
int16 randomOrnamentIndex = f169_getRandomOrnamentIndex((int16)2000 + (mapX << 5) + mapY, (int16)3000 + (_g272_currMapIndex << (int16)6) + _g273_currMapWidth + _g274_currMapHeight, modulo);
if (allowed && (randomOrnamentIndex < count))
- return _vm->M0_indexToOrdinal(randomOrnamentIndex);
+ return _vm->indexToOrdinal(randomOrnamentIndex);
return 0;
}
@@ -1349,15 +1349,15 @@ int16 DungeonMan::f142_getProjectileAspect(Thing thing) {
ThingType thingType = thing.getType();
if (thingType == k15_ExplosionThingType) {
if (thing == Thing::_explFireBall)
- return -_vm->M0_indexToOrdinal(k10_ProjectileAspectExplosionFireBall);
+ return -_vm->indexToOrdinal(k10_ProjectileAspectExplosionFireBall);
if (thing == Thing::_explSlime)
- return -_vm->M0_indexToOrdinal(k12_ProjectileAspectExplosionSlime);
+ return -_vm->indexToOrdinal(k12_ProjectileAspectExplosionSlime);
if (thing == Thing::_explLightningBolt)
- return -_vm->M0_indexToOrdinal(k3_ProjectileAspectExplosionLightningBolt);
+ return -_vm->indexToOrdinal(k3_ProjectileAspectExplosionLightningBolt);
if ((thing == Thing::_explPoisonBolt) || (thing == Thing::_explPoisonCloud))
- return -_vm->M0_indexToOrdinal(k13_ProjectileAspectExplosionPoisonBoltCloud);
+ return -_vm->indexToOrdinal(k13_ProjectileAspectExplosionPoisonBoltCloud);
- return -_vm->M0_indexToOrdinal(k11_ProjectileAspectExplosionDefault);
+ return -_vm->indexToOrdinal(k11_ProjectileAspectExplosionDefault);
} else if (thingType == k5_WeaponThingType) {
WeaponInfo *weaponInfo = f158_getWeaponInfo(thing);
int16 projAspOrd = weaponInfo->getProjectileAspectOrdinal();
@@ -1402,7 +1402,7 @@ Thing DungeonMan::f162_getSquareFirstObject(int16 mapX, int16 mapY) {
uint16 DungeonMan::f143_getArmourDefense(ArmourInfo* armourInfo, bool useSharpDefense) {
uint16 defense = armourInfo->_defense;
if (useSharpDefense)
- defense = _vm->f30_getScaledProduct(defense, 3, getFlag(armourInfo->_attributes, k0x0007_ArmourAttributeSharpDefense) + 4);
+ defense = _vm->getScaledProduct(defense, 3, getFlag(armourInfo->_attributes, k0x0007_ArmourAttributeSharpDefense) + 4);
return defense;
}
@@ -1524,7 +1524,7 @@ void DungeonMan::f148_setGroupDirections(Group* group, int16 dir, uint16 mapInde
if (mapIndex == _g309_partyMapIndex)
_vm->_groupMan->_g375_activeGroups[group->getActiveGroupIndex()]._directions = (Direction)dir;
else
- group->setDir(M21_normalizeModulo4(dir));
+ group->setDir(normalizeModulo4(dir));
}
bool DungeonMan::f139_isCreatureAllowedOnMap(Thing thing, uint16 mapIndex) {
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp
index c152876909..dbf8c1b298 100644
--- a/engines/dm/eventman.cpp
+++ b/engines/dm/eventman.cpp
@@ -468,8 +468,8 @@ void EventManager::f68_setPointerToObject(byte* bitmap) {
void EventManager::f71_mouseDropChampionIcon() {
_gK100_preventBuildPointerScreenArea = true;
- uint16 championIconIndex = _vm->M1_ordinalToIndex(_g599_useChampionIconOrdinalAsMousePointerBitmap);
- _g599_useChampionIconOrdinalAsMousePointerBitmap = _vm->M0_indexToOrdinal(kM1_ChampionNone);
+ uint16 championIconIndex = _vm->ordinalToIndex(_g599_useChampionIconOrdinalAsMousePointerBitmap);
+ _g599_useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(kM1_ChampionNone);
_g598_mousePointerBitmapUpdated = true;
bool useByteBoxCoordinatesBackup = _vm->_displayMan->_g578_useByteBoxCoordinates;
_vm->_displayMan->f21_blitToScreen(_g613_mousePointerOriginalColorsChampionIcon, &_vm->_championMan->_boxChampionIcons[championIconIndex << 2], 16, k12_ColorDarkestGray, 18);
@@ -728,7 +728,7 @@ void EventManager::f380_processCommandQueue() {
Command cmd = _commandQueue.pop();
CommandType cmdType = cmd._type;
- if ((cmdType >= k3_CommandMoveForward) && (cmdType <= k6_CommandMoveLeft) && (_vm->_g310_disabledMovementTicks || (_vm->_g311_projectileDisableMovementTicks && (_vm->_g312_lastProjectileDisabledMovementDirection == (M21_normalizeModulo4(_vm->_dungeonMan->_g308_partyDir + cmdType - k3_CommandMoveForward)))))) { /* If movement is disabled */
+ if ((cmdType >= k3_CommandMoveForward) && (cmdType <= k6_CommandMoveLeft) && (_vm->_disabledMovementTicks || (_vm->_projectileDisableMovementTicks && (_vm->_lastProjectileDisabledMovementDirection == (normalizeModulo4(_vm->_dungeonMan->_g308_partyDir + cmdType - k3_CommandMoveForward)))))) { /* If movement is disabled */
_g435_isCommandQueueLocked = false;
f360_processPendingClick();
return;
@@ -825,7 +825,7 @@ void EventManager::f380_processCommandQueue() {
return;
}
- if (_vm->_g331_pressingEye || _vm->_g333_pressingMouth)
+ if (_vm->_pressingEye || _vm->_pressingMouth)
return;
if (cmdType == k145_CommandSleep) {
@@ -837,7 +837,7 @@ void EventManager::f380_processCommandQueue() {
_vm->_championMan->_partyIsSleeping = true;
f379_drawSleepScreen();
_vm->_displayMan->f97_drawViewport(k2_viewportAsBeforeSleepOrFreezeGame);
- _vm->_g318_waitForInputMaxVerticalBlankCount = 0;
+ _vm->_waitForInputMaxVerticalBlankCount = 0;
_g441_primaryMouseInput = _primaryMouseInputPartySleeping;
_g442_secondaryMouseInput = 0;
_g443_primaryKeyboardInput = _primaryKeyboardInputPartySleeping;
@@ -854,13 +854,13 @@ void EventManager::f380_processCommandQueue() {
if (cmdType == k140_CommandSaveGame) {
if ((_vm->_championMan->_partyChampionCount > 0) && !_vm->_championMan->_candidateChampionOrdinal)
- _vm->f433_processCommand140_saveGame();
+ _vm->saveGame();
return;
}
if (cmdType == k147_CommandFreezeGame) {
- _vm->_g301_gameTimeTicking = false;
+ _vm->_gameTimeTicking = false;
_vm->_menuMan->f456_drawDisabledMenu();
_vm->_displayMan->f134_fillBitmap(_vm->_displayMan->_g296_bitmapViewport, k0_ColorBlack, 112, 136);
@@ -893,7 +893,7 @@ void EventManager::f380_processCommandQueue() {
}
if (cmdType == k148_CommandUnfreezeGame) {
- _vm->_g301_gameTimeTicking = true;
+ _vm->_gameTimeTicking = true;
_vm->_menuMan->f457_drawEnabledMenus();
_g441_primaryMouseInput = primaryMouseInputBackup;
_g442_secondaryMouseInput = secondaryMouseInputBackup;
@@ -904,31 +904,31 @@ void EventManager::f380_processCommandQueue() {
}
if (cmdType == k200_CommandEntranceEnterDungeon) {
- _vm->_g298_newGame = k1_modeLoadDungeon;
+ _vm->_newGameFl = k1_modeLoadDungeon;
return;
}
if (cmdType == k201_CommandEntranceResume) {
- _vm->_g298_newGame = k0_modeLoadSavedGame;
+ _vm->_newGameFl = k0_modeLoadSavedGame;
return;
}
if (cmdType == k202_CommandEntranceDrawCredits) {
- _vm->f442_SARTEND_processCommand202_entranceDrawCredits();
+ _vm->entranceDrawCredits();
return;
}
if ((cmdType >= k210_CommandClickOnDialogChoice_1) && (cmdType <= k213_CommandClickOnDialogChoice_4)) {
- _vm->_dialog->_g335_selectedDialogChoice = cmdType - (k210_CommandClickOnDialogChoice_1 - 1);
+ _vm->_dialog->_selectedDialogChoice = cmdType - (k210_CommandClickOnDialogChoice_1 - 1);
return;
}
if (cmdType == k215_CommandRestartGame)
- _vm->_g523_restartGameRequest = true;
+ _vm->_restartGameRequest = true;
}
void EventManager::f365_commandTurnParty(CommandType cmdType) {
- _vm->_g321_stopWaitingForPlayerInput = true;
+ _vm->_stopWaitingForPlayerInput = true;
if (cmdType == k1_CommandTurnLeft)
f362_commandHighlightBoxEnable(234, 261, 125, 145);
else
@@ -941,7 +941,7 @@ void EventManager::f365_commandTurnParty(CommandType cmdType) {
}
_vm->_moveSens->f276_sensorProcessThingAdditionOrRemoval(_vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, Thing::_party, true, false);
- _vm->_championMan->setPartyDirection(M21_normalizeModulo4(_vm->_dungeonMan->_g308_partyDir + ((cmdType == k2_CommandTurnRight) ? 1 : 3)));
+ _vm->_championMan->setPartyDirection(normalizeModulo4(_vm->_dungeonMan->_g308_partyDir + ((cmdType == k2_CommandTurnRight) ? 1 : 3)));
_vm->_moveSens->f276_sensorProcessThingAdditionOrRemoval(_vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, Thing::_party, true, true);
}
@@ -968,7 +968,7 @@ void EventManager::f366_commandMoveParty(CommandType cmdType) {
-1 /* Left */
};
- _vm->_g321_stopWaitingForPlayerInput = true;
+ _vm->_stopWaitingForPlayerInput = true;
Champion *championsPtr = _vm->_championMan->_champions;
for (uint16 idx = k0_ChampionFirst; idx < _vm->_championMan->_partyChampionCount; idx++) {
_vm->_championMan->decrementStamina(idx, ((championsPtr->_load * 3) / _vm->_championMan->getMaximumLoad(championsPtr)) + 1); /* BUG0_50 When a champion is brought back to life at a Vi Altar, his current stamina is lower than what it was before dying. Each time the party moves the current stamina of all champions is decreased, including for dead champions, by an amount that depends on the current load of the champion. For a dead champion the load before he died is used */
@@ -1007,7 +1007,7 @@ void EventManager::f366_commandMoveParty(CommandType cmdType) {
if (_vm->_championMan->_partyChampionCount) {
if (isMovementBlocked) {
movementArrowIdx += (_vm->_dungeonMan->_g308_partyDir + 2);
- int16 L1124_i_FirstDamagedChampionIndex = _vm->_championMan->getTargetChampionIndex(partyMapX, partyMapY, M21_normalizeModulo4(movementArrowIdx));
+ int16 L1124_i_FirstDamagedChampionIndex = _vm->_championMan->getTargetChampionIndex(partyMapX, partyMapY, normalizeModulo4(movementArrowIdx));
int16 L1125_i_SecondDamagedChampionIndex = _vm->_championMan->getTargetChampionIndex(partyMapX, partyMapY, returnNextVal(movementArrowIdx));
int16 damage = _vm->_championMan->addPendingDamageAndWounds_getDamage(L1124_i_FirstDamagedChampionIndex, 1, k0x0008_ChampionWoundTorso | k0x0010_ChampionWoundLegs, k2_attackType_SELF);
if (L1124_i_FirstDamagedChampionIndex != L1125_i_SecondDamagedChampionIndex)
@@ -1025,7 +1025,7 @@ void EventManager::f366_commandMoveParty(CommandType cmdType) {
// DEBUG CODE: check for Console flag
if (isMovementBlocked && !_vm->_console->_debugNoclip) {
f357_discardAllInput();
- _vm->_g321_stopWaitingForPlayerInput = false;
+ _vm->_stopWaitingForPlayerInput = false;
return;
}
@@ -1042,8 +1042,8 @@ void EventManager::f366_commandMoveParty(CommandType cmdType) {
championsPtr++;
}
- _vm->_g310_disabledMovementTicks = disabledMovtTicks;
- _vm->_g311_projectileDisableMovementTicks = 0;
+ _vm->_disabledMovementTicks = disabledMovtTicks;
+ _vm->_projectileDisableMovementTicks = 0;
}
bool EventManager::f375_processType80_clickDungeonView_isLeaderHandObjThrown(int16 posX, int16 posY) {
@@ -1074,7 +1074,7 @@ bool EventManager::f375_processType80_clickDungeonView_isLeaderHandObjThrown(int
}
if (objectThrownFl)
- _vm->_g321_stopWaitingForPlayerInput = true;
+ _vm->_stopWaitingForPlayerInput = true;
return objectThrownFl;
}
@@ -1124,7 +1124,7 @@ void EventManager::f368_commandSetLeader(ChampionIndex champIndex) {
Champion *champion = &cm._champions[cm._leaderIndex];
champion->_dir = _vm->_dungeonMan->_g308_partyDir;
cm._champions[champIndex]._load += _vm->_dungeonMan->f140_getObjectWeight(cm._leaderHandObject);
- if (_vm->M0_indexToOrdinal(champIndex) != cm._candidateChampionOrdinal) {
+ if (_vm->indexToOrdinal(champIndex) != cm._candidateChampionOrdinal) {
champion->setAttributeFlag(k0x0400_ChampionAttributeIcon, true);
champion->setAttributeFlag(k0x0080_ChampionAttributeNameTitle, true);
cm.drawChampionState(champIndex);
@@ -1137,7 +1137,7 @@ void EventManager::f372_commandProcessType80ClickInDungeonViewTouchFrontWall() {
if ((mapX >= 0) && (mapX < _vm->_dungeonMan->_g273_currMapWidth)
&& (mapY >= 0) && (mapY < _vm->_dungeonMan->_g274_currMapHeight))
- _vm->_g321_stopWaitingForPlayerInput = _vm->_moveSens->f275_sensorIsTriggeredByClickOnWall(mapX, mapY, returnOppositeDir(_vm->_dungeonMan->_g308_partyDir));
+ _vm->_stopWaitingForPlayerInput = _vm->_moveSens->f275_sensorIsTriggeredByClickOnWall(mapX, mapY, returnOppositeDir(_vm->_dungeonMan->_g308_partyDir));
}
void EventManager::f377_commandProcessType80ClickInDungeonView(int16 posX, int16 posY) {
@@ -1159,9 +1159,9 @@ void EventManager::f377_commandProcessType80ClickInDungeonView(int16 posX, int16
if (_vm->_championMan->_leaderEmptyHanded) {
Junk *junkPtr = (Junk*)_vm->_dungeonMan->f157_getSquareFirstThingData(L1155_i_MapX, L1156_i_MapY);
if ((((Door*)junkPtr)->hasButton()) && _vm->_dungeonMan->_g291_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn].isPointInside(posX, posY - 33)) {
- _vm->_g321_stopWaitingForPlayerInput = true;
+ _vm->_stopWaitingForPlayerInput = true;
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k01_soundSWITCH, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, k1_soundModePlayIfPrioritized);
- _vm->_moveSens->f268_addEvent(k10_TMEventTypeDoor, L1155_i_MapX, L1156_i_MapY, 0, k2_SensorEffToggle, _vm->_g313_gameTime + 1);
+ _vm->_moveSens->f268_addEvent(k10_TMEventTypeDoor, L1155_i_MapX, L1156_i_MapY, 0, k2_SensorEffToggle, _vm->_gameTime + 1);
return;
}
} else if (f375_processType80_clickDungeonView_isLeaderHandObjThrown(posX, posY))
@@ -1235,7 +1235,7 @@ void EventManager::f282_commandProcessCommands160To162ClickInResurrectReincarnat
Champion *champ = &champMan._champions[championIndex];
if (commandType == k162_CommandClickInPanelCancel) {
invMan.f355_toggleInventory(k4_ChampionCloseInventory);
- champMan._candidateChampionOrdinal = _vm->M0_indexToOrdinal(kM1_ChampionNone);
+ champMan._candidateChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone);
if (champMan._partyChampionCount == 1) {
f368_commandSetLeader(kM1_ChampionNone);
}
@@ -1253,7 +1253,7 @@ void EventManager::f282_commandProcessCommands160To162ClickInResurrectReincarnat
return;
}
- champMan._candidateChampionOrdinal = _vm->M0_indexToOrdinal(kM1_ChampionNone);
+ champMan._candidateChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone);
int16 mapX = dunMan._g306_partyMapX + _vm->_dirIntoStepCountEast[dunMan._g308_partyDir];
int16 mapY = dunMan._g307_partyMapY + _vm->_dirIntoStepCountNorth[dunMan._g308_partyDir];
@@ -1286,7 +1286,7 @@ void EventManager::f282_commandProcessCommands160To162ClickInResurrectReincarnat
}
if (champMan._partyChampionCount == 1) {
- _vm->_projexpl->_g362_lastPartyMovementTime = _vm->_g313_gameTime;
+ _vm->_projexpl->_g362_lastPartyMovementTime = _vm->_gameTime;
f368_commandSetLeader(k0_ChampionFirst);
_vm->_menuMan->f394_setMagicCasterAndDrawSpellArea(k0_ChampionFirst);
} else
@@ -1350,7 +1350,7 @@ void EventManager::f373_processType80_clickInDungeonView_grabLeaderHandObject(ui
Thing groupThing = _vm->_groupMan->f175_groupGetThing(mapX, mapY);
if ((groupThing != Thing::_endOfList) &&
!_vm->_moveSens->f264_isLevitating(groupThing) &&
- _vm->_groupMan->f176_getCreatureOrdinalInCell((Group*)_vm->_dungeonMan->f156_getThingData(groupThing), M21_normalizeModulo4(viewCell + _vm->_dungeonMan->_g308_partyDir))) {
+ _vm->_groupMan->f176_getCreatureOrdinalInCell((Group*)_vm->_dungeonMan->f156_getThingData(groupThing), normalizeModulo4(viewCell + _vm->_dungeonMan->_g308_partyDir))) {
return; /* It is not possible to grab an object on floor if there is a non levitating creature on its cell */
}
}
@@ -1361,7 +1361,7 @@ void EventManager::f373_processType80_clickInDungeonView_grabLeaderHandObject(ui
_vm->_championMan->putObjectInLeaderHand(topPileThing, true);
}
- _vm->_g321_stopWaitingForPlayerInput = true;
+ _vm->_stopWaitingForPlayerInput = true;
}
void EventManager::f374_processType80_clickInDungeonViewDropLeaderHandObject(uint16 viewCell) {
@@ -1377,13 +1377,13 @@ void EventManager::f374_processType80_clickInDungeonViewDropLeaderHandObject(uin
if (viewCell > k1_ViewCellFrontRight)
mapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_g308_partyDir], mapY += _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_g308_partyDir];
- uint16 currCell = M21_normalizeModulo4(_vm->_dungeonMan->_g308_partyDir + viewCell);
+ uint16 currCell = normalizeModulo4(_vm->_dungeonMan->_g308_partyDir + viewCell);
Thing removedThing = _vm->_championMan->getObjectRemovedFromLeaderHand();
- _vm->_moveSens->f267_getMoveResult(M15_thingWithNewCell(removedThing, currCell), kM1_MapXNotOnASquare, 0, mapX, mapY);
+ _vm->_moveSens->f267_getMoveResult(thingWithNewCell(removedThing, currCell), kM1_MapXNotOnASquare, 0, mapX, mapY);
if (droppingIntoAnAlcove && _vm->_dungeonMan->_g287_isFacingViAltar && (_vm->_objectMan->f33_getIconIndex(removedThing) == k147_IconIndiceJunkChampionBones)) {
Junk *removedJunk = (Junk*)_vm->_dungeonMan->f156_getThingData(removedThing);
TimelineEvent newEvent;
- M33_setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_g313_gameTime + 1);
+ setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_gameTime + 1);
newEvent._type = k13_TMEventTypeViAltarRebirth;
newEvent._priority = removedJunk->getChargeCount();
newEvent._B._location._mapX = mapX;
@@ -1392,7 +1392,7 @@ void EventManager::f374_processType80_clickInDungeonViewDropLeaderHandObject(uin
newEvent._C.A._effect = k2_SensorEffToggle;
_vm->_timeline->f238_addEventGetEventIndex(&newEvent);
}
- _vm->_g321_stopWaitingForPlayerInput = true;
+ _vm->_stopWaitingForPlayerInput = true;
}
bool EventManager::f360_hasPendingClick(Common::Point& point, MouseButton button) {
@@ -1429,14 +1429,14 @@ void EventManager::f357_discardAllInput() {
void EventManager::f364_commandTakeStairs(bool stairsGoDown) {
_vm->_moveSens->f267_getMoveResult(Thing::_party, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, kM1_MapXNotOnASquare, 0);
- _vm->_g327_newPartyMapIndex = _vm->_dungeonMan->f154_getLocationAfterLevelChange(_vm->_dungeonMan->_g309_partyMapIndex, stairsGoDown ? -1 : 1, &_vm->_dungeonMan->_g306_partyMapX, &_vm->_dungeonMan->_g307_partyMapY);
- _vm->_dungeonMan->f173_setCurrentMap(_vm->_g327_newPartyMapIndex);
+ _vm->_newPartyMapIndex = _vm->_dungeonMan->f154_getLocationAfterLevelChange(_vm->_dungeonMan->_g309_partyMapIndex, stairsGoDown ? -1 : 1, &_vm->_dungeonMan->_g306_partyMapX, &_vm->_dungeonMan->_g307_partyMapY);
+ _vm->_dungeonMan->f173_setCurrentMap(_vm->_newPartyMapIndex);
_vm->_championMan->setPartyDirection(_vm->_dungeonMan->f155_getStairsExitDirection(_vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY));
_vm->_dungeonMan->f173_setCurrentMap(_vm->_dungeonMan->_g309_partyMapIndex);
}
void EventManager::f367_commandProcessTypes12to27_clickInChampionStatusBox(uint16 champIndex, int16 posX, int16 posY) {
- if (_vm->M0_indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) {
+ if (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) {
f368_commandSetLeader((ChampionIndex)champIndex);
} else {
uint16 commandType = f358_getCommandTypeFromMouseInput(_mouseInputChampionNamesHands, Common::Point(posX, posY), k1_LeftMouseButton);
@@ -1454,7 +1454,7 @@ void EventManager::f70_mouseProcessCommands125To128_clickOnChampionIcon(uint16 c
_gK100_preventBuildPointerScreenArea = true;
if (!_g599_useChampionIconOrdinalAsMousePointerBitmap) {
- if (_vm->_championMan->getIndexInCell(M21_normalizeModulo4(champIconIndex + _vm->_dungeonMan->_g308_partyDir)) == kM1_ChampionNone) {
+ if (_vm->_championMan->getIndexInCell(normalizeModulo4(champIconIndex + _vm->_dungeonMan->_g308_partyDir)) == kM1_ChampionNone) {
_gK100_preventBuildPointerScreenArea = false;
return;
}
@@ -1469,25 +1469,25 @@ void EventManager::f70_mouseProcessCommands125To128_clickOnChampionIcon(uint16 c
_vm->_displayMan->f129_blitToBitmapShrinkWithPalChange(tmpBitmap, _g613_mousePointerOriginalColorsChampionIcon, 32, 18, 32, 18, mousePointerIconShadowBox);
_vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->_g348_bitmapScreen, _g613_mousePointerOriginalColorsChampionIcon, championIconBox, curChampionIconBox->_x1, curChampionIconBox->_y1, k160_byteWidthScreen, k16_byteWidth, k0_ColorBlack, 200, 18);
_vm->_displayMan->D24_fillScreenBox(*curChampionIconBox, k0_ColorBlack);
- _g599_useChampionIconOrdinalAsMousePointerBitmap = _vm->M0_indexToOrdinal(champIconIndex);
+ _g599_useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(champIconIndex);
} else {
_g598_mousePointerBitmapUpdated = true;
- uint16 championIconIndex = _vm->M1_ordinalToIndex(_g599_useChampionIconOrdinalAsMousePointerBitmap);
- _g599_useChampionIconOrdinalAsMousePointerBitmap = _vm->M0_indexToOrdinal(kM1_ChampionNone);
- int16 championCellIndex = _vm->_championMan->getIndexInCell(M21_normalizeModulo4(championIconIndex + _vm->_dungeonMan->_g308_partyDir));
+ uint16 championIconIndex = _vm->ordinalToIndex(_g599_useChampionIconOrdinalAsMousePointerBitmap);
+ _g599_useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(kM1_ChampionNone);
+ int16 championCellIndex = _vm->_championMan->getIndexInCell(normalizeModulo4(championIconIndex + _vm->_dungeonMan->_g308_partyDir));
if (championIconIndex == champIconIndex) {
setFlag(_vm->_championMan->_champions[championCellIndex]._attributes, k0x0400_ChampionAttributeIcon);
_vm->_championMan->drawChampionState((ChampionIndex)championCellIndex);
} else {
- int16 championIndex = _vm->_championMan->getIndexInCell(M21_normalizeModulo4(champIconIndex + _vm->_dungeonMan->_g308_partyDir));
+ int16 championIndex = _vm->_championMan->getIndexInCell(normalizeModulo4(champIconIndex + _vm->_dungeonMan->_g308_partyDir));
if (championIndex >= 0) {
- _vm->_championMan->_champions[championIndex]._cell = (ViewCell)M21_normalizeModulo4(championIconIndex + _vm->_dungeonMan->_g308_partyDir);
+ _vm->_championMan->_champions[championIndex]._cell = (ViewCell)normalizeModulo4(championIconIndex + _vm->_dungeonMan->_g308_partyDir);
setFlag(_vm->_championMan->_champions[championIndex]._attributes, k0x0400_ChampionAttributeIcon);
_vm->_championMan->drawChampionState((ChampionIndex)championIndex);
} else
_vm->_displayMan->D24_fillScreenBox(_vm->_championMan->_boxChampionIcons[championIconIndex], k0_ColorBlack);
- _vm->_championMan->_champions[championCellIndex]._cell = (ViewCell)M21_normalizeModulo4(champIconIndex + _vm->_dungeonMan->_g308_partyDir);
+ _vm->_championMan->_champions[championCellIndex]._cell = (ViewCell)normalizeModulo4(champIconIndex + _vm->_dungeonMan->_g308_partyDir);
setFlag(_vm->_championMan->_champions[championCellIndex]._attributes, k0x0400_ChampionAttributeIcon);
_vm->_championMan->drawChampionState((ChampionIndex)championCellIndex);
}
@@ -1566,14 +1566,14 @@ void EventManager::f369_commandProcessTypes101To108_clickInSpellSymbolsArea(Comm
return;
f362_commandHighlightBoxEnable(234, 303, 63, 73);
- _vm->_g321_stopWaitingForPlayerInput = _vm->_menuMan->f408_getClickOnSpellCastResult();
+ _vm->_stopWaitingForPlayerInput = _vm->_menuMan->f408_getClickOnSpellCastResult();
return;
}
uint16 symbolIndex = cmdType - k101_CommandClickInSpellAreaSymbol_1;
Box *highlightBox = &spellSymbolsAndDelete[symbolIndex];
f362_commandHighlightBoxEnable(highlightBox->_x1, highlightBox->_x2, highlightBox->_y1, highlightBox->_y2);
- _vm->f22_delay(1);
+ _vm->delay(1);
f363_highlightBoxDisable();
if (symbolIndex < 6)
@@ -1597,7 +1597,7 @@ void EventManager::f371_commandProcessType111To115_ClickInActionArea(int16 posX,
else
f362_commandHighlightBoxEnable(234, 318, 110, 120);
- _vm->_g321_stopWaitingForPlayerInput = _vm->_menuMan->f391_didClickTriggerAction(mouseCommand - k113_CommandClickInActionAreaAction_0);
+ _vm->_stopWaitingForPlayerInput = _vm->_menuMan->f391_didClickTriggerAction(mouseCommand - k113_CommandClickInActionAreaAction_0);
}
}
} else if (_vm->_menuMan->_g509_actionAreaContainsIcons) {
@@ -1611,13 +1611,13 @@ void EventManager::f371_commandProcessType111To115_ClickInActionArea(int16 posX,
}
void EventManager::f544_resetPressingEyeOrMouth() {
- if (_vm->_g331_pressingEye) {
+ if (_vm->_pressingEye) {
_g597_ignoreMouseMovements = false;
- _vm->_g332_stopPressingEye = true;
+ _vm->_stopPressingEye = true;
}
- if (_vm->_g333_pressingMouth) {
+ if (_vm->_pressingMouth) {
_g597_ignoreMouseMovements = false;
- _vm->_g334_stopPressingMouth = true;
+ _vm->_stopPressingMouth = true;
}
}
@@ -1637,7 +1637,7 @@ void EventManager::f541_waitForMouseOrKeyActivity() {
break;
}
}
- _vm->f22_delay(1);
+ _vm->delay(1);
_vm->_displayMan->updateScreen();
}
}
diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp
index 10baee8646..f56d78d17f 100644
--- a/engines/dm/gfx.cpp
+++ b/engines/dm/gfx.cpp
@@ -1048,7 +1048,7 @@ void DisplayMan::f108_drawFloorOrnament(uint16 floorOrnOrdinal, uint16 viewFloor
}
if (drawFootprints)
- f108_drawFloorOrnament(_vm->M0_indexToOrdinal(k15_FloorOrnFootprints), viewFloorIndex);
+ f108_drawFloorOrnament(_vm->indexToOrdinal(k15_FloorOrnFootprints), viewFloorIndex);
}
void DisplayMan::f111_drawDoor(uint16 doorThingIndex, uint16 doorState, int16* doorNativeBitmapIndices, int16 byteCount, int16 viewDoorOrnIndex, DoorFrames* doorFrames) {
@@ -1069,12 +1069,12 @@ void DisplayMan::f111_drawDoor(uint16 doorThingIndex, uint16 doorState, int16* d
}
if ((doorFramesTemp == _doorFrameD1C) && _vm->_championMan->_party._event73Count_ThievesEye)
- f109_drawDoorOrnament(_vm->M0_indexToOrdinal(k16_DoorOrnThivesEyeMask), k2_ViewDoorOrnament_D1LCR);
+ f109_drawDoorOrnament(_vm->indexToOrdinal(k16_DoorOrnThivesEyeMask), k2_ViewDoorOrnament_D1LCR);
if (doorState == k4_doorState_CLOSED)
f102_drawDoorBitmap(&doorFramesTemp->_closedOrDestroyed);
else if (doorState == k5_doorState_DESTROYED) {
- f109_drawDoorOrnament(_vm->M0_indexToOrdinal(k15_DoorOrnDestroyedMask), viewDoorOrnIndex);
+ f109_drawDoorOrnament(_vm->indexToOrdinal(k15_DoorOrnDestroyedMask), viewDoorOrnIndex);
f102_drawDoorBitmap(&doorFramesTemp->_closedOrDestroyed);
} else {
doorState--;
@@ -1253,7 +1253,7 @@ void DisplayMan::f116_drawSquareD3L(Direction dir, int16 posX, int16 posY) {
f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k1_ViewSquare_D3L, k0x0218_CellOrder_DoorPass1_BackLeft_BackRight);
f100_drawWallSetBitmap(_g705_bitmapWallSet_DoorFrameLeft_D3L, doorFrameLeftD3L);
f111_drawDoor(squareAspect[k3_DoorThingIndexAspect], squareAspect[k2_DoorStateAspect],
- _g693_doorNativeBitmapIndex_Front_D3LCR, M75_bitmapByteCount(48, 41), k0_ViewDoorOrnament_D3LCR, &doorFrameD3L);
+ _g693_doorNativeBitmapIndex_Front_D3LCR, bitmapByteCount(48, 41), k0_ViewDoorOrnament_D3LCR, &doorFrameD3L);
order = k0x0349_CellOrder_DoorPass2_FrontLeft_FrontRight;
break;
case k2_ElementTypePit:
@@ -1333,11 +1333,11 @@ void DisplayMan::f117_drawSquareD3R(Direction dir, int16 posX, int16 posY) {
memmove(_g74_tmpBitmap, _g705_bitmapWallSet_DoorFrameLeft_D3L, 32 * 44);
f103_drawDoorFrameBitmapFlippedHorizontally(_g74_tmpBitmap, &doorFrameRightD3R);
if (((Door *)_vm->_dungeonMan->_g284_thingData[k0_DoorThingType])[squareAspect[k3_DoorThingIndexAspect]].hasButton())
- f110_drawDoorButton(_vm->M0_indexToOrdinal(k0_DoorButton), k0_viewDoorButton_D3R);
+ f110_drawDoorButton(_vm->indexToOrdinal(k0_DoorButton), k0_viewDoorButton_D3R);
f111_drawDoor(squareAspect[k3_DoorThingIndexAspect],
squareAspect[k2_DoorStateAspect], _g693_doorNativeBitmapIndex_Front_D3LCR,
- M75_bitmapByteCount(48, 41), k0_ViewDoorOrnament_D3LCR, &doorFrameD3R);
+ bitmapByteCount(48, 41), k0_ViewDoorOrnament_D3LCR, &doorFrameD3R);
break;;
case k2_ElementTypePit:
if (!squareAspect[k2_PitInvisibleAspect])
@@ -1411,10 +1411,10 @@ void DisplayMan::f118_drawSquareD3C(Direction dir, int16 posX, int16 posY) {
memmove(_g74_tmpBitmap, _g706_bitmapWallSet_DoorFrameLeft_D3C, 32 * 44);
f103_drawDoorFrameBitmapFlippedHorizontally(_g74_tmpBitmap, &doorFrameRightD3C);
if (((Door *)_vm->_dungeonMan->_g284_thingData[k0_DoorThingType])[squareAspect[k3_DoorThingIndexAspect]].hasButton())
- f110_drawDoorButton(_vm->M0_indexToOrdinal(k0_DoorButton), k1_ViewDoorOrnament_D2LCR);
+ f110_drawDoorButton(_vm->indexToOrdinal(k0_DoorButton), k1_ViewDoorOrnament_D2LCR);
f111_drawDoor(squareAspect[k3_DoorThingIndexAspect], squareAspect[k2_DoorStateAspect],
- _g693_doorNativeBitmapIndex_Front_D3LCR, M75_bitmapByteCount(48, 41), k0_ViewDoorOrnament_D3LCR, &doorFrameD3C);
+ _g693_doorNativeBitmapIndex_Front_D3LCR, bitmapByteCount(48, 41), k0_ViewDoorOrnament_D3LCR, &doorFrameD3C);
order = k0x0349_CellOrder_DoorPass2_FrontLeft_FrontRight;
break;
case k2_ElementTypePit:
@@ -1494,7 +1494,7 @@ void DisplayMan::f119_drawSquareD2L(Direction dir, int16 posX, int16 posY) {
f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k4_ViewSquare_D2L, k0x0218_CellOrder_DoorPass1_BackLeft_BackRight);
f100_drawWallSetBitmap(_g703_bitmapWallSet_DoorFrameTop_D2LCR, doorFrameTopD2L);
f111_drawDoor(squareAspect[k3_DoorThingIndexAspect], squareAspect[k2_DoorStateAspect], _g694_doorNativeBitmapIndex_Front_D2LCR,
- M75_bitmapByteCount(64, 61), k1_ViewDoorOrnament_D2LCR, &doorFrameD2L);
+ bitmapByteCount(64, 61), k1_ViewDoorOrnament_D2LCR, &doorFrameD2L);
order = k0x0349_CellOrder_DoorPass2_FrontLeft_FrontRight;
break;
case k2_ElementTypePit:
@@ -1581,7 +1581,7 @@ void DisplayMan::f120_drawSquareD2R(Direction dir, int16 posX, int16 posY) {
f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k5_ViewSquare_D2R, k0x0128_CellOrder_DoorPass1_BackRight_BackLeft);
f100_drawWallSetBitmap(_g703_bitmapWallSet_DoorFrameTop_D2LCR, doorFrameTopD2R);
f111_drawDoor(squareAspect[k3_DoorThingIndexAspect], squareAspect[k2_DoorStateAspect],
- _g694_doorNativeBitmapIndex_Front_D2LCR, M75_bitmapByteCount(64, 61), k1_ViewDoorOrnament_D2LCR, &doorFrameD2R);
+ _g694_doorNativeBitmapIndex_Front_D2LCR, bitmapByteCount(64, 61), k1_ViewDoorOrnament_D2LCR, &doorFrameD2R);
order = k0x0439_CellOrder_DoorPass2_FrontRight_FrontLeft;
break;
case k2_ElementTypePit:
@@ -1661,10 +1661,10 @@ void DisplayMan::f121_drawSquareD2C(Direction dir, int16 posX, int16 posY) {
memcpy(_g74_tmpBitmap, _g707_bitmapWallSet_DoorFrameLeft_D2C, 48 * 65);
f103_drawDoorFrameBitmapFlippedHorizontally(_g74_tmpBitmap, &doorFrameRightD2C);
if (((Door *)_vm->_dungeonMan->_g284_thingData[k0_DoorThingType])[squareAspect[k3_DoorThingIndexAspect]].hasButton())
- f110_drawDoorButton(_vm->M0_indexToOrdinal(k0_DoorButton), k2_viewDoorButton_D2C);
+ f110_drawDoorButton(_vm->indexToOrdinal(k0_DoorButton), k2_viewDoorButton_D2C);
f111_drawDoor(squareAspect[k3_DoorThingIndexAspect], squareAspect[k2_DoorStateAspect],
- _g694_doorNativeBitmapIndex_Front_D2LCR, M75_bitmapByteCount(64, 61), k1_ViewDoorOrnament_D2LCR, &doorFrameD2C);
+ _g694_doorNativeBitmapIndex_Front_D2LCR, bitmapByteCount(64, 61), k1_ViewDoorOrnament_D2LCR, &doorFrameD2C);
order = k0x0349_CellOrder_DoorPass2_FrontLeft_FrontRight;
break;
case k2_ElementTypePit:
@@ -1749,7 +1749,7 @@ void DisplayMan::f122_drawSquareD1L(Direction dir, int16 posX, int16 posY) {
f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k7_ViewSquare_D1L, k0x0028_CellOrder_DoorPass1_BackRight);
f100_drawWallSetBitmap(_g704_bitmapWallSet_DoorFrameTop_D1LCR, doorFrameTopD1L);
f111_drawDoor(squareAspect[k3_DoorThingIndexAspect], squareAspect[k2_DoorStateAspect],
- _g695_doorNativeBitmapIndex_Front_D1LCR, M75_bitmapByteCount(96, 88), k2_ViewDoorOrnament_D1LCR, &doorFrameD1L);
+ _g695_doorNativeBitmapIndex_Front_D1LCR, bitmapByteCount(96, 88), k2_ViewDoorOrnament_D1LCR, &doorFrameD1L);
order = k0x0039_CellOrder_DoorPass2_FrontRight;
break;
case k2_ElementTypePit:
@@ -1833,7 +1833,7 @@ void DisplayMan::f123_drawSquareD1R(Direction dir, int16 posX, int16 posY) {
f115_cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k8_ViewSquare_D1R, k0x0018_CellOrder_DoorPass1_BackLeft);
f100_drawWallSetBitmap(_g704_bitmapWallSet_DoorFrameTop_D1LCR, doorFrameTopD1R);
f111_drawDoor(squareAspect[k3_DoorThingIndexAspect], squareAspect[k2_DoorStateAspect],
- _g695_doorNativeBitmapIndex_Front_D1LCR, M75_bitmapByteCount(96, 88), k2_ViewDoorOrnament_D1LCR, &doorFrameD1R);
+ _g695_doorNativeBitmapIndex_Front_D1LCR, bitmapByteCount(96, 88), k2_ViewDoorOrnament_D1LCR, &doorFrameD1R);
order = k0x0049_CellOrder_DoorPass2_FrontLeft;
break;
case k2_ElementTypePit:
@@ -1915,10 +1915,10 @@ void DisplayMan::f124_drawSquareD1C(Direction dir, int16 posX, int16 posY) {
f100_drawWallSetBitmap(_g708_bitmapWallSet_DoorFrameLeft_D1C, _doorFrameLeftD1C);
f100_drawWallSetBitmap(_g710_bitmapWallSet_DoorFrameRight_D1C, _doorFrameRightD1C);
if (((Door *)_vm->_dungeonMan->_g284_thingData[k0_DoorThingType])[squareAspect[k3_DoorThingIndexAspect]].hasButton())
- f110_drawDoorButton(_vm->M0_indexToOrdinal(k0_DoorButton), k3_viewDoorButton_D1C);
+ f110_drawDoorButton(_vm->indexToOrdinal(k0_DoorButton), k3_viewDoorButton_D1C);
f111_drawDoor(squareAspect[k3_DoorThingIndexAspect], squareAspect[k2_DoorStateAspect],
- _g695_doorNativeBitmapIndex_Front_D1LCR, M75_bitmapByteCount(96, 88), k2_ViewDoorOrnament_D1LCR, _doorFrameD1C);
+ _g695_doorNativeBitmapIndex_Front_D1LCR, bitmapByteCount(96, 88), k2_ViewDoorOrnament_D1LCR, _doorFrameD1C);
order = k0x0349_CellOrder_DoorPass2_FrontLeft_FrontRight;
break;
case k2_ElementTypePit:
@@ -2181,7 +2181,7 @@ void DisplayMan::f94_loadFloorSet(FloorSet set) {
}
void DisplayMan::f95_loadWallSet(WallSet set) {
- if ((_g231_currentWallSet == set) && !_vm->_g523_restartGameRequest)
+ if ((_g231_currentWallSet == set) && !_vm->_restartGameRequest)
return;
_g231_currentWallSet = set;
@@ -2408,11 +2408,11 @@ void DisplayMan::f96_loadCurrentMapGraphics() {
CreatureAspect &aspect = _creatureAspects219[_g264_currMapAllowedCreatureTypes[creatureType]];
uint16 replColorOrdinal = aspect.getReplColour9();
if (replColorOrdinal)
- f93_applyCreatureReplColors(9, _vm->M1_ordinalToIndex(replColorOrdinal));
+ f93_applyCreatureReplColors(9, _vm->ordinalToIndex(replColorOrdinal));
replColorOrdinal = aspect.getReplColour10();
if (replColorOrdinal)
- f93_applyCreatureReplColors(10, _vm->M1_ordinalToIndex(replColorOrdinal));
+ f93_applyCreatureReplColors(10, _vm->ordinalToIndex(replColorOrdinal));
}
_g297_drawFloorAndCeilingRequested = true;
@@ -3082,11 +3082,11 @@ void DisplayMan::f115_cthulhu(Thing thingParam, Direction directionParam, int16
cellYellowBear = returnOppositeDir(directionParam); /* Alcove is on the opposite direction of the viewing direction */
objectShiftIndex = 2;
} else {
- AL_2_viewCell = _vm->M1_ordinalToIndex((int16)remainingViewCellOrdinalsToProcess & 0x000F); /* View cell is the index of coordinates to draw object */
+ AL_2_viewCell = _vm->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++;
- cellYellowBear = M21_normalizeModulo4(AL_2_viewCell + directionParam); /* Convert view cell to absolute cell */
+ cellYellowBear = normalizeModulo4(AL_2_viewCell + directionParam); /* Convert view cell to absolute cell */
thingParam = firstThingToDraw;
viewSquareIndex = AL_10_viewSquareIndexBackup; /* Restore value as it may have been modified while drawing a creature */
objectShiftIndex = 0;
@@ -3252,7 +3252,7 @@ T0115015_DrawProjectileAsObject:
} else
goto T0115129_DrawProjectiles; /* No creature to draw at cell, skip to projectiles */
- creatureDirectionDelta = M21_normalizeModulo4(directionParam - _vm->_groupMan->M50_getCreatureValue(activeGroup->_directions, AL_0_creatureIndexRed));
+ creatureDirectionDelta = normalizeModulo4(directionParam - _vm->_groupMan->M50_getCreatureValue(activeGroup->_directions, AL_0_creatureIndexRed));
twoHalfSquareCreaturesFrontView = false;
if ((AL_4_groupCells = activeGroup->_cells) == k255_CreatureTypeSingleCenteredCreature) { /* If there is a single centered creature in the group */
if (remainingViewCellOrdinalsToProcess || (doorFrontViewDrawingPass == 1))
@@ -3442,12 +3442,12 @@ T0115077_DrawSecondHalfSquareCreature:
else if (viewLane) /* Lane right */
AL_4_xPos += 100;
- boxByteGreen._x2 = f26_getBoundedValue(0, AL_4_xPos + byteWidth, 223);
+ boxByteGreen._x2 = getBoundedValue(0, AL_4_xPos + byteWidth, 223);
if (!boxByteGreen._x2)
goto T0115126_CreatureNotVisible;
int16 AL_0_creaturePosX;
- boxByteGreen._x1 = f26_getBoundedValue(0, AL_4_xPos - byteWidth + 1, 223);
+ boxByteGreen._x1 = getBoundedValue(0, AL_4_xPos - byteWidth + 1, 223);
if (boxByteGreen._x1) {
if (boxByteGreen._x1 == 223)
goto T0115126_CreatureNotVisible;
@@ -3485,7 +3485,7 @@ T0115129_DrawProjectiles:
if ((thingParam.getType() == k14_ProjectileThingType) && (thingParam.getCell() == cellYellowBear)) {
Projectile *projectile = (Projectile*)_vm->_dungeonMan->f156_getThingData(thingParam);
if ((AL_4_projectileAspect = _vm->_dungeonMan->f142_getProjectileAspect(projectile->_slot)) < 0) { /* Negative value: projectile aspect is the ordinal of a PROJECTIL_ASPECT */
- objectAspect = (ObjectAspect*)&_projectileAspect[_vm->M1_ordinalToIndex(-AL_4_projectileAspect)];
+ objectAspect = (ObjectAspect*)&_projectileAspect[_vm->ordinalToIndex(-AL_4_projectileAspect)];
AL_4_nativeBitmapIndex = ((ProjectileAspect*)objectAspect)->_firstNativeBitmapRelativeIndex + k316_FirstProjectileGraphicIndice;
projectileAspectType = getFlag(((ProjectileAspect*)objectAspect)->_graphicInfo, k0x0003_ProjectileAspectTypeMask);
@@ -3628,7 +3628,7 @@ T0115171_BackFromT0115015_DrawProjectileAsObject:;
AL_4_explosionAspectIndex = k3_ExplosionAspectSmoke;
} else {
if (AL_4_explosionType == k100_ExplosionType_RebirthStep1) {
- objectAspect = (ObjectAspect*)&_projectileAspect[_vm->M1_ordinalToIndex(-_vm->_dungeonMan->f142_getProjectileAspect(Thing::_explLightningBolt))];
+ objectAspect = (ObjectAspect*)&_projectileAspect[_vm->ordinalToIndex(-_vm->_dungeonMan->f142_getProjectileAspect(Thing::_explLightningBolt))];
bitmapRedBanana = f489_getNativeBitmapOrGraphic(((ProjectileAspect*)objectAspect)->_firstNativeBitmapRelativeIndex + (k316_FirstProjectileGraphicIndice + 1));
explosionCoordinates = rebirthStep1ExplosionCoordinates[AL_1_viewSquareExplosionIndex - 3];
byteWidth = M78_getScaledDimension((((ProjectileAspect*)objectAspect)->_byteWidth), explosionCoordinates[2]);
@@ -3706,7 +3706,7 @@ T0115200_DrawExplosion:
continue;
boxByteGreen._x2 = AL_4_xPos;
AL_4_xPos = explosionCoordinates[0];
- boxByteGreen._x1 = f26_getBoundedValue(0, AL_4_xPos - byteWidth + 1, 223);
+ boxByteGreen._x1 = getBoundedValue(0, AL_4_xPos - byteWidth + 1, 223);
if (boxByteGreen._x1)
AL_4_xPos = paddingPixelCount;
@@ -3841,7 +3841,7 @@ void DisplayMan::f436_STARTEND_FadeToPalette(uint16* P0849_pui_Palette) {
*paletteRegister += 256;
}
}
- _vm->f22_delay(1);
+ _vm->delay(1);
_vm->_eventMan->f357_discardAllInput();
f508_buildPaletteChangeCopperList(_gK16_paletteFadeTemporary, _gK16_paletteFadeTemporary);
}
diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp
index 4b30d2f99c..14b2a44eb8 100644
--- a/engines/dm/group.cpp
+++ b/engines/dm/group.cpp
@@ -71,7 +71,7 @@ GroupMan::~GroupMan() {
}
void GroupMan::f196_initActiveGroups() {
- if (_vm->_g298_newGame)
+ if (_vm->_newGameFl)
_g376_maxActiveGroupCount = 60;
if (_g375_activeGroups)
@@ -102,7 +102,7 @@ int16 GroupMan::f176_getCreatureOrdinalInCell(Group *group, uint16 cell) {
uint16 currMapIndex = _vm->_dungeonMan->_g272_currMapIndex;
byte groupCells = f145_getGroupCells(group, currMapIndex);
if (groupCells == k255_CreatureTypeSingleCenteredCreature)
- return _vm->M0_indexToOrdinal(0);
+ return _vm->indexToOrdinal(0);
int retval = 0;
byte creatureIndex = group->getCount();
@@ -113,14 +113,14 @@ int16 GroupMan::f176_getCreatureOrdinalInCell(Group *group, uint16 cell) {
do {
byte creatureCell = M50_getCreatureValue(groupCells, creatureIndex);
if (creatureCell == cell || creatureCell == returnNextVal(cell)) {
- retval = _vm->M0_indexToOrdinal(creatureIndex);
+ retval = _vm->indexToOrdinal(creatureIndex);
break;
}
} while (creatureIndex--);
} else {
do {
if (M50_getCreatureValue(groupCells, creatureIndex) == cell) {
- retval = _vm->M0_indexToOrdinal(creatureIndex);
+ retval = _vm->indexToOrdinal(creatureIndex);
break;
}
} while (creatureIndex--);
@@ -151,7 +151,7 @@ void GroupMan::f188_dropGroupPossessions(int16 mapX, int16 mapY, Thing groupThin
Thing nextThing;
do {
nextThing = _vm->_dungeonMan->f159_getNextThing(currentThing);
- currentThing = M15_thingWithNewCell(currentThing, _vm->getRandomNumber(4));
+ currentThing = thingWithNewCell(currentThing, _vm->getRandomNumber(4));
if ((currentThing).getType() == k5_WeaponThingType) {
L0371_B_WeaponDropped = true;
}
@@ -283,7 +283,7 @@ void GroupMan::f186_dropCreatureFixedPossessions(uint16 creatureType, int16 mapX
/* The same pointer type is used no matter the actual type k5_WeaponThingType, k6_ArmourThingType or k10_JunkThingType */
currWeapon->setType(currFixedPossession);
currWeapon->setCursed(cursedPossessions);
- nextUnusedThing = M15_thingWithNewCell(nextUnusedThing, ((cell == k255_CreatureTypeSingleCenteredCreature) || !_vm->getRandomNumber(4)) ? _vm->getRandomNumber(4) : cell);
+ nextUnusedThing = thingWithNewCell(nextUnusedThing, ((cell == k255_CreatureTypeSingleCenteredCreature) || !_vm->getRandomNumber(4)) ? _vm->getRandomNumber(4) : cell);
_vm->_moveSens->f267_getMoveResult(nextUnusedThing, kM1_MapXNotOnASquare, 0, mapX, mapY);
currFixedPossession = *fixedPossessions++;
}
@@ -369,7 +369,7 @@ bool GroupMan::f232_groupIsDoorDestoryedByAttack(uint16 mapX, uint16 mapY, int16
if (Square(*L0574_puc_Square).getDoorState() == k4_doorState_CLOSED) {
if (ticks) {
TimelineEvent L0575_s_Event;
- M33_setMapAndTime(L0575_s_Event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, _vm->_g313_gameTime + ticks);
+ setMapAndTime(L0575_s_Event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, _vm->_gameTime + ticks);
L0575_s_Event._type = k2_TMEventTypeDoorDestruction;
L0575_s_Event._priority = 0;
L0575_s_Event._B._location._mapX = mapX;
@@ -445,7 +445,7 @@ int16 GroupMan::f190_groupGetDamageCreatureOutcome(Group *group, uint16 creature
if (group->getBehaviour() == k6_behavior_ATTACK) {
L0377_ps_Event = _vm->_timeline->_g370_events;
for (AL0374_ui_EventIndex = 0; AL0374_ui_EventIndex < _vm->_timeline->_g369_eventMaxCount; AL0374_ui_EventIndex++) {
- if ((M29_map(L0377_ps_Event->_mapTime) == _vm->_dungeonMan->_g272_currMapIndex) &&
+ if ((getMap(L0377_ps_Event->_mapTime) == _vm->_dungeonMan->_g272_currMapIndex) &&
(L0377_ps_Event->_B._location._mapX == mapX) &&
(L0377_ps_Event->_B._location._mapY == mapY) &&
((AL0375_ui_EventType = L0377_ps_Event->_type) > k32_TMEventTypeUpdateAspectGroup) &&
@@ -533,7 +533,7 @@ void GroupMan::f181_groupDeleteEvents(int16 mapX, int16 mapY) {
L0336_ps_Event = _vm->_timeline->_g370_events;
for (L0334_i_EventIndex = 0; L0334_i_EventIndex < _vm->_timeline->_g369_eventMaxCount; L0334_i_EventIndex++) {
- if ((M29_map(L0336_ps_Event->_mapTime) == _vm->_dungeonMan->_g272_currMapIndex) &&
+ if ((getMap(L0336_ps_Event->_mapTime) == _vm->_dungeonMan->_g272_currMapIndex) &&
((L0335_ui_EventType = L0336_ps_Event->_type) > k29_TMEventTypeGroupReactionDangerOnSquare - 1) && (L0335_ui_EventType < k41_TMEventTypeUpdateBehaviour_3 + 1) &&
(L0336_ps_Event->_B._location._mapX == mapX) && (L0336_ps_Event->_B._location._mapY == mapY)) {
_vm->_timeline->f237_deleteEvent(L0334_i_EventIndex);
@@ -644,7 +644,7 @@ void GroupMan::f209_processEvents29to41(int16 eventMapX, int16 eventMapY, int16
L0444_ps_Group = (Group *)_vm->_dungeonMan->f156_getThingData(L0449_T_GroupThing);
L0448_s_CreatureInfo = g243_CreatureInfo[L0444_ps_Group->_type];
/* Update the event */
- M33_setMapAndTime(L0465_s_NextEvent._mapTime, _vm->_dungeonMan->_g272_currMapIndex, _vm->_g313_gameTime);
+ setMapAndTime(L0465_s_NextEvent._mapTime, _vm->_dungeonMan->_g272_currMapIndex, _vm->_gameTime);
L0465_s_NextEvent._priority = 255 - L0448_s_CreatureInfo._movementTicks; /* The fastest creatures (with small MovementTicks value) get higher event priority */
L0465_s_NextEvent._B._location._mapX = eventMapX;
L0465_s_NextEvent._B._location._mapY = eventMapY;
@@ -670,7 +670,7 @@ T0209005_AddEventAndReturn:
/* If the creature is Lord Chaos then ignore the event if the game is won. Initialize data to analyze Fluxcages */
L0463_B_Archenemy = getFlag(L0448_s_CreatureInfo._attributes, k0x2000_MaskCreatureInfo_archenemy);
if (L0463_B_Archenemy) {
- if (_vm->_g302_gameWon) {
+ if (_vm->_gameWon) {
goto T0209139_Return;
}
_g386_fluxCageCount = 0;
@@ -678,7 +678,7 @@ T0209005_AddEventAndReturn:
}
L0445_ps_ActiveGroup = &_g375_activeGroups[L0444_ps_Group->getActiveGroupIndex()];
- L0462_i_TicksSinceLastMove = (unsigned char)_vm->_g313_gameTime - L0445_ps_ActiveGroup->_lastMoveTime;
+ L0462_i_TicksSinceLastMove = (unsigned char)_vm->_gameTime - L0445_ps_ActiveGroup->_lastMoveTime;
if (L0462_i_TicksSinceLastMove < 0)
L0462_i_TicksSinceLastMove += 256;
@@ -749,7 +749,7 @@ T0209005_AddEventAndReturn:
L0465_s_NextEvent._type = eventType + 5;
if (f200_groupGetDistanceToVisibleParty(L0444_ps_Group, kM1_wholeCreatureGroup, eventMapX, eventMapY)) {
if ((AL0447_i_Behavior != k6_behavior_ATTACK) && (AL0447_i_Behavior != k5_behavior_FLEE)) {
- if (M38_distance(_vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, eventMapX, eventMapY) <= 1)
+ if (getDistance(_vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, eventMapX, eventMapY) <= 1)
goto T0209044_SetBehavior6_Attack;
if (((AL0447_i_Behavior == k0_behavior_WANDER) || (AL0447_i_Behavior == k3_behavior_USELESS)) && (AL0447_i_Behavior != k7_behavior_APPROACH)) /* BUG0_00 Useless code. Behavior cannot be 3 because this value is never used. Moreover, the second condition in the && is redundant (if the value is 0 or 3, it cannot be 7). The actual condition is: if (AL0447_i_Behavior == k0_behavior_WANDER) */
goto T0209054_SetBehavior7_Approach;
@@ -763,13 +763,13 @@ T0209005_AddEventAndReturn:
goto T0209136;
}
if ((AL0450_i_DistanceXToParty > 3) || (AL0451_i_DistanceYToParty > 3)) {
- L0464_l_NextAspectUpdateTime = _vm->_g313_gameTime + ((L0448_s_CreatureInfo._animationTicks >> 4) & 0xF);
+ L0464_l_NextAspectUpdateTime = _vm->_gameTime + ((L0448_s_CreatureInfo._animationTicks >> 4) & 0xF);
goto T0209136;
}
} else { /* Process Update Behavior events 37 to 41 */
L0455_B_CurrentEventTypeIsNotUpdateBehavior = false;
if (ticks)
- L0464_l_NextAspectUpdateTime = _vm->_g313_gameTime;
+ L0464_l_NextAspectUpdateTime = _vm->_gameTime;
if (eventType == k37_TMEventTypeUpdateBehaviourGroup) { /* Process event 37, Update Group Behavior */
if ((AL0447_i_Behavior == k0_behavior_WANDER) || (AL0447_i_Behavior == k2_behavior_USELESS) || (AL0447_i_Behavior == k3_behavior_USELESS)) { /* BUG0_00 Useless code. Behavior cannot be 2 nor 3 because these values are never used. The actual condition is: if (AL0447_i_Behavior == k0_behavior_WANDER) */
@@ -788,9 +788,9 @@ T0209044_SetBehavior6_Attack:
if ((M50_getCreatureValue(L0445_ps_ActiveGroup->_directions, AL0447_i_CreatureIndex) != AL0446_i_Direction) &&
((!AL0447_i_CreatureIndex) || (!_vm->getRandomNumber(2)))) {
f205_setDirection(L0445_ps_ActiveGroup, AL0446_i_Direction, AL0447_i_CreatureIndex, L0460_ui_CreatureCount && (L0459_i_CreatureSize == k1_MaskCreatureSizeHalf));
- M32_setTime(L0465_s_NextEvent._mapTime, _vm->_g313_gameTime + _vm->getRandomNumber(4) + 2); /* Random delay represents the time for the creature to turn */
+ M32_setTime(L0465_s_NextEvent._mapTime, _vm->_gameTime + _vm->getRandomNumber(4) + 2); /* Random delay represents the time for the creature to turn */
} else {
- M32_setTime(L0465_s_NextEvent._mapTime, _vm->_g313_gameTime + 1);
+ M32_setTime(L0465_s_NextEvent._mapTime, _vm->_gameTime + 1);
}
if (L0455_B_CurrentEventTypeIsNotUpdateBehavior) {
L0465_s_NextEvent._mapTime += MIN((uint16)((L0448_s_CreatureInfo._attackTicks >> 1) + _vm->getRandomNumber(4)), ticks);
@@ -840,7 +840,7 @@ T0209061_MoveGroup:
L0465_s_NextEvent._B._location._mapY = _vm->_moveSens->_g398_moveResultMapY;;
L0445_ps_ActiveGroup->_priorMapX = eventMapX;
L0445_ps_ActiveGroup->_priorMapY = eventMapY;
- L0445_ps_ActiveGroup->_lastMoveTime = _vm->_g313_gameTime;
+ L0445_ps_ActiveGroup->_lastMoveTime = _vm->_gameTime;
} else {
L0461_i_MovementTicks = AL0447_i_Ticks;
L0462_i_TicksSinceLastMove = -1;
@@ -952,7 +952,7 @@ T0209096_SetBehavior0_Wander:
if (_vm->getRandomNumber(2)) {
/* If the creature cannot move and the party is adjacent then stop fleeing */
if (!f203_getFirstPossibleMovementDirOrdinal(&L0448_s_CreatureInfo, eventMapX, eventMapY, false)) {
- if (M38_distance(eventMapX, eventMapY, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY) <= 1)
+ if (getDistance(eventMapX, eventMapY, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY) <= 1)
goto T0209096_SetBehavior0_Wander;
}
/* Set creature target to the home square where the creature was located when the party entered the map */
@@ -1002,14 +1002,14 @@ T0209096_SetBehavior0_Wander:
if (AL0446_i_GroupCellsCriteria & 0x0038) { /* 7/8 chances of changing cell to the center of the square */
L0445_ps_ActiveGroup->_cells = k255_CreatureTypeSingleCenteredCreature;
} else { /* 1/8 chance of changing cell to the next or previous cell on the square */
- AL0446_i_GroupCellsCriteria = M21_normalizeModulo4(M21_normalizeModulo4(L0445_ps_ActiveGroup->_cells) + ((AL0446_i_GroupCellsCriteria & 0x0001) ? 1 : -1));
+ AL0446_i_GroupCellsCriteria = normalizeModulo4(normalizeModulo4(L0445_ps_ActiveGroup->_cells) + ((AL0446_i_GroupCellsCriteria & 0x0001) ? 1 : -1));
}
}
/* If 1/8 chance and the creature is not adjacent to the party and is a quarter square sized creature then process projectile impacts and update the creature cell if still alive. When the creature is not in front of the party, it has 7/8 chances of dodging a projectile by moving to another cell or staying in the center of the square */
if (!(AL0446_i_GroupCellsCriteria & 0x0038) && (L0452_i_DistanceToVisibleParty != 1) && (L0459_i_CreatureSize == k0_MaskCreatureSizeQuarter)) {
if (_vm->_projexpl->f218_projectileGetImpactCount(kM1_CreatureElemType, eventMapX, eventMapY, L0445_ps_ActiveGroup->_cells) && (_vm->_projexpl->_g364_creatureDamageOutcome == k2_outcomeKilledAllCreaturesInGroup)) /* This call to F0218_PROJECTILE_GetImpactCount works fine because there is a single creature in the group so L0445_ps_ActiveGroup->Cells contains only one cell index */
goto T0209139_Return;
- L0445_ps_ActiveGroup->_cells = M21_normalizeModulo4(AL0446_i_GroupCellsCriteria);
+ L0445_ps_ActiveGroup->_cells = normalizeModulo4(AL0446_i_GroupCellsCriteria);
}
}
/* If the creature can see the party and is looking in the party direction or can attack in all direction */
@@ -1034,7 +1034,7 @@ T0209096_SetBehavior0_Wander:
} else {
AL0446_i_Cell++;
}
- if (!f176_getCreatureOrdinalInCell(L0444_ps_Group, AL0446_i_Cell = M21_normalizeModulo4(AL0446_i_Cell)) ||
+ if (!f176_getCreatureOrdinalInCell(L0444_ps_Group, AL0446_i_Cell = normalizeModulo4(AL0446_i_Cell)) ||
(_vm->getRandomNumber(2) && !f176_getCreatureOrdinalInCell(L0444_ps_Group, AL0446_i_Cell = returnOppositeDir((Direction)AL0446_i_Cell)))) { /* If the selected cell (or the opposite cell) is not already occupied by a creature */
if (_vm->_projexpl->f218_projectileGetImpactCount(kM1_CreatureElemType, eventMapX, eventMapY, L0445_ps_ActiveGroup->_cells) && (_vm->_projexpl->_g364_creatureDamageOutcome == k2_outcomeKilledAllCreaturesInGroup)) /* BUG0_70 A projectile impact on a creature may be ignored. The function F0218_PROJECTILE_GetImpactCount to detect projectile impacts when a quarter square sized creature moves inside a group (to another cell on the same square) may fail if there are several creatures in the group because the function expects a single cell index for its last parameter. The function should be called once for each cell where there is a creature */
goto T0209139_Return;
@@ -1063,7 +1063,7 @@ T0209096_SetBehavior0_Wander:
L0445_ps_ActiveGroup->_targetMapY = _vm->_dungeonMan->_g307_partyMapY;
f205_setDirection(L0445_ps_ActiveGroup, L0454_i_PrimaryDirectionToOrFromParty, AL0447_i_CreatureIndex, L0460_ui_CreatureCount && (L0459_i_CreatureSize == k1_MaskCreatureSizeHalf));
L0465_s_NextEvent._mapTime += 2;
- L0464_l_NextAspectUpdateTime = M30_time(L0465_s_NextEvent._mapTime);
+ L0464_l_NextAspectUpdateTime = filterTime(L0465_s_NextEvent._mapTime);
} else { /* If the party is not visible, move to the target (last known party location) */
L0444_ps_Group->setBehaviour(k7_behavior_APPROACH);
if (L0460_ui_CreatureCount) {
@@ -1189,7 +1189,7 @@ int16 GroupMan::f200_groupGetDistanceToVisibleParty(Group *group, int16 creature
if (creatureIndex < 0) { /* Negative index means test if each creature in the group can see the party in their respective direction */
L0421_i_CreatureViewDirectionCount = 0;
for (creatureIndex = group->getCount(); creatureIndex >= 0; creatureIndex--) {
- L0420_i_CreatureDirection = M21_normalizeModulo4(L0423_ui_GroupDirections >> (creatureIndex << 1));
+ L0420_i_CreatureDirection = normalizeModulo4(L0423_ui_GroupDirections >> (creatureIndex << 1));
AL0422_i_Counter = L0421_i_CreatureViewDirectionCount;
while (AL0422_i_Counter--) {
if (L0425_ai_CreatureViewDirections[AL0422_i_Counter] == L0420_i_CreatureDirection) /* If the creature looks in the same direction as another one in the group */
@@ -1237,7 +1237,7 @@ int16 GroupMan::f199_getDistanceBetweenUnblockedSquares(int16 srcMapX, int16 src
int16 L0419_i_ValueC;
- if (M38_distance(srcMapX, srcMapY, destMapX, destMapY) <= 1) {
+ if (getDistance(srcMapX, srcMapY, destMapX, destMapY) <= 1) {
return 1;
}
L0415_B_DistanceXSmallerThanDistanceY = (AL0412_i_DistanceX = ((AL0412_i_DistanceX = destMapX - srcMapX) < 0) ? -AL0412_i_DistanceX : AL0412_i_DistanceX) < (AL0413_i_DistanceY = ((AL0413_i_DistanceY = destMapY - srcMapY) < 0) ? -AL0413_i_DistanceY : AL0413_i_DistanceY);
@@ -1262,7 +1262,7 @@ int16 GroupMan::f199_getDistanceBetweenUnblockedSquares(int16 srcMapX, int16 src
return 0;
}
}
- } while (M38_distance(AL0412_i_PathMapX, AL0413_i_PathMapY, srcMapX, srcMapY) > 1);
+ } while (getDistance(AL0412_i_PathMapX, AL0413_i_PathMapY, srcMapX, srcMapY) > 1);
return f226_getDistanceBetweenSquares(srcMapX, srcMapY, destMapX, destMapY);
}
@@ -1352,18 +1352,18 @@ int32 GroupMan::f179_getCreatureAspectUpdateTime(ActiveGroup *activeGroup, int16
activeGroup->_aspect[creatureIndex] = AL0326_ui_Aspect;
} while (L0330_B_ProcessGroup && (creatureIndex--));
AL0326_ui_AnimationTicks = g243_CreatureInfo[L0329_ps_Group->_type]._animationTicks;
- return _vm->_g313_gameTime + (isAttacking ? ((AL0326_ui_AnimationTicks >> 8) & 0xF) : ((AL0326_ui_AnimationTicks >> 4) & 0xF)) + _vm->getRandomNumber(2);
+ return _vm->_gameTime + (isAttacking ? ((AL0326_ui_AnimationTicks >> 8) & 0xF) : ((AL0326_ui_AnimationTicks >> 4) & 0xF)) + _vm->getRandomNumber(2);
}
void GroupMan::f205_setDirection(ActiveGroup *activeGroup, int16 dir, int16 creatureIndex, bool twoHalfSquareSizedCreatures) {
uint16 L0435_ui_GroupDirections;
static ActiveGroup *G0396_ps_TwoHalfSquareSizedCreaturesGroupLastDirectionSetActiveGroup;
- if (twoHalfSquareSizedCreatures && (_vm->_g313_gameTime == _g395_l_TwoHalfSquareSizedCreaturesGroupLastDirectionSetTime) && (activeGroup == G0396_ps_TwoHalfSquareSizedCreaturesGroupLastDirectionSetActiveGroup)) {
+ if (twoHalfSquareSizedCreatures && (_vm->_gameTime == _g395_l_TwoHalfSquareSizedCreaturesGroupLastDirectionSetTime) && (activeGroup == G0396_ps_TwoHalfSquareSizedCreaturesGroupLastDirectionSetActiveGroup)) {
return;
}
L0435_ui_GroupDirections = activeGroup->_directions;
- if (M21_normalizeModulo4(M50_getCreatureValue(L0435_ui_GroupDirections, creatureIndex) - dir) == 2) { /* If current and new direction are opposites then change direction only one step at a time */
+ if (normalizeModulo4(M50_getCreatureValue(L0435_ui_GroupDirections, creatureIndex) - dir) == 2) { /* If current and new direction are opposites then change direction only one step at a time */
dir = returnNextVal((_vm->getRandomNumber(65536) & 0x0002) + dir);
L0435_ui_GroupDirections = f178_getGroupValueUpdatedWithCreatureValue(L0435_ui_GroupDirections, creatureIndex, dir);
} else {
@@ -1371,7 +1371,7 @@ void GroupMan::f205_setDirection(ActiveGroup *activeGroup, int16 dir, int16 crea
}
if (twoHalfSquareSizedCreatures) {
L0435_ui_GroupDirections = f178_getGroupValueUpdatedWithCreatureValue(L0435_ui_GroupDirections, creatureIndex ^ 1, dir); /* Set direction of the second half square sized creature */
- _g395_l_TwoHalfSquareSizedCreaturesGroupLastDirectionSetTime = _vm->_g313_gameTime;
+ _g395_l_TwoHalfSquareSizedCreaturesGroupLastDirectionSetTime = _vm->_gameTime;
G0396_ps_TwoHalfSquareSizedCreaturesGroupLastDirectionSetActiveGroup = activeGroup;
}
activeGroup->_directions = (Direction)L0435_ui_GroupDirections;
@@ -1379,12 +1379,12 @@ void GroupMan::f205_setDirection(ActiveGroup *activeGroup, int16 dir, int16 crea
void GroupMan::f208_groupAddEvent(TimelineEvent *event, uint32 time) {
warning(false, "potentially dangerous cast to uint32 below");
- if (time < (uint32)M30_time(event->_mapTime)) {
+ if (time < (uint32)filterTime(event->_mapTime)) {
event->_type -= 5;
- event->_C._ticks = M30_time(event->_mapTime) - time;
+ event->_C._ticks = filterTime(event->_mapTime) - time;
M32_setTime(event->_mapTime, time);
} else {
- event->_C._ticks = time - M30_time(event->_mapTime);
+ event->_C._ticks = time - filterTime(event->_mapTime);
}
_vm->_timeline->f238_addEventGetEventIndex(event);
}
@@ -1400,10 +1400,10 @@ int16 GroupMan::f201_getSmelledPartyPrimaryDirOrdinal(CreatureInfo *creatureInfo
}
if ((((L0426_ui_SmellRange + 1) >> 1) >= _g381_currGroupDistanceToParty) && f199_getDistanceBetweenUnblockedSquares(mapY, mapX, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, &GroupMan::f198_isSmellPartyBlocked)) {
_vm->_projexpl->_g363_secondaryDirToOrFromParty = _g383_currGroupSecondaryDirToParty;
- return _vm->M0_indexToOrdinal(_g382_currGroupPrimaryDirToParty);
+ return _vm->indexToOrdinal(_g382_currGroupPrimaryDirToParty);
}
- if ((L0427_i_ScentOrdinal = _vm->_championMan->getScentOrdinal(mapY, mapX)) && ((_vm->_championMan->_party._scentStrengths[_vm->M1_ordinalToIndex(L0427_i_ScentOrdinal)] + _vm->getRandomNumber(4)) > (30 - (L0426_ui_SmellRange << 1)))) { /* If there is a fresh enough party scent on the group square */
- return _vm->M0_indexToOrdinal(f228_getDirsWhereDestIsVisibleFromSource(mapY, mapX, _vm->_championMan->_party._scents[L0427_i_ScentOrdinal].getMapX(), _vm->_championMan->_party._scents[L0427_i_ScentOrdinal].getMapY()));
+ if ((L0427_i_ScentOrdinal = _vm->_championMan->getScentOrdinal(mapY, mapX)) && ((_vm->_championMan->_party._scentStrengths[_vm->ordinalToIndex(L0427_i_ScentOrdinal)] + _vm->getRandomNumber(4)) > (30 - (L0426_ui_SmellRange << 1)))) { /* If there is a fresh enough party scent on the group square */
+ return _vm->indexToOrdinal(f228_getDirsWhereDestIsVisibleFromSource(mapY, mapX, _vm->_championMan->_party._scents[L0427_i_ScentOrdinal].getMapX(), _vm->_championMan->_party._scents[L0427_i_ScentOrdinal].getMapY()));
}
return 0;
}
@@ -1421,7 +1421,7 @@ int16 GroupMan::f203_getFirstPossibleMovementDirOrdinal(CreatureInfo *info, int1
for (L0434_i_Direction = kDirNorth; L0434_i_Direction <= kDirWest; L0434_i_Direction++) {
if ((!_g384_groupMovementTestedDirections[L0434_i_Direction]) && f202_isMovementPossible(info, mapX, mapY, L0434_i_Direction, allowMovementOverImaginaryPitsAndFakeWalls)) {
- return _vm->M0_indexToOrdinal(L0434_i_Direction);
+ return _vm->indexToOrdinal(L0434_i_Direction);
}
}
return 0;
@@ -1471,7 +1471,7 @@ bool GroupMan::f207_isCreatureAttacking(Group *group, int16 mapX, int16 mapY, ui
#define AL0440_i_Damage L0440_i_Multiple
#define AL0440_i_AttackSoundOrdinal L0440_i_Multiple
- _vm->_projexpl->_g361_lastCreatureAttackTime = _vm->_g313_gameTime;
+ _vm->_projexpl->_g361_lastCreatureAttackTime = _vm->_gameTime;
ActiveGroup L0443_s_ActiveGroup = _g375_activeGroups[group->getActiveGroupIndex()];
CreatureInfo *L0441_ps_CreatureInfo = &g243_CreatureInfo[AL0437_ui_CreatureType = group->_type];
uint16 L0438_ui_PrimaryDirectionToParty = _g382_currGroupPrimaryDirToParty;
@@ -1527,7 +1527,7 @@ bool GroupMan::f207_isCreatureAttacking(Group *group, int16 mapX, int16 mapY, ui
AL0440_i_KineticEnergy += _vm->getRandomNumber(AL0440_i_KineticEnergy);
AL0440_i_KineticEnergy += _vm->getRandomNumber(AL0440_i_KineticEnergy);
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k13_soundSPELL, mapX, mapY, k0_soundModePlayImmediately);
- _vm->_projexpl->f212_projectileCreate(Thing(AL0437_T_Thing), mapX, mapY, AL0439_i_TargetCell, (Direction)_g382_currGroupPrimaryDirToParty, f26_getBoundedValue((int16)20, AL0440_i_KineticEnergy, (int16)255), L0441_ps_CreatureInfo->_dexterity, 8);
+ _vm->_projexpl->f212_projectileCreate(Thing(AL0437_T_Thing), mapX, mapY, AL0439_i_TargetCell, (Direction)_g382_currGroupPrimaryDirToParty, getBoundedValue((int16)20, AL0440_i_KineticEnergy, (int16)255), L0441_ps_CreatureInfo->_dexterity, 8);
} else {
if (getFlag(L0441_ps_CreatureInfo->_attributes, k0x0010_MaskCreatureInfo_attackAnyChamp)) {
AL0439_i_ChampionIndex = _vm->getRandomNumber(4);
@@ -1717,7 +1717,7 @@ void GroupMan::f180_startWanedring(int16 mapX, int16 mapY) {
if (L0332_ps_Group->getBehaviour() >= k4_behavior_USELESS) {
L0332_ps_Group->setBehaviour(k0_behavior_WANDER);
}
- M33_setMapAndTime(L0333_s_Event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, (_vm->_g313_gameTime + 1));
+ setMapAndTime(L0333_s_Event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, (_vm->_gameTime + 1));
L0333_s_Event._type = k37_TMEventTypeUpdateBehaviourGroup;
L0333_s_Event._priority = 255 - g243_CreatureInfo[L0332_ps_Group->_type]._movementTicks; /* The fastest creatures (with small MovementTicks value) get higher event priority */
L0333_s_Event._C._ticks = 0;
@@ -1750,7 +1750,7 @@ void GroupMan::f183_addActiveGroup(Thing thing, int16 mapX, int16 mapY) {
L0340_ps_Group->getActiveGroupIndex() = L0344_i_ActiveGroupIndex;
L0341_ps_ActiveGroup->_priorMapX = L0341_ps_ActiveGroup->_homeMapX = mapX;
L0341_ps_ActiveGroup->_priorMapY = L0341_ps_ActiveGroup->_homeMapY = mapY;
- L0341_ps_ActiveGroup->_lastMoveTime = _vm->_g313_gameTime - 127;
+ L0341_ps_ActiveGroup->_lastMoveTime = _vm->_gameTime - 127;
L0339_ui_CreatureIndex = L0340_ps_Group->getCount();
do {
L0341_ps_ActiveGroup->_directions = (Direction)f178_getGroupValueUpdatedWithCreatureValue(L0341_ps_ActiveGroup->_directions, L0339_ui_CreatureIndex, L0340_ps_Group->getDir());
@@ -1771,7 +1771,7 @@ void GroupMan::f184_removeActiveGroup(uint16 activeGroupIndex) {
L0348_ps_Group = &((Group *)_vm->_dungeonMan->_g284_thingData[k4_GroupThingType])[L0347_ps_ActiveGroup->_groupThingIndex];
_g377_currActiveGroupCount--;
L0348_ps_Group->_cells = L0347_ps_ActiveGroup->_cells;
- L0348_ps_Group->setDir(M21_normalizeModulo4(L0347_ps_ActiveGroup->_directions));
+ L0348_ps_Group->setDir(normalizeModulo4(L0347_ps_ActiveGroup->_directions));
if (L0348_ps_Group->getBehaviour() >= k4_behavior_USELESS) {
L0348_ps_Group->setBehaviour(k0_behavior_WANDER);
}
@@ -1988,7 +1988,7 @@ void GroupMan::f224_fluxCageAction(int16 mapX, int16 mapY) {
_vm->_dungeonMan->f163_linkThingToList(L0545_T_Thing, Thing(0), mapX, mapY);
(((Explosion*)_vm->_dungeonMan->_g284_thingData[k15_ExplosionThingType])[L0545_T_Thing.getIndex()]).setType(k50_ExplosionType_Fluxcage);
- M33_setMapAndTime(L0547_s_Event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, _vm->_g313_gameTime + 100);
+ setMapAndTime(L0547_s_Event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, _vm->_gameTime + 100);
L0547_s_Event._type = k24_TMEventTypeRemoveFluxcage;
L0547_s_Event._priority = 0;
L0547_s_Event._C._slot = L0545_T_Thing.toUint16();
@@ -2109,7 +2109,7 @@ void GroupMan::f225_fuseAction(uint16 mapX, uint16 mapY) {
return;
}
}
- _vm->f446_STARTEND_fuseSequnce();
+ _vm->fuseSequnce();
}
}
diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp
index e941663d49..222be9227c 100644
--- a/engines/dm/inventory.cpp
+++ b/engines/dm/inventory.cpp
@@ -96,22 +96,22 @@ void InventoryMan::f355_toggleInventory(ChampionIndex championIndex) {
if ((championIndex != k4_ChampionCloseInventory) && !_vm->_championMan->_champions[championIndex]._currHealth) {
return;
}
- if (_vm->_g333_pressingMouth || _vm->_g331_pressingEye) {
+ if (_vm->_pressingMouth || _vm->_pressingEye) {
return;
}
- _vm->_g321_stopWaitingForPlayerInput = true;
+ _vm->_stopWaitingForPlayerInput = true;
AL1102_ui_InventoryChampionOrdinal = _g432_inventoryChampionOrdinal;
- if (_vm->M0_indexToOrdinal(championIndex) == AL1102_ui_InventoryChampionOrdinal) {
+ if (_vm->indexToOrdinal(championIndex) == AL1102_ui_InventoryChampionOrdinal) {
championIndex = k4_ChampionCloseInventory;
}
_vm->_eventMan->f78_showMouse();
if (AL1102_ui_InventoryChampionOrdinal) {
- _g432_inventoryChampionOrdinal = _vm->M0_indexToOrdinal(kM1_ChampionNone);
+ _g432_inventoryChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone);
f334_closeChest();
- L1103_ps_Champion = &_vm->_championMan->_champions[_vm->M1_ordinalToIndex(AL1102_ui_InventoryChampionOrdinal)];
+ L1103_ps_Champion = &_vm->_championMan->_champions[_vm->ordinalToIndex(AL1102_ui_InventoryChampionOrdinal)];
if (L1103_ps_Champion->_currHealth && !_vm->_championMan->_candidateChampionOrdinal) {
setFlag(L1103_ps_Champion->_attributes, k0x1000_ChampionAttributeStatusBox);
- _vm->_championMan->drawChampionState((ChampionIndex)_vm->M1_ordinalToIndex(AL1102_ui_InventoryChampionOrdinal));
+ _vm->_championMan->drawChampionState((ChampionIndex)_vm->ordinalToIndex(AL1102_ui_InventoryChampionOrdinal));
}
if (_vm->_championMan->_partyIsSleeping) {
_vm->_eventMan->f77_hideMouse();
@@ -129,7 +129,7 @@ void InventoryMan::f355_toggleInventory(ChampionIndex championIndex) {
}
}
_vm->_displayMan->_g578_useByteBoxCoordinates = false;
- _g432_inventoryChampionOrdinal = _vm->M0_indexToOrdinal(championIndex);
+ _g432_inventoryChampionOrdinal = _vm->indexToOrdinal(championIndex);
if (!AL1102_ui_InventoryChampionOrdinal) {
_vm->_displayMan->f136_shadeScreenBox(&_vm->_displayMan->_boxMovementArrows, k0_ColorBlack);
}
@@ -254,7 +254,7 @@ void InventoryMan::f347_drawPanel() {
return;
}
- Thing thing = cm._champions[_vm->M1_ordinalToIndex(_g432_inventoryChampionOrdinal)].getSlot(k1_ChampionSlotActionHand);
+ Thing thing = cm._champions[_vm->ordinalToIndex(_g432_inventoryChampionOrdinal)].getSlot(k1_ChampionSlotActionHand);
_g424_panelContent = k0_PanelContentFoodWaterPoisoned;
switch (thing.getType()) {
@@ -498,7 +498,7 @@ void InventoryMan::f342_drawPanelObject(Thing thingToDraw, bool pressingEye) {
ChampionMan &champMan = *_vm->_championMan;
TextMan &textMan = *_vm->_textMan;
- if (_vm->_g331_pressingEye || _vm->_g333_pressingMouth) {
+ if (_vm->_pressingEye || _vm->_pressingMouth) {
f334_closeChest();
}
@@ -537,7 +537,7 @@ void InventoryMan::f342_drawPanelObject(Thing thingToDraw, bool pressingEye) {
descString = str;
} else if ((thingType == k8_PotionThingType)
&& (iconIndex != k163_IconIndicePotionWaterFlask)
- && (champMan.getSkillLevel((ChampionIndex)_vm->M1_ordinalToIndex(_g432_inventoryChampionOrdinal), k2_ChampionSkillPriest) > 1)) {
+ && (champMan.getSkillLevel((ChampionIndex)_vm->ordinalToIndex(_g432_inventoryChampionOrdinal), k2_ChampionSkillPriest) > 1)) {
str[0] = '_' + ((Potion *)rawThingPtr)->getPower() / 40;
str[1] = ' ';
str[2] = '\0';
@@ -825,7 +825,7 @@ void InventoryMan::f351_drawChampionSkillsAndStatistics() {
}
f334_closeChest();
- L1094_ps_Champion = &_vm->_championMan->_champions[L1093_ui_ChampionIndex = _vm->M1_ordinalToIndex(_g432_inventoryChampionOrdinal)];
+ L1094_ps_Champion = &_vm->_championMan->_champions[L1093_ui_ChampionIndex = _vm->ordinalToIndex(_g432_inventoryChampionOrdinal)];
_vm->_displayMan->f20_blitToViewport(_vm->_displayMan->f489_getNativeBitmapOrGraphic(k20_PanelEmptyIndice), g32_BoxPanel, k72_byteWidth, k8_ColorRed, 73);
L1091_i_Y = 58;
for (AL1090_ui_SkillIndex = k0_ChampionSkillFighter; AL1090_ui_SkillIndex <= k3_ChampionSkillWizard; AL1090_ui_SkillIndex++) {
@@ -931,11 +931,11 @@ void InventoryMan::f349_processCommand70_clickOnMouth() {
return;
}
_vm->_eventMan->_g597_ignoreMouseMovements = true;
- _vm->_g333_pressingMouth = true;
+ _vm->_pressingMouth = true;
if (!_vm->_eventMan->isMouseButtonDown(k1_LeftMouseButton)) {
_vm->_eventMan->_g597_ignoreMouseMovements = false;
- _vm->_g333_pressingMouth = false;
- _vm->_g334_stopPressingMouth = false;
+ _vm->_pressingMouth = false;
+ _vm->_stopPressingMouth = false;
} else {
_vm->_eventMan->f78_showMouse();
_vm->_eventMan->_g587_hideMousePointerRequestCount = 1;
@@ -953,7 +953,7 @@ void InventoryMan::f349_processCommand70_clickOnMouth() {
L1079_ui_IconIndex = _vm->_objectMan->f33_getIconIndex(L1078_T_Thing);
AL1088_ui_ThingType = L1078_T_Thing.getType();
L1089_ui_Weight = _vm->_dungeonMan->f140_getObjectWeight(L1078_T_Thing);
- L1083_ps_Champion = &_vm->_championMan->_champions[L1080_ui_ChampionIndex = _vm->M1_ordinalToIndex(_g432_inventoryChampionOrdinal)];
+ L1083_ps_Champion = &_vm->_championMan->_champions[L1080_ui_ChampionIndex = _vm->ordinalToIndex(_g432_inventoryChampionOrdinal)];
L1082_ps_Junk = (Junk*)_vm->_dungeonMan->f156_getThingData(L1078_T_Thing);
if ((L1079_ui_IconIndex >= k8_IconIndiceJunkWater) && (L1079_ui_IconIndex <= k9_IconIndiceJunkWaterSkin)) {
if (!(L1082_ps_Junk->getChargeCount())) {
@@ -1004,7 +1004,7 @@ void InventoryMan::f349_processCommand70_clickOnMouth() {
}
L1083_ps_Champion->_shieldDefense += AL1085_ui_AdjustedPotionPower;
L1084_s_Event._type = k72_TMEventTypeChampionShield;
- M33_setMapAndTime(L1084_s_Event._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_g313_gameTime + (AL1085_ui_AdjustedPotionPower * AL1085_ui_AdjustedPotionPower));
+ setMapAndTime(L1084_s_Event._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_gameTime + (AL1085_ui_AdjustedPotionPower * AL1085_ui_AdjustedPotionPower));
L1084_s_Event._priority = L1080_ui_ChampionIndex;
L1084_s_Event._B._defense = AL1085_ui_AdjustedPotionPower;
_vm->_timeline->f238_addEventGetEventIndex(&L1084_s_Event);
@@ -1050,7 +1050,7 @@ void InventoryMan::f349_processCommand70_clickOnMouth() {
L1083_ps_Champion->_currHealth = L1083_ps_Champion->_maxHealth;
if (L1081_B_RemoveObjectFromLeaderHand) {
- for (L1086_ui_Counter = 5; --L1086_ui_Counter; _vm->f22_delay(8)) { /* Animate mouth icon */
+ for (L1086_ui_Counter = 5; --L1086_ui_Counter; _vm->delay(8)) { /* Animate mouth icon */
_vm->_objectMan->f37_drawIconToScreen(k205_IconIndiceMouthOpen + !(L1086_ui_Counter & 0x0001), 56, 46);
_vm->_eventMan->f357_discardAllInput();
if (_vm->_engineShouldQuit)
@@ -1093,18 +1093,18 @@ void InventoryMan::f348_adjustStatisticCurrentValue(Champion* champ, uint16 stat
void InventoryMan::f352_processCommand71_clickOnEye() {
_vm->_eventMan->_g597_ignoreMouseMovements = true;
- _vm->_g331_pressingEye = true;
+ _vm->_pressingEye = true;
if (!_vm->_eventMan->isMouseButtonDown(k1_LeftMouseButton)) {
_vm->_eventMan->_g597_ignoreMouseMovements = false;
- _vm->_g331_pressingEye = false;
- _vm->_g332_stopPressingEye = false;
+ _vm->_pressingEye = false;
+ _vm->_stopPressingEye = false;
return;
}
_vm->_eventMan->f357_discardAllInput();
_vm->_eventMan->f77_hideMouse();
_vm->_eventMan->f77_hideMouse();
_vm->_eventMan->f77_hideMouse();
- _vm->f22_delay(8);
+ _vm->delay(8);
f332_drawIconToViewport(k203_IconIndiceEyeLooking, 12, 13);
if (_vm->_championMan->_leaderEmptyHanded) {
f351_drawChampionSkillsAndStatistics();
diff --git a/engines/dm/loadsave.cpp b/engines/dm/loadsave.cpp
index a3910a908c..ceaf79e68b 100644
--- a/engines/dm/loadsave.cpp
+++ b/engines/dm/loadsave.cpp
@@ -43,8 +43,8 @@
namespace DM {
-LoadgameResponse DMEngine::f435_loadgame(int16 slot) {
- if (slot == -1 && _g298_newGame == k0_modeLoadSavedGame)
+LoadgameResponse DMEngine::loadgame(int16 slot) {
+ if (slot == -1 && _newGameFl == k0_modeLoadSavedGame)
return kM1_LoadgameFailure;
bool L1366_B_FadePalette = true;
@@ -62,18 +62,18 @@ LoadgameResponse DMEngine::f435_loadgame(int16 slot) {
uint16 _dungeonId;
} dmSaveHeader;
- if (!_g298_newGame) {
+ if (!_newGameFl) {
fileName = getSavefileName(slot);
saveFileManager = _system->getSavefileManager();
file = saveFileManager->openForLoading(fileName);
}
- if (_g298_newGame) {
+ if (_newGameFl) {
//L1366_B_FadePalette = !F0428_DIALOG_RequireGameDiskInDrive_NoDialogDrawn(C0_DO_NOT_FORCE_DIALOG_DM_CSB, true);
- _g524_restartGameAllowed = false;
+ _restartGameAllowed = false;
_championMan->_partyChampionCount = 0;
_championMan->_leaderHandObject = Thing::_none;
- _g525_gameId = ((int32)getRandomNumber(65536)) * getRandomNumber(65536);
+ _gameId = ((int32)getRandomNumber(65536)) * getRandomNumber(65536);
} else {
SaveGameHeader header;
readSaveGameHeader(file, &header);
@@ -88,9 +88,9 @@ LoadgameResponse DMEngine::f435_loadgame(int16 slot) {
dmSaveHeader._gameId = file->readSint32BE();
dmSaveHeader._dungeonId = file->readUint16BE();
- _g525_gameId = dmSaveHeader._gameId;
+ _gameId = dmSaveHeader._gameId;
- _g313_gameTime = file->readSint32BE();
+ _gameTime = file->readSint32BE();
// G0349_ul_LastRandomNumber = L1371_s_GlobalData.LastRandomNumber;
_championMan->_partyChampionCount = file->readUint16BE();
_dungeonMan->_g306_partyMapX = file->readSint16BE();
@@ -105,12 +105,12 @@ LoadgameResponse DMEngine::f435_loadgame(int16 slot) {
_groupMan->_g377_currActiveGroupCount = file->readUint16BE();
_projexpl->_g361_lastCreatureAttackTime = file->readSint32BE();
_projexpl->_g362_lastPartyMovementTime = file->readSint32BE();
- _g310_disabledMovementTicks = file->readSint16BE();
- _g311_projectileDisableMovementTicks = file->readSint16BE();
- _g312_lastProjectileDisabledMovementDirection = file->readSint16BE();
+ _disabledMovementTicks = file->readSint16BE();
+ _projectileDisableMovementTicks = file->readSint16BE();
+ _lastProjectileDisabledMovementDirection = file->readSint16BE();
_championMan->_leaderHandObject = Thing(file->readUint16BE());
_groupMan->_g376_maxActiveGroupCount = file->readUint16BE();
- if (!_g523_restartGameRequest) {
+ if (!_restartGameRequest) {
_timeline->f233_initTimeline();
_groupMan->f196_initActiveGroups();
}
@@ -128,31 +128,31 @@ LoadgameResponse DMEngine::f435_loadgame(int16 slot) {
_dungeonMan->f434_loadDungeonFile(file);
delete file;
- if (_g298_newGame) {
+ if (_newGameFl) {
_timeline->f233_initTimeline();
_groupMan->f196_initActiveGroups();
if (L1366_B_FadePalette) {
_displayMan->f436_STARTEND_FadeToPalette(_displayMan->_g345_aui_BlankBuffer);
- f22_delay(1);
+ delay(1);
_displayMan->fillScreen(k0_ColorBlack);
_displayMan->f436_STARTEND_FadeToPalette(_displayMan->_g347_paletteTopAndBottomScreen);
}
} else {
- _g526_dungeonId = dmSaveHeader._dungeonId;
+ _dungeonId = dmSaveHeader._dungeonId;
- _g524_restartGameAllowed = true;
+ _restartGameAllowed = true;
switch (getGameLanguage()) { // localized
default:
case Common::EN_ANY:
- _dialog->f427_dialogDraw(nullptr, "LOADING GAME . . .", nullptr, nullptr, nullptr, nullptr, true, true, true);
+ _dialog->dialogDraw(nullptr, "LOADING GAME . . .", nullptr, nullptr, nullptr, nullptr, true, true, true);
break;
case Common::DE_DEU:
- _dialog->f427_dialogDraw(nullptr, "SPIEL WIRD GELADEN . . .", nullptr, nullptr, nullptr, nullptr, true, true, true);
+ _dialog->dialogDraw(nullptr, "SPIEL WIRD GELADEN . . .", nullptr, nullptr, nullptr, nullptr, true, true, true);
break;
case Common::FR_FRA:
- _dialog->f427_dialogDraw(nullptr, "CHARGEMENT DU JEU . . .", nullptr, nullptr, nullptr, nullptr, true, true, true);
+ _dialog->dialogDraw(nullptr, "CHARGEMENT DU JEU . . .", nullptr, nullptr, nullptr, nullptr, true, true, true);
break;
}
@@ -163,20 +163,20 @@ LoadgameResponse DMEngine::f435_loadgame(int16 slot) {
}
-void DMEngine::f433_processCommand140_saveGame() {
+void DMEngine::saveGame() {
_menuMan->f456_drawDisabledMenu();
_eventMan->f78_showMouse();
switch (getGameLanguage()) { // localized
default:
case Common::EN_ANY:
- _dialog->f427_dialogDraw(nullptr, nullptr, "SAVE AND PLAY", "SAVE AND QUIT", "CANCEL", "LOAD", false, false, false);
+ _dialog->dialogDraw(nullptr, nullptr, "SAVE AND PLAY", "SAVE AND QUIT", "CANCEL", "LOAD", false, false, false);
break;
case Common::DE_DEU:
- _dialog->f427_dialogDraw(nullptr, nullptr, "SICHERN/SPIEL", "SICHERN/ENDEN", "WIDERRUFEN", "LOAD", false, false, false);
+ _dialog->dialogDraw(nullptr, nullptr, "SICHERN/SPIEL", "SICHERN/ENDEN", "WIDERRUFEN", "LOAD", false, false, false);
break;
case Common::FR_FRA:
- _dialog->f427_dialogDraw(nullptr, nullptr, "GARDER/JOUER", "GARDER/SORTIR", "ANNULLER", "LOAD", false, false, false);
+ _dialog->dialogDraw(nullptr, nullptr, "GARDER/JOUER", "GARDER/SORTIR", "ANNULLER", "LOAD", false, false, false);
break;
}
@@ -187,7 +187,7 @@ void DMEngine::f433_processCommand140_saveGame() {
kLoad = 4
};
- SaveAndPlayChoice saveAndPlayChoice = (SaveAndPlayChoice)_dialog->f424_dialogGetChoice(4, k0_DIALOG_SET_VIEWPORT, 0, k0_DIALOG_CHOICE_NONE);
+ SaveAndPlayChoice saveAndPlayChoice = (SaveAndPlayChoice)_dialog->getChoice(4, k0_DIALOG_SET_VIEWPORT, 0, k0_DIALOG_CHOICE_NONE);
if (saveAndPlayChoice == kLoad) {
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false);
@@ -212,13 +212,13 @@ void DMEngine::f433_processCommand140_saveGame() {
switch (getGameLanguage()) { // localized
default:
case Common::EN_ANY:
- _dialog->f427_dialogDraw(nullptr, "SAVING GAME . . .", nullptr, nullptr, nullptr, nullptr, false, false, false);
+ _dialog->dialogDraw(nullptr, "SAVING GAME . . .", nullptr, nullptr, nullptr, nullptr, false, false, false);
break;
case Common::DE_DEU:
- _dialog->f427_dialogDraw(nullptr, "SPIEL WIRD GESICHERT . . .", nullptr, nullptr, nullptr, nullptr, false, false, false);
+ _dialog->dialogDraw(nullptr, "SPIEL WIRD GESICHERT . . .", nullptr, nullptr, nullptr, nullptr, false, false, false);
break;
case Common::FR_FRA:
- _dialog->f427_dialogDraw(nullptr, "UN MOMENT A SAUVEGARDER DU JEU...", nullptr, nullptr, nullptr, nullptr, false, false, false);
+ _dialog->dialogDraw(nullptr, "UN MOMENT A SAUVEGARDER DU JEU...", nullptr, nullptr, nullptr, nullptr, false, false, false);
break;
}
@@ -229,8 +229,8 @@ void DMEngine::f433_processCommand140_saveGame() {
}
if (!writeCompleteSaveFile(saveSlot, saveDescription, saveAndPlayChoice)) {
- _dialog->f427_dialogDraw(nullptr, "Unable to open file for saving", "OK", nullptr, nullptr, nullptr, false, false, false);
- _dialog->f424_dialogGetChoice(1, k0_DIALOG_SET_VIEWPORT, 0, k0_DIALOG_CHOICE_NONE);
+ _dialog->dialogDraw(nullptr, "Unable to open file for saving", "OK", nullptr, nullptr, nullptr, false, false, false);
+ _dialog->getChoice(1, k0_DIALOG_SET_VIEWPORT, 0, k0_DIALOG_CHOICE_NONE);
}
if (!_championMan->_leaderEmptyHanded) {
@@ -243,10 +243,10 @@ void DMEngine::f433_processCommand140_saveGame() {
if (saveAndPlayChoice == kSaveAndQuit) {
_eventMan->f77_hideMouse();
- f444_endGame(false);
+ endGame(false);
}
- _g524_restartGameAllowed = true;
+ _restartGameAllowed = true;
_menuMan->f457_drawEnabledMenus();
_eventMan->f77_hideMouse();
}
@@ -302,11 +302,11 @@ bool DMEngine::writeCompleteSaveFile(int16 saveSlot, Common::String& saveDescrip
file->writeSint32BE(1); // save version
file->writeSint32BE(_gameVersion->_origSaveFormatToWrite);
file->writeSint32BE(_gameVersion->_origPlatformToWrite);
- file->writeSint32BE(_g525_gameId);
- file->writeUint16BE(_g526_dungeonId);
+ file->writeSint32BE(_gameId);
+ file->writeUint16BE(_dungeonId);
// write C0_SAVE_PART_GLOBAL_DATA part
- file->writeSint32BE(_g313_gameTime);
+ file->writeSint32BE(_gameTime);
//L1348_s_GlobalData.LastRandomNumber = G0349_ul_LastRandomNumber;
file->writeUint16BE(_championMan->_partyChampionCount);
file->writeSint16BE(_dungeonMan->_g306_partyMapX);
@@ -321,9 +321,9 @@ bool DMEngine::writeCompleteSaveFile(int16 saveSlot, Common::String& saveDescrip
file->writeUint16BE(_groupMan->_g377_currActiveGroupCount);
file->writeSint32BE(_projexpl->_g361_lastCreatureAttackTime);
file->writeSint32BE(_projexpl->_g362_lastPartyMovementTime);
- file->writeSint16BE(_g310_disabledMovementTicks);
- file->writeSint16BE(_g311_projectileDisableMovementTicks);
- file->writeSint16BE(_g312_lastProjectileDisabledMovementDirection);
+ file->writeSint16BE(_disabledMovementTicks);
+ file->writeSint16BE(_projectileDisableMovementTicks);
+ file->writeSint16BE(_lastProjectileDisabledMovementDirection);
file->writeUint16BE(_championMan->_leaderHandObject.toUint16());
file->writeUint16BE(_groupMan->_g376_maxActiveGroupCount);
diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp
index 69dff00b7e..e49c4ce6e9 100644
--- a/engines/dm/menus.cpp
+++ b/engines/dm/menus.cpp
@@ -129,7 +129,7 @@ void MenuMan::f388_clearActingChampion() {
cm._actingChampionOrdinal--;
cm._champions[cm._actingChampionOrdinal].setAttributeFlag(k0x8000_ChampionAttributeActionHand, true);
cm.drawChampionState((ChampionIndex)cm._actingChampionOrdinal);
- cm._actingChampionOrdinal = _vm->M0_indexToOrdinal(kM1_ChampionNone);
+ cm._actingChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone);
_g508_refreshActionArea = true;
}
}
@@ -215,7 +215,7 @@ void MenuMan::f390_refreshActionAreaAndSetChampDirMaxDamageReceived() {
do {
if ((champIndex != champMan._leaderIndex)
- && (_vm->M0_indexToOrdinal(champIndex) != champMan._actingChampionOrdinal)
+ && (_vm->indexToOrdinal(champIndex) != champMan._actingChampionOrdinal)
&& (champ->_maximumDamageReceived)
&& (champ->_dir != champ->_directionMaximumDamageReceived)) {
@@ -241,7 +241,7 @@ void MenuMan::f390_refreshActionAreaAndSetChampDirMaxDamageReceived() {
} else {
_g509_actionAreaContainsIcons = false;
champ->setAttributeFlag(k0x8000_ChampionAttributeActionHand, true);
- champMan.drawChampionState((ChampionIndex)_vm->M1_ordinalToIndex(champMan._actingChampionOrdinal));
+ champMan.drawChampionState((ChampionIndex)_vm->ordinalToIndex(champMan._actingChampionOrdinal));
f387_drawActionArea();
}
}
@@ -270,7 +270,7 @@ void MenuMan::f387_drawActionArea() {
dispMan.f21_blitToScreen(_vm->_displayMan->f489_getNativeBitmapOrGraphic(k10_MenuActionAreaIndice),
&box, k48_byteWidth, kM1_ColorNoTransparency, 45);
textMan.f41_printWithTrailingSpaces(dispMan._g348_bitmapScreen, k160_byteWidthScreen,
- 235, 83, k0_ColorBlack, k4_ColorCyan, champMan._champions[_vm->M1_ordinalToIndex(champMan._actingChampionOrdinal)]._name,
+ 235, 83, k0_ColorBlack, k4_ColorCyan, champMan._champions[_vm->ordinalToIndex(champMan._actingChampionOrdinal)]._name,
k7_ChampionNameMaximumLength, k200_heightScreen);
for (uint16 actionListIndex = 0; actionListIndex < 3; actionListIndex++) {
textMan.f41_printWithTrailingSpaces(dispMan._g348_bitmapScreen, k160_byteWidthScreen, 241, 93 + actionListIndex * 12, k4_ColorCyan, k0_ColorBlack,
@@ -446,8 +446,8 @@ void MenuMan::f457_drawEnabledMenus() {
f387_drawActionArea();
AL1462_i_InventoryChampionOrdinal = _vm->_inventoryMan->_g432_inventoryChampionOrdinal;
if (AL1462_i_InventoryChampionOrdinal) {
- _vm->_inventoryMan->_g432_inventoryChampionOrdinal = _vm->M0_indexToOrdinal(kM1_ChampionNone);
- _vm->_inventoryMan->f355_toggleInventory((ChampionIndex)_vm->M1_ordinalToIndex(AL1462_i_InventoryChampionOrdinal));
+ _vm->_inventoryMan->_g432_inventoryChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone);
+ _vm->_inventoryMan->f355_toggleInventory((ChampionIndex)_vm->ordinalToIndex(AL1462_i_InventoryChampionOrdinal));
} else {
_vm->_displayMan->f98_drawFloorAndCeiling();
f395_drawMovementArrows();
@@ -510,7 +510,7 @@ int16 MenuMan::f412_getChampionSpellCastResult(uint16 champIndex) {
}
L1268_i_PowerSymbolOrdinal = L1270_ps_Champion->_symbols[0] - '_'; /* Values 1 to 6 */
AL1269_ui_RequiredSkillLevel = L1271_ps_Spell->_baseRequiredSkillLevel + L1268_i_PowerSymbolOrdinal;
- L1273_ui_Experience = _vm->getRandomNumber(8) + (AL1269_ui_RequiredSkillLevel << 4) + ((_vm->M1_ordinalToIndex(L1268_i_PowerSymbolOrdinal) * L1271_ps_Spell->_baseRequiredSkillLevel) << 3) + (AL1269_ui_RequiredSkillLevel * AL1269_ui_RequiredSkillLevel);
+ L1273_ui_Experience = _vm->getRandomNumber(8) + (AL1269_ui_RequiredSkillLevel << 4) + ((_vm->ordinalToIndex(L1268_i_PowerSymbolOrdinal) * L1271_ps_Spell->_baseRequiredSkillLevel) << 3) + (AL1269_ui_RequiredSkillLevel * AL1269_ui_RequiredSkillLevel);
AL1267_ui_SkillLevel = _vm->_championMan->getSkillLevel(champIndex, L1271_ps_Spell->_skillIndex);
if (AL1267_ui_SkillLevel < AL1269_ui_RequiredSkillLevel) {
L1274_i_MissingSkillLevelCount = AL1269_ui_RequiredSkillLevel - AL1267_ui_SkillLevel;
@@ -533,7 +533,7 @@ int16 MenuMan::f412_getChampionSpellCastResult(uint16 champIndex) {
L1275_ps_Potion->setPower(_vm->getRandomNumber(16) + (L1268_i_PowerSymbolOrdinal * 40));
L1270_ps_Champion->_load += _vm->_dungeonMan->f140_getObjectWeight(L1272_T_Object) - AL1269_ui_EmptyFlaskWeight;
_vm->_championMan->drawChangedObjectIcons();
- if (_vm->_inventoryMan->_g432_inventoryChampionOrdinal == _vm->M0_indexToOrdinal(champIndex)) {
+ if (_vm->_inventoryMan->_g432_inventoryChampionOrdinal == _vm->indexToOrdinal(champIndex)) {
setFlag(L1270_ps_Champion->_attributes, k0x0200_ChampionAttributeLoad);
_vm->_championMan->drawChampionState((ChampionIndex)champIndex);
}
@@ -547,7 +547,7 @@ int16 MenuMan::f412_getChampionSpellCastResult(uint16 champIndex) {
if (L1271_ps_Spell->getType() == k4_spellType_projectileOpenDoor) {
AL1267_ui_SkillLevel <<= 1;
}
- _vm->_championMan->isProjectileSpellCast(champIndex, Thing(L1271_ps_Spell->getType() + Thing::_firstExplosion.toUint16()), f26_getBoundedValue(21, (L1268_i_PowerSymbolOrdinal + 2) * (4 + (AL1267_ui_SkillLevel << 1)), 255), 0);
+ _vm->_championMan->isProjectileSpellCast(champIndex, Thing(L1271_ps_Spell->getType() + Thing::_firstExplosion.toUint16()), getBoundedValue(21, (L1268_i_PowerSymbolOrdinal + 2) * (4 + (AL1267_ui_SkillLevel << 1)), 255), 0);
break;
case k3_spellKindOther:
L1276_s_Event._priority = 0;
@@ -601,7 +601,7 @@ T0412019:
T0412032:
AL1267_ui_Ticks = AL1267_ui_SpellPower * AL1267_ui_SpellPower;
T0412033:
- M33_setMapAndTime(L1276_s_Event._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_g313_gameTime + AL1267_ui_Ticks);
+ setMapAndTime(L1276_s_Event._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_gameTime + AL1267_ui_Ticks);
_vm->_timeline->f238_addEventGetEventIndex(&L1276_s_Event);
break;
case k7_spellType_otherZokathra:
@@ -752,7 +752,7 @@ void MenuMan::f404_createEvent70_light(int16 lightPower, int16 ticks) {
L1241_s_Event._type = k70_TMEventTypeLight;
L1241_s_Event._B._lightPower = lightPower;
- M33_setMapAndTime(L1241_s_Event._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_g313_gameTime + ticks);
+ setMapAndTime(L1241_s_Event._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_gameTime + ticks);
L1241_s_Event._priority = 0;
_vm->_timeline->f238_addEventGetEventIndex(&L1241_s_Event);
_vm->_inventoryMan->f337_setDungeonViewPalette();
@@ -791,7 +791,7 @@ bool MenuMan::f403_isPartySpellOrFireShieldSuccessful(Champion* champ, bool spel
_vm->_championMan->_party._fireShieldDefense += L1240_s_Event._B._defense;
}
L1240_s_Event._priority = 0;
- M33_setMapAndTime(L1240_s_Event._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_g313_gameTime + ticks);
+ setMapAndTime(L1240_s_Event._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_gameTime + ticks);
_vm->_timeline->f238_addEventGetEventIndex(&L1240_s_Event);
_vm->_timeline->f260_timelineRefreshAllChampionStatusBoxes();
return L1239_B_IsPartySpellOrFireShieldSuccessful;
@@ -891,7 +891,7 @@ bool MenuMan::f391_didClickTriggerAction(int16 actionListIndex) {
if (!_vm->_championMan->_actingChampionOrdinal || (actionListIndex != -1 && (_g713_actionList._actionIndices[actionListIndex] == k255_ChampionActionNone)))
return false;
- L1199_ps_Champion = &_vm->_championMan->_champions[L1196_ui_ChampionIndex = _vm->M1_ordinalToIndex(_vm->_championMan->_actingChampionOrdinal)];
+ L1199_ps_Champion = &_vm->_championMan->_champions[L1196_ui_ChampionIndex = _vm->ordinalToIndex(_vm->_championMan->_actingChampionOrdinal)];
if (actionListIndex == -1) {
// L1198_B_ClickTriggeredAction is set to -1 since booleans are stored in int16 in the original
L1198_B_ClickTriggeredAction = true;
@@ -1273,7 +1273,7 @@ T0407032:
AL1246_i_Ticks = _vm->getRandomNumber(_vm->_championMan->getSkillLevel(champIndex, L1254_i_ActionSkillIndex) + 8) + 5;
L1258_s_Event._priority = 0;
L1258_s_Event._type = k73_TMEventTypeThievesEye;
- M33_setMapAndTime(L1258_s_Event._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_g313_gameTime + AL1246_i_Ticks);
+ setMapAndTime(L1258_s_Event._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_gameTime + AL1246_i_Ticks);
_vm->_timeline->f238_addEventGetEventIndex(&L1258_s_Event);
_vm->_championMan->_party._event73Count_ThievesEye++;
goto T0407076;
@@ -1318,7 +1318,7 @@ T0407076:
f406_setChampionDirectionToPartyDirection(L1247_ps_Champion);
AL1245_B_ActionPerformed = _vm->_championMan->isObjectThrown(champIndex, k1_ChampionSlotActionHand, (L1247_ps_Champion->_cell == returnNextVal(_vm->_dungeonMan->_g308_partyDir)) || (L1247_ps_Champion->_cell == (ViewCell)returnOppositeDir(_vm->_dungeonMan->_g308_partyDir)));
if (AL1245_B_ActionPerformed) {
- _vm->_timeline->_g370_events[L1247_ps_Champion->_enableActionEventIndex]._B._slotOrdinal = _vm->M0_indexToOrdinal(k1_ChampionSlotActionHand);
+ _vm->_timeline->_g370_events[L1247_ps_Champion->_enableActionEventIndex]._B._slotOrdinal = _vm->indexToOrdinal(k1_ChampionSlotActionHand);
}
}
if (L1249_ui_ActionDisabledTicks) {
@@ -1474,14 +1474,14 @@ bool MenuMan::f402_isMeleeActionPerformed(int16 champIndex, Champion* champ, int
goto T0402010;
L1238_i_CreatureOrdinal = _vm->_groupMan->f177_getMeleeTargetCreatureOrdinal(targetMapX, targetMapY, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, AL1236_ui_ChampionCell = champ->_cell);
if (L1238_i_CreatureOrdinal) {
- switch (M21_normalizeModulo4(AL1236_ui_ChampionCell + 4 - champ->_dir)) {
+ switch (normalizeModulo4(AL1236_ui_ChampionCell + 4 - champ->_dir)) {
case k2_ViewCellBackRight: /* Champion is on the back right of the square and tries to attack a creature in the front right of its square */
AL1237_ui_CellDelta = 3;
goto T0402005;
case k3_ViewCellBackLeft: /* Champion is on the back left of the square and tries to attack a creature in the front left of its square */
AL1237_ui_CellDelta = 1;
T0402005: /* Check if there is another champion in front */
- if (_vm->_championMan->getIndexInCell(M21_normalizeModulo4(AL1236_ui_ChampionCell + AL1237_ui_CellDelta)) != kM1_ChampionNone) {
+ if (_vm->_championMan->getIndexInCell(normalizeModulo4(AL1236_ui_ChampionCell + AL1237_ui_CellDelta)) != kM1_ChampionNone) {
_g513_actionDamage = kM1_damageCantReach;
goto T0402010;
}
@@ -1493,7 +1493,7 @@ T0402005: /* Check if there is another champion in front */
if ((_vm->_objectMan->f33_getIconIndex(champ->_slots[k1_ChampionSlotActionHand]) == k40_IconIndiceWeaponVorpalBlade) || (actionIndex == k24_ChampionActionDisrupt)) {
setFlag(AL1237_ui_ActionHitProbability, k0x8000_hitNonMaterialCreatures);
}
- _g513_actionDamage = _vm->_groupMan->f231_getMeleeActionDamage(champ, champIndex, (Group*)_vm->_dungeonMan->f156_getThingData(_g517_actionTargetGroupThing), _vm->M1_ordinalToIndex(L1238_i_CreatureOrdinal), targetMapX, targetMapY, AL1237_ui_ActionHitProbability, AL1236_ui_ActionDamageFactor, skillIndex);
+ _g513_actionDamage = _vm->_groupMan->f231_getMeleeActionDamage(champ, champIndex, (Group*)_vm->_dungeonMan->f156_getThingData(_g517_actionTargetGroupThing), _vm->ordinalToIndex(L1238_i_CreatureOrdinal), targetMapX, targetMapY, AL1237_ui_ActionHitProbability, AL1236_ui_ActionDamageFactor, skillIndex);
return true;
}
T0402010:
@@ -1570,7 +1570,7 @@ void MenuMan::f381_printMessageAfterReplacements(const char* str) {
}
switch (*str) {
case 'p': /* '@p' in the source string is replaced by the champion name followed by a space */
- L1165_pc_ReplacementString = _vm->_championMan->_champions[_vm->M1_ordinalToIndex(_vm->_championMan->_actingChampionOrdinal)]._name;
+ L1165_pc_ReplacementString = _vm->_championMan->_champions[_vm->ordinalToIndex(_vm->_championMan->_actingChampionOrdinal)]._name;
}
*L1164_pc_Character = '\0';
strcat(L1166_ac_OutputString, L1165_pc_ReplacementString);
@@ -1649,7 +1649,7 @@ void MenuMan::f389_processCommands116To119_setActingChampion(uint16 champIndex)
return;
}
L1191_ps_ActionSet = &G0489_as_Graphic560_ActionSets[L1188_ui_ActionSetIndex];
- _vm->_championMan->_actingChampionOrdinal = _vm->M0_indexToOrdinal(champIndex);
+ _vm->_championMan->_actingChampionOrdinal = _vm->indexToOrdinal(champIndex);
f383_setActionList(L1191_ps_ActionSet);
_g509_actionAreaContainsIcons = false;
setFlag(L1190_ps_Champion->_attributes, k0x8000_ChampionAttributeActionHand);
@@ -1676,7 +1676,7 @@ void MenuMan::f383_setActionList(ActionSet* actionSet) {
if (getFlag(L1172_ui_MinimumSkillLevel = actionSet->_actionProperties[L1169_ui_ActionListIndex - 1], k0x0080_actionRequiresCharge) && !f382_getActionObjectChargeCount())
continue;
clearFlag(L1172_ui_MinimumSkillLevel, k0x0080_actionRequiresCharge);
- if (_vm->_championMan->getSkillLevel(_vm->M1_ordinalToIndex(_vm->_championMan->_actingChampionOrdinal), g496_ActionSkillIndex[L1171_ui_ActionIndex]) >= L1172_ui_MinimumSkillLevel) {
+ if (_vm->_championMan->getSkillLevel(_vm->ordinalToIndex(_vm->_championMan->_actingChampionOrdinal), g496_ActionSkillIndex[L1171_ui_ActionIndex]) >= L1172_ui_MinimumSkillLevel) {
_g713_actionList._actionIndices[L1170_ui_NextAvailableActionListIndex] = (ChampionAction)L1171_ui_ActionIndex;
_g713_actionList._minimumSkillLevel[L1170_ui_NextAvailableActionListIndex] = L1172_ui_MinimumSkillLevel;
L1170_ui_NextAvailableActionListIndex++;
@@ -1693,7 +1693,7 @@ int16 MenuMan::f382_getActionObjectChargeCount() {
Junk* L1168_ps_Junk;
- L1168_ps_Junk = (Junk*)_vm->_dungeonMan->f156_getThingData(L1167_T_Thing = _vm->_championMan->_champions[_vm->M1_ordinalToIndex(_vm->_championMan->_actingChampionOrdinal)]._slots[k1_ChampionSlotActionHand]);
+ L1168_ps_Junk = (Junk*)_vm->_dungeonMan->f156_getThingData(L1167_T_Thing = _vm->_championMan->_champions[_vm->ordinalToIndex(_vm->_championMan->_actingChampionOrdinal)]._slots[k1_ChampionSlotActionHand]);
switch (L1167_T_Thing.getType()) {
case k5_WeaponThingType:
return ((Weapon*)L1168_ps_Junk)->getChargeCount();
diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp
index 747e8ef284..b24a997549 100644
--- a/engines/dm/movesens.cpp
+++ b/engines/dm/movesens.cpp
@@ -147,7 +147,7 @@ bool MovesensMan::f275_sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, ui
if ((_vm->_objectMan->f32_getObjectType(L0761_T_LeaderHandObject) != L0758_i_SensorData) || (f273_sensorGetObjectOfTypeInCell(mapX, mapY, L0752_ui_Cell, L0758_i_SensorData) != Thing::_none))
goto T0275058_ProceedToNextThing;
_vm->_championMan->getObjectRemovedFromLeaderHand();
- _vm->_dungeonMan->f163_linkThingToList(M15_thingWithNewCell(L0761_T_LeaderHandObject, L0752_ui_Cell), Thing(0), mapX, mapY);
+ _vm->_dungeonMan->f163_linkThingToList(thingWithNewCell(L0761_T_LeaderHandObject, L0752_ui_Cell), Thing(0), mapX, mapY);
L0761_T_LeaderHandObject = Thing::_none;
}
f270_sensorTriggetLocalEffect(k2_SensorEffToggle, mapX, mapY, L0752_ui_Cell); /* This will cause a rotation of the sensors at the specified cell on the specified square after all sensors have been processed */
@@ -165,7 +165,7 @@ bool MovesensMan::f275_sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, ui
goto T0275058_ProceedToNextThing;
_vm->_dungeonMan->f164_unlinkThingFromList(L0762_T_ThingOnSquare, Thing(0), mapX, mapY);
_vm->_championMan->getObjectRemovedFromLeaderHand();
- _vm->_dungeonMan->f163_linkThingToList(M15_thingWithNewCell(L0761_T_LeaderHandObject, L0752_ui_Cell), Thing(0), mapX, mapY);
+ _vm->_dungeonMan->f163_linkThingToList(thingWithNewCell(L0761_T_LeaderHandObject, L0752_ui_Cell), Thing(0), mapX, mapY);
_vm->_championMan->putObjectInLeaderHand(L0762_T_ThingOnSquare, true);
L0753_B_DoNotTriggerSensor = false;
break;
@@ -306,7 +306,7 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16
if (L0712_ps_Teleporter->getAbsoluteRotation()) {
_vm->_championMan->setPartyDirection(L0712_ps_Teleporter->getRotation());
} else {
- _vm->_championMan->setPartyDirection(M21_normalizeModulo4(_vm->_dungeonMan->_g308_partyDir + L0712_ps_Teleporter->getRotation()));
+ _vm->_championMan->setPartyDirection(normalizeModulo4(_vm->_dungeonMan->_g308_partyDir + L0712_ps_Teleporter->getRotation()));
}
} else {
if (L0710_i_ThingType == k4_GroupThingType) {
@@ -319,7 +319,7 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16
thing = f263_getTeleporterRotatedProjectileThing(L0712_ps_Teleporter, thing);
} else {
if (!(L0712_ps_Teleporter->getAbsoluteRotation()) && (mapX != -2)) {
- thing = M15_thingWithNewCell(thing, M21_normalizeModulo4(thing.getCell() + L0712_ps_Teleporter->getRotation()));
+ thing = thingWithNewCell(thing, normalizeModulo4(thing.getCell() + L0712_ps_Teleporter->getRotation()));
}
}
}
@@ -381,8 +381,8 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16
destMapX += _vm->_dirIntoStepCountEast[L0716_ui_Direction], destMapY += _vm->_dirIntoStepCountNorth[L0716_ui_Direction];
L0716_ui_Direction = returnOppositeDir((Direction)L0716_ui_Direction);
AL0727_ui_ThingCell = thing.getCell();
- AL0727_ui_ThingCell = M21_normalizeModulo4((((AL0727_ui_ThingCell - L0716_ui_Direction + 1) & 0x0002) >> 1) + L0716_ui_Direction);
- thing = M15_thingWithNewCell(thing, AL0727_ui_ThingCell);
+ AL0727_ui_ThingCell = normalizeModulo4((((AL0727_ui_ThingCell - L0716_ui_Direction + 1) & 0x0002) >> 1) + L0716_ui_Direction);
+ thing = thingWithNewCell(thing, AL0727_ui_ThingCell);
} else
break;
}
@@ -421,9 +421,9 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16
AL0708_i_ScentIndex--;
}
if (AL0708_i_ScentIndex) {
- _vm->_championMan->addScentStrength(mapX, mapY, (int)(_vm->_g313_gameTime - _vm->_projexpl->_g362_lastPartyMovementTime));
+ _vm->_championMan->addScentStrength(mapX, mapY, (int)(_vm->_gameTime - _vm->_projexpl->_g362_lastPartyMovementTime));
}
- _vm->_projexpl->_g362_lastPartyMovementTime = _vm->_g313_gameTime;
+ _vm->_projexpl->_g362_lastPartyMovementTime = _vm->_gameTime;
_vm->_championMan->_party._scentCount++;
if (_vm->_championMan->_party._event79Count_Footprints) {
_vm->_championMan->_party._lastScentIndex = _vm->_championMan->_party._scentCount;
@@ -462,7 +462,7 @@ bool MovesensMan::f267_getMoveResult(Thing thing, int16 mapX, int16 mapY, int16
f276_sensorProcessThingAdditionOrRemoval(_vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, Thing::_party, L0725_B_PartySquare, true);
} else {
_vm->_dungeonMan->f173_setCurrentMap(L0714_ui_MapIndexSource);
- _vm->_g327_newPartyMapIndex = L0715_ui_MapIndexDestination;
+ _vm->_newPartyMapIndex = L0715_ui_MapIndexDestination;
}
} else {
if (L0710_i_ThingType == k4_GroupThingType) {
@@ -567,7 +567,7 @@ bool MovesensMan::f266_moveIsKilledByProjectileImpact(int16 srcMapX, int16 srcMa
L0702_i_ImpactType = kM2_ChampionElemType;
for (AL0699_ui_Cell = k0_CellNorthWest; AL0699_ui_Cell < k3_CellSouthWest + 1; AL0699_ui_Cell++) {
if (_vm->_championMan->getIndexInCell((ViewCell)AL0699_ui_Cell) >= 0) {
- L0707_auc_ChampionOrCreatureOrdinalInCell[AL0699_ui_Cell] = _vm->M0_indexToOrdinal(AL0699_ui_Cell);
+ L0707_auc_ChampionOrCreatureOrdinalInCell[AL0699_ui_Cell] = _vm->indexToOrdinal(AL0699_ui_Cell);
}
}
} else {
@@ -576,7 +576,7 @@ bool MovesensMan::f266_moveIsKilledByProjectileImpact(int16 srcMapX, int16 srcMa
for (AL0699_ui_Cell = k0_CellNorthWest, AL0700_B_CreatureAlive = false; AL0699_ui_Cell < k3_CellSouthWest + 1; AL0699_ui_Cell++) {
AL0700_B_CreatureAlive |= L0701_ps_Group->_health[AL0699_ui_Cell];
if (_vm->_groupMan->f176_getCreatureOrdinalInCell(L0701_ps_Group, AL0699_ui_Cell)) {
- L0707_auc_ChampionOrCreatureOrdinalInCell[AL0699_ui_Cell] = _vm->M0_indexToOrdinal(AL0699_ui_Cell);
+ L0707_auc_ChampionOrCreatureOrdinalInCell[AL0699_ui_Cell] = _vm->indexToOrdinal(AL0699_ui_Cell);
}
}
if (!AL0700_B_CreatureAlive) {
@@ -612,7 +612,7 @@ T0266017_CheckProjectileImpacts:
while (L0697_T_Thing != Thing::_endOfList) {
if (((L0697_T_Thing).getType() == k14_ProjectileThingType) &&
(_vm->_timeline->_g370_events[(((Projectile *)_vm->_dungeonMan->_g284_thingData[k14_ProjectileThingType])[(L0697_T_Thing).getIndex()])._eventIndex]._type != k48_TMEventTypeMoveProjectileIgnoreImpacts) && (AL0699_ui_ChampionOrCreatureOrdinal = L0707_auc_ChampionOrCreatureOrdinalInCell[(L0697_T_Thing).getCell()]) &&
- _vm->_projexpl->f217_projectileHasImpactOccurred(L0702_i_ImpactType, srcMapX, srcMapY, _vm->M1_ordinalToIndex(AL0699_ui_ChampionOrCreatureOrdinal), L0697_T_Thing)) {
+ _vm->_projexpl->f217_projectileHasImpactOccurred(L0702_i_ImpactType, srcMapX, srcMapY, _vm->ordinalToIndex(AL0699_ui_ChampionOrCreatureOrdinal), L0697_T_Thing)) {
_vm->_projexpl->f214_projectileDeleteEvent(L0697_T_Thing);
if (_vm->_projexpl->_g364_creatureDamageOutcome == k2_outcomeKilledAllCreaturesInGroup) {
return true;
@@ -635,7 +635,7 @@ T0266017_CheckProjectileImpacts:
void MovesensMan::f268_addEvent(byte type, byte mapX, byte mapY, byte cell, byte effect, int32 time) {
TimelineEvent L0729_s_Event;
- M33_setMapAndTime(L0729_s_Event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, time);
+ setMapAndTime(L0729_s_Event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, time);
L0729_s_Event._type = type;
L0729_s_Event._priority = 0;
L0729_s_Event._B._location._mapX = mapX;
@@ -710,23 +710,23 @@ int16 MovesensMan::f262_getTeleporterRotatedGroupResult(Teleporter* teleporter,
if (L0689_B_AbsoluteRotation) {
L0685_ui_UpdatedGroupDirections = L0683_i_Rotation;
} else {
- L0685_ui_UpdatedGroupDirections = M21_normalizeModulo4(L0684_ui_GroupDirections + L0683_i_Rotation);
+ L0685_ui_UpdatedGroupDirections = normalizeModulo4(L0684_ui_GroupDirections + L0683_i_Rotation);
}
L0687_ui_UpdatedGroupCells = _vm->_groupMan->f145_getGroupCells(L0686_ps_Group, mapIndex);
if (L0687_ui_UpdatedGroupCells != k255_CreatureTypeSingleCenteredCreature) {
L0690_ui_GroupCells = L0687_ui_UpdatedGroupCells;
L0691_i_CreatureSize = getFlag(g243_CreatureInfo[L0686_ps_Group->_type]._attributes, k0x0003_MaskCreatureInfo_size);
- L0692_i_RelativeRotation = M21_normalizeModulo4(4 + L0685_ui_UpdatedGroupDirections - L0684_ui_GroupDirections);
+ L0692_i_RelativeRotation = normalizeModulo4(4 + L0685_ui_UpdatedGroupDirections - L0684_ui_GroupDirections);
for (L0688_i_CreatureIndex = 0; L0688_i_CreatureIndex <= L0686_ps_Group->getCount(); L0688_i_CreatureIndex++) {
- L0685_ui_UpdatedGroupDirections = _vm->_groupMan->f178_getGroupValueUpdatedWithCreatureValue(L0685_ui_UpdatedGroupDirections, L0688_i_CreatureIndex, L0689_B_AbsoluteRotation ? L0683_i_Rotation : M21_normalizeModulo4(L0684_ui_GroupDirections + L0683_i_Rotation));
+ L0685_ui_UpdatedGroupDirections = _vm->_groupMan->f178_getGroupValueUpdatedWithCreatureValue(L0685_ui_UpdatedGroupDirections, L0688_i_CreatureIndex, L0689_B_AbsoluteRotation ? L0683_i_Rotation : normalizeModulo4(L0684_ui_GroupDirections + L0683_i_Rotation));
if (L0691_i_CreatureSize == k0_MaskCreatureSizeQuarter) {
L0692_i_RelativeRotation = !L0689_B_AbsoluteRotation;
if (L0692_i_RelativeRotation)
L0692_i_RelativeRotation = L0683_i_Rotation;
}
if (L0692_i_RelativeRotation) {
- L0687_ui_UpdatedGroupCells = _vm->_groupMan->f178_getGroupValueUpdatedWithCreatureValue(L0687_ui_UpdatedGroupCells, L0688_i_CreatureIndex, M21_normalizeModulo4(L0690_ui_GroupCells + L0692_i_RelativeRotation));
+ L0687_ui_UpdatedGroupCells = _vm->_groupMan->f178_getGroupValueUpdatedWithCreatureValue(L0687_ui_UpdatedGroupCells, L0688_i_CreatureIndex, normalizeModulo4(L0690_ui_GroupCells + L0692_i_RelativeRotation));
}
L0684_ui_GroupDirections >>= 2;
L0690_ui_GroupCells >>= 2;
@@ -749,8 +749,8 @@ Thing MovesensMan::f263_getTeleporterRotatedProjectileThing(Teleporter* teleport
if (teleporter->getAbsoluteRotation()) {
L0693_i_UpdatedDirection = L0694_i_Rotation;
} else {
- L0693_i_UpdatedDirection = M21_normalizeModulo4(L0693_i_UpdatedDirection + L0694_i_Rotation);
- projectileThing = M15_thingWithNewCell(projectileThing, M21_normalizeModulo4((projectileThing).getCell() + L0694_i_Rotation));
+ L0693_i_UpdatedDirection = normalizeModulo4(L0693_i_UpdatedDirection + L0694_i_Rotation);
+ projectileThing = thingWithNewCell(projectileThing, normalizeModulo4((projectileThing).getCell() + L0694_i_Rotation));
}
_g400_moveResultDir = L0693_i_UpdatedDirection;
return projectileThing;
@@ -798,8 +798,8 @@ void MovesensMan::f276_sensorProcessThingAdditionOrRemoval(uint16 mapX, uint16 m
L0773_B_SquareContainsGroup = true;
} else {
if ((L0771_ui_ThingType == k2_TextstringType) && (L0767_i_ThingType == kM1_PartyThingType) && addThing && !partySquare) {
- _vm->_dungeonMan->f168_decodeText(_vm->_g353_stringBuildBuffer, L0766_T_Thing, k1_TextTypeMessage);
- _vm->_textMan->f47_messageAreaPrintMessage(k15_ColorWhite, _vm->_g353_stringBuildBuffer);
+ _vm->_dungeonMan->f168_decodeText(_vm->_stringBuildBuffer, L0766_T_Thing, k1_TextTypeMessage);
+ _vm->_textMan->f47_messageAreaPrintMessage(k15_ColorWhite, _vm->_stringBuildBuffer);
} else {
if ((L0771_ui_ThingType > k4_GroupThingType) && (L0771_ui_ThingType < k14_ProjectileThingType)) {
L0772_B_SquareContainsObject = true;
@@ -852,7 +852,7 @@ void MovesensMan::f276_sensorProcessThingAdditionOrRemoval(uint16 mapX, uint16 m
if (!addThing) {
L0768_B_TriggerSensor = false;
} else {
- L0768_B_TriggerSensor = (L0779_i_SensorData == _vm->M0_indexToOrdinal(_vm->_dungeonMan->_g308_partyDir));
+ L0768_B_TriggerSensor = (L0779_i_SensorData == _vm->indexToOrdinal(_vm->_dungeonMan->_g308_partyDir));
}
}
break;
@@ -988,7 +988,7 @@ void MovesensMan::f272_sensorTriggerEffect(Sensor* sensor, int16 effect, int16 m
if (sensor->getOnlyOnce()) {
sensor->setTypeDisabled();
}
- L0738_l_Time = _vm->_g313_gameTime + sensor->getValue();
+ L0738_l_Time = _vm->_gameTime + sensor->getValue();
if (sensor->getLocalEffect()) {
f270_sensorTriggetLocalEffect(sensor->M49_localEffect(), mapX, mapY, cell);
} else {
@@ -1074,7 +1074,7 @@ void MovesensMan::f271_processRotationEffect() {
void MovesensMan::f265_createEvent60to61_moveGroup(Thing groupThing, int16 mapX, int16 mapY, int16 mapIndex, bool audible) {
TimelineEvent L0696_s_Event;
- M33_setMapAndTime(L0696_s_Event._mapTime, mapIndex, _vm->_g313_gameTime + 5);
+ setMapAndTime(L0696_s_Event._mapTime, mapIndex, _vm->_gameTime + 5);
L0696_s_Event._type = audible ? k61_TMEventTypeMoveGroupAudible : k60_TMEventTypeMoveGroupSilent;
L0696_s_Event._priority = 0;
L0696_s_Event._B._location._mapX = mapX;
diff --git a/engines/dm/projexpl.cpp b/engines/dm/projexpl.cpp
index 7600bafd66..7eee98a100 100644
--- a/engines/dm/projexpl.cpp
+++ b/engines/dm/projexpl.cpp
@@ -55,13 +55,13 @@ void ProjExpl::f212_projectileCreate(Thing thing, int16 mapX, int16 mapY, uint16
if ((L0466_T_ProjectileThing = _vm->_dungeonMan->f166_getUnusedThing(k14_ProjectileThingType)) == Thing::_none) { /* BUG0_16 If the game cannot create a projectile thing because it has run out of such things (60 maximum) then the object being thrown/shot/launched is orphaned. If the game has run out of projectile things it will try to remove a projectile from elsewhere in the dungeon, except in an area of 11x11 squares centered around the party (to make sure the player cannot actually see the thing disappear on screen) */
return;
}
- L0466_T_ProjectileThing = M15_thingWithNewCell(L0466_T_ProjectileThing, cell);
+ L0466_T_ProjectileThing = thingWithNewCell(L0466_T_ProjectileThing, cell);
L0467_ps_Projectile = (Projectile *)_vm->_dungeonMan->f156_getThingData(L0466_T_ProjectileThing);
L0467_ps_Projectile->_slot = thing;
L0467_ps_Projectile->_kineticEnergy = MIN((int16)kineticEnergy, (int16)255);
L0467_ps_Projectile->_attack = attack;
_vm->_dungeonMan->f163_linkThingToList(L0466_T_ProjectileThing, Thing(0), mapX, mapY); /* Projectiles are added on the square and not 'moved' onto the square. In the case of a projectile launcher sensor, this means that the new projectile traverses the square in front of the launcher without any trouble: there is no impact if it is a wall, the projectile direction is not changed if it is a teleporter. Impacts with creatures and champions are still processed */
- M33_setMapAndTime(L0468_s_Event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, _vm->_g313_gameTime + 1);
+ setMapAndTime(L0468_s_Event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, _vm->_gameTime + 1);
if (_g365_createLanucherProjectile) {
L0468_s_Event._type = k49_TMEventTypeMoveProjectile; /* Launcher projectiles can impact immediately */
} else {
@@ -152,7 +152,7 @@ T0217004:
L0494_ps_Door = (Door *)_vm->_dungeonMan->f157_getSquareFirstThingData(AP0454_i_ProjectileTargetMapX, AP0455_i_ProjectileTargetMapY);
if ((AL0487_i_DoorState != k5_doorState_DESTROYED) && (L0486_T_ProjectileAssociatedThing == Thing::_explOpenDoor)) {
if (L0494_ps_Door->hasButton()) {
- _vm->_moveSens->f268_addEvent(k10_TMEventTypeDoor, AP0454_i_ProjectileTargetMapX, AP0455_i_ProjectileTargetMapY, 0, k2_SensorEffToggle, _vm->_g313_gameTime + 1);
+ _vm->_moveSens->f268_addEvent(k10_TMEventTypeDoor, AP0454_i_ProjectileTargetMapX, AP0455_i_ProjectileTargetMapY, 0, k2_SensorEffToggle, _vm->_gameTime + 1);
}
break;
}
@@ -321,7 +321,7 @@ void ProjExpl::f213_explosionCreate(Thing explThing, uint16 attack, uint16 mapXC
L0470_ps_Explosion->setCentered(true);
} else {
L0470_ps_Explosion->setCentered(false);
- L0473_T_Thing = M15_thingWithNewCell(L0473_T_Thing, cell);
+ L0473_T_Thing = thingWithNewCell(L0473_T_Thing, cell);
}
L0470_ps_Explosion->setType(explThing.toUint16() - Thing::_firstExplosion.toUint16());
L0470_ps_Explosion->setAttack(attack);
@@ -334,7 +334,7 @@ void ProjExpl::f213_explosionCreate(Thing explThing, uint16 attack, uint16 mapXC
}
_vm->_dungeonMan->f163_linkThingToList(L0473_T_Thing, Thing(0), AP0443_ui_ProjectileMapX, AP0444_ui_ProjectileMapY);
TimelineEvent L0476_s_Event;
- M33_setMapAndTime(L0476_s_Event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, _vm->_g313_gameTime + ((explThing == Thing::_explRebirthStep1) ? 5 : 1));
+ setMapAndTime(L0476_s_Event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, _vm->_gameTime + ((explThing == Thing::_explRebirthStep1) ? 5 : 1));
L0476_s_Event._type = k25_TMEventTypeExplosion;
L0476_s_Event._priority = 0;
L0476_s_Event._C._slot = L0473_T_Thing.toUint16();
@@ -487,13 +487,13 @@ void ProjExpl::f219_processEvents48To49_projectile(TimelineEvent* event) {
} else {
L0518_ui_Cell++;
}
- L0515_T_ProjectileThingNewCell = M15_thingWithNewCell(L0515_T_ProjectileThingNewCell, L0518_ui_Cell &= 0x0003);
+ L0515_T_ProjectileThingNewCell = thingWithNewCell(L0515_T_ProjectileThingNewCell, L0518_ui_Cell &= 0x0003);
if (L0522_B_ProjectileMovesToOtherSquare) {
_vm->_moveSens->f267_getMoveResult(L0515_T_ProjectileThingNewCell, L0525_i_SourceMapX, L0526_i_SourceMapY, L0523_i_DestinationMapX, L0524_i_DestinationMapY);
L0519_ps_Event->_C._projectile.setMapX(_vm->_moveSens->_g397_moveResultMapX);
L0519_ps_Event->_C._projectile.setMapY(_vm->_moveSens->_g398_moveResultMapY);
L0519_ps_Event->_C._projectile.setDir((Direction)_vm->_moveSens->_g400_moveResultDir);
- L0515_T_ProjectileThingNewCell = M15_thingWithNewCell(L0515_T_ProjectileThingNewCell, _vm->_moveSens->_g401_moveResultCell);
+ L0515_T_ProjectileThingNewCell = thingWithNewCell(L0515_T_ProjectileThingNewCell, _vm->_moveSens->_g401_moveResultCell);
M31_setMap(L0519_ps_Event->_mapTime, _vm->_moveSens->_g399_moveResultMapIndex);
} else {
if ((Square(_vm->_dungeonMan->f151_getSquare(L0523_i_DestinationMapX, L0524_i_DestinationMapY)).getType() == k4_DoorElemType) && f217_projectileHasImpactOccurred(k4_DoorElemType, L0523_i_DestinationMapX, L0524_i_DestinationMapY, L0518_ui_Cell, L0521_T_ProjectileThing)) {
diff --git a/engines/dm/sounds.cpp b/engines/dm/sounds.cpp
index fe53f110ef..e0bef370fe 100644
--- a/engines/dm/sounds.cpp
+++ b/engines/dm/sounds.cpp
@@ -203,7 +203,7 @@ void SoundMan::f064_SOUND_RequestPlay_CPSD(uint16 soundIndex, int16 mapX, int16
sound = &g60_sounds[soundIndex];
if (mode > k1_soundModePlayIfPrioritized) { /* Add an event in the timeline to play the sound (mode - 1) ticks later */
TimelineEvent event;
- M33_setMapAndTime(event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, _vm->_g313_gameTime + mode - 1);
+ setMapAndTime(event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, _vm->_gameTime + mode - 1);
event._type = k20_TMEventTypePlaySound;
event._priority = sound->_priority;
event._C._soundIndex = soundIndex;
diff --git a/engines/dm/text.cpp b/engines/dm/text.cpp
index 1fe6a49d25..bae466191f 100644
--- a/engines/dm/text.cpp
+++ b/engines/dm/text.cpp
@@ -165,7 +165,7 @@ void TextMan::f46_messageAreaPrintString(Color color, const char* string) {
f560_SCROLLER_setCommand(&_gK60_s_TextScroller, 1);
}
_g359_messageAreaCursorColumn += L0030_i_StringLength;
- _g360_messageAreaRowExpirationTime[_g358_messageAreaCursorRow] = _vm->_g313_gameTime + 200;
+ _g360_messageAreaRowExpirationTime[_g358_messageAreaCursorRow] = _vm->_gameTime + 200;
}
@@ -204,7 +204,7 @@ void TextMan::f44_messageAreaClearExpiredRows() {
L0028_s_Box._x2 = 319;
for (L0026_ui_RowIndex = 0; L0026_ui_RowIndex < 4; L0026_ui_RowIndex++) {
L0027_l_ExpirationTime = _g360_messageAreaRowExpirationTime[L0026_ui_RowIndex];
- if ((L0027_l_ExpirationTime == -1) || (L0027_l_ExpirationTime > _vm->_g313_gameTime))
+ if ((L0027_l_ExpirationTime == -1) || (L0027_l_ExpirationTime > _vm->_gameTime))
continue;
L0028_s_Box._y2 = (L0028_s_Box._y1 = 172 + (L0026_ui_RowIndex * 7)) + 6;
f561_isTextScrolling(&_gK60_s_TextScroller, true);
diff --git a/engines/dm/timeline.cpp b/engines/dm/timeline.cpp
index 27f58c9731..27ea5e49cc 100644
--- a/engines/dm/timeline.cpp
+++ b/engines/dm/timeline.cpp
@@ -102,7 +102,7 @@ Timeline::~Timeline() {
void Timeline::f233_initTimeline() {
_g370_events = new TimelineEvent[_g369_eventMaxCount];
_g371_timeline = new uint16[_g369_eventMaxCount];
- if (_vm->_g298_newGame) {
+ if (_vm->_newGameFl) {
for (int16 i = 0; i < _g369_eventMaxCount; ++i)
_g370_events[i]._type = k0_TMEventTypeNone;
_g372_eventCount = 0;
@@ -177,8 +177,8 @@ T0236011:
bool Timeline::f234_isEventABeforeB(TimelineEvent* eventA, TimelineEvent* eventB) {
bool L0578_B_Simultaneous;
- return (M30_time(eventA->_mapTime) < M30_time(eventB->_mapTime)) ||
- ((L0578_B_Simultaneous = (M30_time(eventA->_mapTime) == M30_time(eventB->_mapTime))) && (eventA->getTypePriority() > eventB->getTypePriority())) ||
+ return (filterTime(eventA->_mapTime) < filterTime(eventB->_mapTime)) ||
+ ((L0578_B_Simultaneous = (filterTime(eventA->_mapTime) == filterTime(eventB->_mapTime))) && (eventA->getTypePriority() > eventB->getTypePriority())) ||
(L0578_B_Simultaneous && (eventA->getTypePriority() == eventB->getTypePriority()) && (eventA <= eventB));
}
@@ -204,7 +204,7 @@ uint16 Timeline::f238_addEventGetEventIndex(TimelineEvent* event) {
if (_g372_eventCount == _g369_eventMaxCount) {
- _vm->f19_displayErrorAndStop(45);
+ _vm->displayErrorAndStop(45);
}
if ((event->_type >= k5_TMEventTypeCorridor) && (event->_type <= k10_TMEventTypeDoor)) {
for (L0588_ui_EventIndex = 0, L0591_ps_Event = _g370_events; L0588_ui_EventIndex < _g369_eventMaxCount; L0588_ui_EventIndex++, L0591_ps_Event++) {
@@ -243,7 +243,7 @@ uint16 Timeline::f238_addEventGetEventIndex(TimelineEvent* event) {
} else {
if (event->_type == k2_TMEventTypeDoorDestruction) {
for (L0588_ui_EventIndex = 0, L0591_ps_Event = _g370_events; L0588_ui_EventIndex < _g369_eventMaxCount; L0588_ui_EventIndex++, L0591_ps_Event++) {
- if ((event->getMapXY() == L0591_ps_Event->getMapXY()) && (M29_map(event->_mapTime) == M29_map(L0591_ps_Event->_mapTime))) {
+ if ((event->getMapXY() == L0591_ps_Event->getMapXY()) && (getMap(event->_mapTime) == getMap(L0591_ps_Event->_mapTime))) {
if ((L0591_ps_Event->_type == k1_TMEventTypeDoorAnimation) || (L0591_ps_Event->_type == k10_TMEventTypeDoor)) {
f237_deleteEvent(L0588_ui_EventIndex);
}
@@ -274,7 +274,7 @@ void Timeline::f261_processTimeline() {
while (f240_isFirstEventExpiered()) {
L0681_ps_Event = &L0682_s_Event;
f239_timelineExtractFirstEvent(L0681_ps_Event);
- _vm->_dungeonMan->f173_setCurrentMap(M29_map(L0682_s_Event._mapTime));
+ _vm->_dungeonMan->f173_setCurrentMap(getMap(L0682_s_Event._mapTime));
AL0680_ui_EventType = L0682_s_Event._type;
if ((AL0680_ui_EventType > (k29_TMEventTypeGroupReactionDangerOnSquare - 1)) && (AL0680_ui_EventType < (k41_TMEventTypeUpdateBehaviour_3 + 1))) {
_vm->_groupMan->f209_processEvents29to41(L0682_s_Event._B._location._mapX, L0682_s_Event._B._location._mapY, AL0680_ui_EventType, L0682_s_Event._C._ticks);
@@ -322,7 +322,7 @@ void Timeline::f261_processTimeline() {
_vm->_sound->f064_SOUND_RequestPlay_CPSD(L0682_s_Event._C._soundIndex, L0682_s_Event._B._location._mapX, L0682_s_Event._B._location._mapY, k1_soundModePlayIfPrioritized);
break;
case k24_TMEventTypeRemoveFluxcage:
- if (!_vm->_g302_gameWon) {
+ if (!_vm->_gameWon) {
_vm->_dungeonMan->f164_unlinkThingFromList(Thing(L0682_s_Event._C._slot), Thing(0), L0682_s_Event._B._location._mapX, L0682_s_Event._B._location._mapY);
L0681_ps_Event = (TimelineEvent*)_vm->_dungeonMan->f156_getThingData(Thing(L0682_s_Event._C._slot));
((Explosion*)L0681_ps_Event)->setNextThing(Thing::_none);
@@ -331,7 +331,7 @@ void Timeline::f261_processTimeline() {
case k11_TMEventTypeEnableChampionAction:
f253_timelineProcessEvent11Part1_enableChampionAction(L0682_s_Event._priority);
if (L0682_s_Event._B._slotOrdinal) {
- f259_timelineProcessEvent11Part2_moveWeaponFromQuiverToSlot(L0682_s_Event._priority, _vm->M1_ordinalToIndex(L0682_s_Event._B._slotOrdinal));
+ f259_timelineProcessEvent11Part2_moveWeaponFromQuiverToSlot(L0682_s_Event._priority, _vm->ordinalToIndex(L0682_s_Event._B._slotOrdinal));
}
goto T0261048;
case k12_TMEventTypeHideDamageReceived:
@@ -381,7 +381,7 @@ T0261053:
}
bool Timeline::f240_isFirstEventExpiered() {
- return (_g372_eventCount && (M30_time(_g370_events[_g371_timeline[0]]._mapTime) <= _vm->_g313_gameTime));
+ return (_g372_eventCount && (filterTime(_g370_events[_g371_timeline[0]]._mapTime) <= _vm->_gameTime));
}
void Timeline::f239_timelineExtractFirstEvent(TimelineEvent* event) {
@@ -583,7 +583,7 @@ void Timeline::f249_moveTeleporterOrPitSquareThings(uint16 mapX, uint16 mapY) {
L0647_ps_Event->_C._projectile.setMapX(_vm->_moveSens->_g397_moveResultMapX);
L0647_ps_Event->_C._projectile.setMapY(_vm->_moveSens->_g398_moveResultMapY);
L0647_ps_Event->_C._projectile.setDir((Direction)_vm->_moveSens->_g400_moveResultDir);
- L0647_ps_Event->_B._slot = M15_thingWithNewCell(L0645_T_Thing, _vm->_moveSens->_g401_moveResultCell).toUint16();
+ L0647_ps_Event->_B._slot = thingWithNewCell(L0645_T_Thing, _vm->_moveSens->_g401_moveResultCell).toUint16();
M31_setMap(L0647_ps_Event->_mapTime, _vm->_moveSens->_g399_moveResultMapIndex);
} else {
if (AL0644_ui_ThingType == k15_ExplosionThingType) {
@@ -591,7 +591,7 @@ void Timeline::f249_moveTeleporterOrPitSquareThings(uint16 mapX, uint16 mapY) {
if ((L0647_ps_Event->_type == k25_TMEventTypeExplosion) && (L0647_ps_Event->_C._slot == L0645_T_Thing.toUint16())) { /* BUG0_23 A Fluxcage explosion remains on a square forever. If you open a pit or teleporter on a square where there is a Fluxcage explosion, the Fluxcage explosion is moved but the associated event is not updated (because Fluxcage explosions do not use k25_TMEventTypeExplosion but rather k24_TMEventTypeRemoveFluxcage) causing the Fluxcage explosion to remain in the dungeon forever on its destination square. When the k24_TMEventTypeRemoveFluxcage expires the explosion thing is not removed, but it is marked as unused. Consequently, any objects placed on the Fluxcage square after it was moved but before it expires become orphans upon expiration. After expiration, any object placed on the fluxcage square is cloned when picked up */
L0647_ps_Event->_B._location._mapX = _vm->_moveSens->_g397_moveResultMapX;
L0647_ps_Event->_B._location._mapY = _vm->_moveSens->_g398_moveResultMapY;
- L0647_ps_Event->_C._slot = M15_thingWithNewCell(L0645_T_Thing, _vm->_moveSens->_g401_moveResultCell).toUint16();
+ L0647_ps_Event->_C._slot = thingWithNewCell(L0645_T_Thing, _vm->_moveSens->_g401_moveResultCell).toUint16();
M31_setMap(L0647_ps_Event->_mapTime, _vm->_moveSens->_g399_moveResultMapIndex);
}
}
@@ -701,10 +701,10 @@ void Timeline::f248_timelineProcessEvent6_squareWall(TimelineEvent* event) {
}
} else {
if (L0640_ui_SensorType == k18_SensorWallEndGame) {
- _vm->f22_delay(60 * L0638_ps_Sensor->getValue());
- _vm->_g524_restartGameAllowed = false;
- _vm->_g302_gameWon = true;
- _vm->f444_endGame(true);
+ _vm->delay(60 * L0638_ps_Sensor->getValue());
+ _vm->_restartGameAllowed = false;
+ _vm->_gameWon = true;
+ _vm->endGame(true);
}
}
}
@@ -781,7 +781,7 @@ void Timeline::f247_triggerProjectileLauncher(Sensor* sensor, TimelineEvent* eve
}
}
if (L0632_B_LaunchSingleProjectile) {
- L0628_ui_ProjectileCell = M21_normalizeModulo4(L0628_ui_ProjectileCell + _vm->getRandomNumber(2));
+ L0628_ui_ProjectileCell = normalizeModulo4(L0628_ui_ProjectileCell + _vm->getRandomNumber(2));
}
L0626_i_MapX += _vm->_dirIntoStepCountEast[L0624_ui_Cell], L0627_i_MapY += _vm->_dirIntoStepCountNorth[L0624_ui_Cell]; /* BUG0_20 The game crashes if the launcher sensor is on a map boundary and shoots in a direction outside the map */
_vm->_projexpl->_g365_createLanucherProjectile = true;
@@ -821,8 +821,8 @@ void Timeline::f245_timlineProcessEvent5_squareCorridor(TimelineEvent* event) {
L0615_ps_TextString->setVisible((event->_C.A._effect == k0_SensorEffSet));
}
if (!L0611_B_TextCurrentlyVisible && L0615_ps_TextString->isVisible() && (_vm->_dungeonMan->_g272_currMapIndex == _vm->_dungeonMan->_g309_partyMapIndex) && (L0616_ui_MapX == _vm->_dungeonMan->_g306_partyMapX) && (L0617_ui_MapY == _vm->_dungeonMan->_g307_partyMapY)) {
- _vm->_dungeonMan->f168_decodeText(_vm->_g353_stringBuildBuffer, L0613_T_Thing, k1_TextTypeMessage);
- _vm->_textMan->f47_messageAreaPrintMessage(k15_ColorWhite, _vm->_g353_stringBuildBuffer);
+ _vm->_dungeonMan->f168_decodeText(_vm->_stringBuildBuffer, L0613_T_Thing, k1_TextTypeMessage);
+ _vm->_textMan->f47_messageAreaPrintMessage(k15_ColorWhite, _vm->_stringBuildBuffer);
}
} else {
if (L0610_i_ThingType == k3_SensorThingType) {
@@ -850,7 +850,7 @@ void Timeline::f245_timlineProcessEvent5_squareCorridor(TimelineEvent* event) {
AL0618_ui_Ticks = (AL0618_ui_Ticks - 126) << 6;
}
L0619_s_Event._type = k65_TMEventTypeEnableGroupGenerator;
- M33_setMapAndTime(L0619_s_Event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, _vm->_g313_gameTime + AL0618_ui_Ticks);
+ setMapAndTime(L0619_s_Event._mapTime, _vm->_dungeonMan->_g272_currMapIndex, _vm->_gameTime + AL0618_ui_Ticks);
L0619_s_Event._priority = 0;
L0619_s_Event._B._location._mapX = L0616_ui_MapX;
L0619_s_Event._B._location._mapY = L0617_ui_MapY;
@@ -991,7 +991,7 @@ void Timeline::f254_timelineProcessEvent12_hideDamageReceived(uint16 champIndex)
if (!L0663_ps_Champion->_currHealth) {
return;
}
- if (_vm->M0_indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) {
+ if (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_g432_inventoryChampionOrdinal) {
_vm->_eventMan->f78_showMouse();
_vm->_inventoryMan->f354_drawStatusBoxPortrait((ChampionIndex)champIndex);
_vm->_eventMan->f77_hideMouse();
@@ -1029,7 +1029,7 @@ void Timeline::f257_timelineProcessEvent70_light(TimelineEvent* event) {
if (L0673_i_WeakerLightPower) {
L0676_s_Event._type = k70_TMEventTypeLight;
L0676_s_Event._B._lightPower = L0673_i_WeakerLightPower;
- M33_setMapAndTime(L0676_s_Event._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_g313_gameTime + 4);
+ setMapAndTime(L0676_s_Event._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_gameTime + 4);
L0676_s_Event._priority = 0;
f238_addEventGetEventIndex(&L0676_s_Event);
}