aboutsummaryrefslogtreecommitdiff
path: root/engines/dm
diff options
context:
space:
mode:
Diffstat (limited to 'engines/dm')
-rw-r--r--engines/dm/champion.cpp14
-rw-r--r--engines/dm/dm.h2
-rw-r--r--engines/dm/eventman.cpp6
-rw-r--r--engines/dm/gfx.cpp14
-rw-r--r--engines/dm/group.cpp48
-rw-r--r--engines/dm/group.h39
-rw-r--r--engines/dm/inventory.cpp28
-rw-r--r--engines/dm/inventory.h24
-rw-r--r--engines/dm/menus.cpp2
-rw-r--r--engines/dm/objectman.h1
-rw-r--r--engines/dm/projexpl.cpp2
11 files changed, 93 insertions, 87 deletions
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp
index bc613df4d8..b6c0e7d18e 100644
--- a/engines/dm/champion.cpp
+++ b/engines/dm/champion.cpp
@@ -503,10 +503,10 @@ void ChampionMan::drawChangedObjectIcons() {
}
}
- if (invMan._panelContent == k4_PanelContentChest) {
+ if (invMan._panelContent == kDMPanelContentChest) {
thing = invMan._chestSlots;
for (int16 slotIndex = 0; slotIndex < 8; ++slotIndex, thing++) {
- drawViewport |= (hasObjectIconInSlotBoxChanged(slotIndex + k38_SlotBoxChestFirstSlot, *thing) ? 1 : 0);
+ drawViewport |= (hasObjectIconInSlotBoxChanged(slotIndex + kDMSlotBoxChestFirstSlot, *thing) ? 1 : 0);
}
}
@@ -1108,7 +1108,7 @@ void ChampionMan::championPoison(int16 champIndex, uint16 attack) {
Champion *curChampion = &_champions[champIndex];
addPendingDamageAndWounds_getDamage(champIndex, MAX(1, attack >> 6), kDMWoundNone, kDMAttackTypeNormal);
setFlag(curChampion->_attributes, kDMAttributeStatistics);
- if ((_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal) && (_vm->_inventoryMan->_panelContent == k0_PanelContentFoodWaterPoisoned)) {
+ if ((_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal) && (_vm->_inventoryMan->_panelContent == kDMPanelContentFoodWaterPoisoned)) {
setFlag(curChampion->_attributes, kDMAttributePanel);
}
@@ -1390,7 +1390,7 @@ void ChampionMan::applyAndDrawPendingDamageAndWounds() {
setFlag(championPtr->_attributes, kDMAttributeWounds);
}
- int16 textPosX = championIndex * k69_ChampionStatusBoxSpacing;
+ int16 textPosX = championIndex * kDMChampionStatusBoxSpacing;
int16 textPosY;
Box blitBox;
@@ -1685,7 +1685,7 @@ void ChampionMan::applyTimeEffects() {
}
setFlag(championPtr->_attributes, kDMAttributeStatistics);
if (_vm->indexToOrdinal(championIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal) {
- if (_vm->_pressingMouth || _vm->_pressingEye || (_vm->_inventoryMan->_panelContent == k0_PanelContentFoodWaterPoisoned)) {
+ if (_vm->_pressingMouth || _vm->_pressingEye || (_vm->_inventoryMan->_panelContent == kDMPanelContentFoodWaterPoisoned)) {
setFlag(championPtr->_attributes, kDMAttributePanel);
}
}
@@ -2064,7 +2064,7 @@ void ChampionMan::drawChampionBarGraphs(ChampionIndex champIndex) {
// Strangerke - TO CHECK: if portraits, maybe the old (assembly) code is required for older versions
Box box;
- box._rect.left = champIndex * k69_ChampionStatusBoxSpacing + 46;
+ box._rect.left = champIndex * kDMChampionStatusBoxSpacing + 46;
box._rect.right = box._rect.left + 3;
box._rect.top = 2;
box._rect.bottom = 26;
@@ -2116,7 +2116,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
static Box boxMouth = Box(55, 72, 12, 29); // @ G0048_s_Graphic562_Box_Mouth
static Box boxEye = Box(11, 28, 12, 29); // @ G0049_s_Graphic562_Box_Eye
- int16 championStatusBoxX = champIndex * k69_ChampionStatusBoxSpacing;
+ int16 championStatusBoxX = champIndex * kDMChampionStatusBoxSpacing;
Champion *curChampion = &_champions[champIndex];
uint16 championAttributes = curChampion->_attributes;
if (!getFlag(championAttributes, kDMAttributeNameTitle | kDMAttributeStatistics | kDMAttributeLoad | kDMAttributeIcon | kDMAttributePanel | kDMAttributeStatusBox | kDMAttributeWounds | kDMAttributeViewport | kDMAttributeActionHand))
diff --git a/engines/dm/dm.h b/engines/dm/dm.h
index 15633bfbb6..c346fa0874 100644
--- a/engines/dm/dm.h
+++ b/engines/dm/dm.h
@@ -148,6 +148,8 @@ enum MapIndice {
#define kDMMaskDecodeEvenIfInvisible 0x8000 // @ MASK0x8000_DECODE_EVEN_IF_INVISIBLE
#define kDMMaskMergeCycles 0x8000 // @ MASK0x8000_MERGE_CYCLES
+#define kDMSlotBoxChestFirstSlot 38 // @ C38_SLOT_BOX_CHEST_FIRST_SLOT
+
struct DMADGameDescription {
ADGameDescription _desc;
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp
index ffdb62c9cc..e98f108166 100644
--- a/engines/dm/eventman.cpp
+++ b/engines/dm/eventman.cpp
@@ -1257,7 +1257,7 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane
Box box;
box._rect.top = 0;
box._rect.bottom = 28;
- box._rect.left = championIndex * k69_ChampionStatusBoxSpacing;
+ box._rect.left = championIndex * kDMChampionStatusBoxSpacing;
box._rect.right = box._rect.left + 66;
dispMan._useByteBoxCoordinates = false;
dispMan.fillScreenBox(box, kDMColorBlack);
@@ -1334,14 +1334,14 @@ void EventManager::commandProcess81ClickInPanel(int16 x, int16 y) {
CommandType commandType;
switch (invMan._panelContent) {
- case k4_PanelContentChest:
+ case kDMPanelContentChest:
if (champMan._leaderIndex == kDMChampionNone) // if no leader
return;
commandType = getCommandTypeFromMouseInput(_mouseInputPanelChest, Common::Point(x, y), kDMMouseButtonLeft);
if (commandType != kDMCommandNone)
_vm->_championMan->clickOnSlotBox(commandType - kDMCommandClickOnSlotBoxChampion0StatusBoxReadyHand);
break;
- case k5_PanelContentResurrectReincarnate:
+ case kDMPanelContentResurrectReincarnate:
if (!champMan._leaderEmptyHanded)
break;
commandType = getCommandTypeFromMouseInput(_mouseInputPanelResurrectReincarnateCancel, Common::Point(x, y), kDMMouseButtonLeft);
diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp
index 9195258f08..d4f32fbccc 100644
--- a/engines/dm/gfx.cpp
+++ b/engines/dm/gfx.cpp
@@ -3292,7 +3292,7 @@ T0115015_DrawProjectileAsObject:
if (AL_0_creatureIndexRed) { /* If there is a creature on the cell being processed */
AL_0_creatureIndexRed--; /* Convert ordinal to index */
creatureIndexGreen = AL_0_creatureIndexRed;
- } else if (creatureSize == k1_MaskCreatureSizeHalf) {
+ } else if (creatureSize == kDMCreatureSizeHalf) {
AL_0_creatureIndexRed = 0;
creatureIndexGreen = -1;
} else
@@ -3306,11 +3306,11 @@ T0115015_DrawProjectileAsObject:
goto T0115129_DrawProjectiles; /* Do not draw a single centered creature now, wait until second pass (for a front view door) or until all cells have been drawn so the creature is drawn over all the objects on the floor */
drawCreaturesCompleted = true;
- if ((creatureSize == k1_MaskCreatureSizeHalf) && (creatureDirectionDelta & 0x0001)) /* Side view of half square creature */
+ if ((creatureSize == kDMCreatureSizeHalf) && (creatureDirectionDelta & 0x0001)) /* Side view of half square creature */
AL_2_viewCell = k3_HalfSizedViewCell_CenterColumn;
else
AL_2_viewCell = k4_HalfSizedViewCell_FrontRow;
- } else if ((creatureSize == k1_MaskCreatureSizeHalf) && (drawingLastBackRowCell || !remainingViewCellOrdinalsToProcess || (creatureIndexGreen < 0))) {
+ } else if ((creatureSize == kDMCreatureSizeHalf) && (drawingLastBackRowCell || !remainingViewCellOrdinalsToProcess || (creatureIndexGreen < 0))) {
if (drawingLastBackRowCell && (doorFrontViewDrawingPass != 2)) {
if ((creatureIndexGreen >= 0) && (creatureDirectionDelta & 0x0001))
AL_2_viewCell = k2_HalfSizedViewCell_BackRow; /* Side view of a half square creature on the back row. Drawn during pass 1 for a door square */
@@ -3362,7 +3362,7 @@ T0115077_DrawSecondHalfSquareCreature:
} else {
useCreatureBackBitmap = getFlag(creatureGraphicInfoRed, kDMCreatureMaskBack) && (creatureDirectionDelta == 0);
useCreatureAttackBitmap = !useCreatureBackBitmap;
- if (useCreatureAttackBitmap && getFlag(creatureAspectInt, k0x0080_MaskActiveGroupIsAttacking) && getFlag(creatureGraphicInfoRed, kDMCreatureMaskAttack)) {
+ if (useCreatureAttackBitmap && getFlag(creatureAspectInt, kDMAspectMaskActiveGroupIsAttacking) && getFlag(creatureGraphicInfoRed, kDMCreatureMaskAttack)) {
useFlippedHorizontallyCreatureFrontImage = false;
sourceByteWidth = byteWidth = ((CreatureAspect *)objectAspect)->_byteWidthAttack;
sourceHeight = heightRedEagle = ((CreatureAspect *)objectAspect)->_heightAttack;
@@ -3390,7 +3390,7 @@ T0115077_DrawSecondHalfSquareCreature:
derivedBitmapIndex += 2;
}
} else {
- useFlippedHorizontallyCreatureFrontImage = getFlag(creatureGraphicInfoRed, kDMCreatureMaskFlipNonAttack) && getFlag(creatureAspectInt, k0x0040_MaskActiveGroupFlipBitmap);
+ useFlippedHorizontallyCreatureFrontImage = getFlag(creatureGraphicInfoRed, kDMCreatureMaskFlipNonAttack) && getFlag(creatureAspectInt, kDMAspectMaskActiveGroupFlipBitmap);
if (useFlippedHorizontallyCreatureFrontImage) {
derivedBitmapIndex += 2;
if (getFlag(creatureGraphicInfoRed, kDMCreatureMaskSide))
@@ -3419,7 +3419,7 @@ T0115077_DrawSecondHalfSquareCreature:
}
} else if (useCreatureBackBitmap || !useFlippedHorizontallyCreatureFrontImage) {
bitmapRedBanana = getNativeBitmapOrGraphic(AL_4_nativeBitmapIndex);
- if (useCreatureAttackBitmap && getFlag(creatureAspectInt, k0x0040_MaskActiveGroupFlipBitmap)) {
+ if (useCreatureAttackBitmap && getFlag(creatureAspectInt, kDMAspectMaskActiveGroupFlipBitmap)) {
copyBitmapAndFlipHorizontal(bitmapRedBanana, _tmpBitmap, byteWidth, heightRedEagle);
bitmapRedBanana = _tmpBitmap;
}
@@ -3465,7 +3465,7 @@ T0115077_DrawSecondHalfSquareCreature:
addDerivedBitmap(derivedBitmapIndex);
}
if ((useCreatureSideBitmap && (creatureDirectionDelta == 1)) || /* If creature is viewed from the right, the side view must be flipped */
- (useCreatureAttackBitmap && getFlag(creatureAspectInt, k0x0040_MaskActiveGroupFlipBitmap)) ||
+ (useCreatureAttackBitmap && getFlag(creatureAspectInt, kDMAspectMaskActiveGroupFlipBitmap)) ||
(useCreatureSpecialD2FrontBitmap && getFlag(creatureGraphicInfoRed, kDMCreatureMaskSpecialD2FrontIsFlipped)) ||
(useFlippedHorizontallyCreatureFrontImage && getFlag(creatureGraphicInfoRed, kDMCreatureMaskFlipNonAttack))) { /* If the graphic should be flipped */
if (!useFlippedHorizontallyCreatureFrontImage || !derivedBitmapInCache) {
diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp
index 95d118808d..fd36d4b16c 100644
--- a/engines/dm/group.cpp
+++ b/engines/dm/group.cpp
@@ -110,7 +110,7 @@ int16 GroupMan::getCreatureOrdinalInCell(Group *group, uint16 cell) {
int retval = 0;
byte creatureIndex = group->getCount();
- if (getFlag(_vm->_dungeonMan->_creatureInfos[group->_type]._attributes, kDMCreatureMaskSize) == k1_MaskCreatureSizeHalf) {
+ if (getFlag(_vm->_dungeonMan->_creatureInfos[group->_type]._attributes, kDMCreatureMaskSize) == kDMCreatureSizeHalf) {
if ((getGroupDirections(group, currMapIndex) & 1) == (cell & 1))
cell = _vm->turnDirLeft(cell);
@@ -466,11 +466,11 @@ int16 GroupMan::groupGetDamageCreatureOutcome(Group *group, uint16 creatureIndex
retVal = k1_outcomeKilledSomeCreaturesInGroup;
}
- uint16 creatureSize = getFlag(creatureInfo->_attributes, kDMCreatureMaskSize);
+ CreatureSize creatureSize = (CreatureSize)getFlag(creatureInfo->_attributes, kDMCreatureMaskSize);
uint16 attack;
if (creatureSize == kDMCreatureSizeQuarter)
attack = 110;
- else if (creatureSize == k1_MaskCreatureSizeHalf)
+ else if (creatureSize == kDMCreatureSizeHalf)
attack = 190;
else
attack = 255;
@@ -721,7 +721,7 @@ T0209005_AddEventAndReturn:
}
if (AL0447_i_Behavior == k6_behavior_ATTACK) {
AL0446_i_CreatureAspectIndex = eventType - k33_TMEventTypeUpdateAspectCreature_0; /* Value -1 for event 32, meaning aspect will be updated for all creatures in the group */
- nextAspectUpdateTime = getCreatureAspectUpdateTime(activeGroup, AL0446_i_CreatureAspectIndex, getFlag(activeGroup->_aspect[AL0446_i_CreatureAspectIndex], k0x0080_MaskActiveGroupIsAttacking));
+ nextAspectUpdateTime = getCreatureAspectUpdateTime(activeGroup, AL0446_i_CreatureAspectIndex, getFlag(activeGroup->_aspect[AL0446_i_CreatureAspectIndex], kDMAspectMaskActiveGroupIsAttacking));
goto T0209136;
}
if ((AL0450_i_DistanceXToParty > 3) || (AL0451_i_DistanceYToParty > 3)) {
@@ -751,7 +751,7 @@ T0209044_SetBehavior6_Attack:
for (AL0447_i_CreatureIndex = creatureCount; AL0447_i_CreatureIndex >= 0; AL0447_i_CreatureIndex--) {
if ((getCreatureValue(activeGroup->_directions, AL0447_i_CreatureIndex) != AL0446_i_Direction) &&
((!AL0447_i_CreatureIndex) || (!_vm->getRandomNumber(2)))) {
- setGroupDirection(activeGroup, AL0446_i_Direction, AL0447_i_CreatureIndex, creatureCount && (creatureSize == k1_MaskCreatureSizeHalf));
+ setGroupDirection(activeGroup, AL0446_i_Direction, AL0447_i_CreatureIndex, creatureCount && (creatureSize == kDMCreatureSizeHalf));
M32_setTime(nextEvent._mapTime, _vm->_gameTime + _vm->getRandomNumber(4) + 2); /* Random delay represents the time for the creature to turn */
} else {
M32_setTime(nextEvent._mapTime, _vm->_gameTime + 1);
@@ -943,7 +943,7 @@ T0209096_SetBehavior0_Wander:
goto T0209094_FleeFromTarget;
}
/* If the creature is attacking, then compute the next aspect update time and the next attack time */
- if (getFlag(activeGroup->_aspect[AL0447_i_CreatureIndex = eventType - k38_TMEventTypeUpdateBehaviour_0], k0x0080_MaskActiveGroupIsAttacking)) {
+ if (getFlag(activeGroup->_aspect[AL0447_i_CreatureIndex = eventType - k38_TMEventTypeUpdateBehaviour_0], kDMAspectMaskActiveGroupIsAttacking)) {
nextAspectUpdateTime = getCreatureAspectUpdateTime(activeGroup, AL0447_i_CreatureIndex, false);
nextEvent._mapTime += ((AL0447_i_Ticks = creatureInfo._attackTicks) + _vm->getRandomNumber(4) - 1);
if (AL0447_i_Ticks > 15)
@@ -960,7 +960,7 @@ T0209096_SetBehavior0_Wander:
activeGroup->_targetMapY = _vm->_dungeonMan->_partyMapY;
}
/* If there is a single creature in the group that is not full square sized and 1/4 chance */
- if (!creatureCount && (creatureSize != k2_MaskCreatureSizeFull) && !((AL0446_i_GroupCellsCriteria = _vm->getRandomNumber(65536)) & 0x00C0)) {
+ if (!creatureCount && (creatureSize != kDMCreatureSizeFull) && !((AL0446_i_GroupCellsCriteria = _vm->getRandomNumber(65536)) & 0x00C0)) {
if (activeGroup->_cells != k255_CreatureTypeSingleCenteredCreature) {
/* If the creature is not already on the center of the square then change its cell */
if (AL0446_i_GroupCellsCriteria & 0x0038) /* 7/8 chances of changing cell to the center of the square */
@@ -1025,7 +1025,7 @@ T0209096_SetBehavior0_Wander:
if (groupGetDistanceToVisibleParty(curGroup, kM1_wholeCreatureGroup, eventMapX, eventMapY)) {
activeGroup->_targetMapX = _vm->_dungeonMan->_partyMapX;
activeGroup->_targetMapY = _vm->_dungeonMan->_partyMapY;
- setGroupDirection(activeGroup, primaryDirectionToOrFromParty, AL0447_i_CreatureIndex, creatureCount && (creatureSize == k1_MaskCreatureSizeHalf));
+ setGroupDirection(activeGroup, primaryDirectionToOrFromParty, AL0447_i_CreatureIndex, creatureCount && (creatureSize == kDMCreatureSizeHalf));
nextEvent._mapTime += 2;
nextAspectUpdateTime = _vm->filterTime(nextEvent._mapTime);
} else { /* If the party is not visible, move to the target (last known party location) */
@@ -1254,7 +1254,7 @@ int32 GroupMan::getCreatureAspectUpdateTime(ActiveGroup *activeGroup, int16 crea
do {
uint16 aspect = activeGroup->_aspect[creatureIndex];
- aspect &= k0x0080_MaskActiveGroupIsAttacking | k0x0040_MaskActiveGroupFlipBitmap;
+ aspect &= kDMAspectMaskActiveGroupIsAttacking | kDMAspectMaskActiveGroupFlipBitmap;
int16 offset = ((creatureGraphicInfo >> 12) & 0x3);
if (offset) {
offset = _vm->getRandomNumber(offset);
@@ -1274,38 +1274,38 @@ int32 GroupMan::getCreatureAspectUpdateTime(ActiveGroup *activeGroup, int16 crea
}
if (isAttacking) {
if (getFlag(creatureGraphicInfo, kDMCreatureMaskFlipAttack)) {
- if (getFlag(aspect, k0x0080_MaskActiveGroupIsAttacking) && (creatureType == kDMCreatureTypeAnimatedArmour)) {
+ if (getFlag(aspect, kDMAspectMaskActiveGroupIsAttacking) && (creatureType == kDMCreatureTypeAnimatedArmour)) {
if (_vm->getRandomNumber(2)) {
- toggleFlag(aspect, k0x0040_MaskActiveGroupFlipBitmap);
+ toggleFlag(aspect, kDMAspectMaskActiveGroupFlipBitmap);
_vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _currentGroupMapX, _currentGroupMapY, kDMSoundModePlayIfPrioritized);
}
- } else if (!getFlag(aspect, k0x0080_MaskActiveGroupIsAttacking) || !getFlag(creatureGraphicInfo, kDMCreatureMaskFlipDuringAttack)) {
+ } else if (!getFlag(aspect, kDMAspectMaskActiveGroupIsAttacking) || !getFlag(creatureGraphicInfo, kDMCreatureMaskFlipDuringAttack)) {
if (_vm->getRandomNumber(2))
- setFlag(aspect, k0x0040_MaskActiveGroupFlipBitmap);
+ setFlag(aspect, kDMAspectMaskActiveGroupFlipBitmap);
else
- clearFlag(aspect, k0x0040_MaskActiveGroupFlipBitmap);
+ clearFlag(aspect, kDMAspectMaskActiveGroupFlipBitmap);
}
} else
- clearFlag(aspect, k0x0040_MaskActiveGroupFlipBitmap);
+ clearFlag(aspect, kDMAspectMaskActiveGroupFlipBitmap);
- setFlag(aspect, k0x0080_MaskActiveGroupIsAttacking);
+ setFlag(aspect, kDMAspectMaskActiveGroupIsAttacking);
} else {
if (getFlag(creatureGraphicInfo, kDMCreatureMaskFlipNonAttack)) {
if (creatureType == kDMCreatureTypeCouatl) {
if (_vm->getRandomNumber(2)) {
- toggleFlag(aspect, k0x0040_MaskActiveGroupFlipBitmap);
+ toggleFlag(aspect, kDMAspectMaskActiveGroupFlipBitmap);
uint16 soundIndex = _vm->_moveSens->getSound(kDMCreatureTypeCouatl);
if (soundIndex <= k34_D13_soundCount)
_vm->_sound->requestPlay(soundIndex, _currentGroupMapX, _currentGroupMapY, kDMSoundModePlayIfPrioritized);
}
} else if (_vm->getRandomNumber(2))
- setFlag(aspect, k0x0040_MaskActiveGroupFlipBitmap);
+ setFlag(aspect, kDMAspectMaskActiveGroupFlipBitmap);
else
- clearFlag(aspect, k0x0040_MaskActiveGroupFlipBitmap);
+ clearFlag(aspect, kDMAspectMaskActiveGroupFlipBitmap);
} else
- clearFlag(aspect, k0x0040_MaskActiveGroupFlipBitmap);
+ clearFlag(aspect, kDMAspectMaskActiveGroupFlipBitmap);
- clearFlag(aspect, k0x0080_MaskActiveGroupIsAttacking);
+ clearFlag(aspect, kDMAspectMaskActiveGroupIsAttacking);
}
activeGroup->_aspect[creatureIndex] = aspect;
} while (processGroup && (creatureIndex--));
@@ -1384,7 +1384,7 @@ int16 GroupMan::getFirstPossibleMovementDirOrdinal(CreatureInfo *info, int16 map
}
void GroupMan::setDirGroup(ActiveGroup *activeGroup, int16 dir, int16 creatureIndex, int16 creatureSize) {
- bool twoHalfSquareSizedCreatures = creatureIndex && (creatureSize == k1_MaskCreatureSizeHalf);
+ bool twoHalfSquareSizedCreatures = creatureIndex && (creatureSize == kDMCreatureSizeHalf);
if (twoHalfSquareSizedCreatures)
creatureIndex--;
@@ -1397,7 +1397,7 @@ void GroupMan::setDirGroup(ActiveGroup *activeGroup, int16 dir, int16 creatureIn
void GroupMan::stopAttacking(ActiveGroup *group, int16 mapX, int16 mapY) {
for (int16 creatureIndex = 0; creatureIndex < 4; creatureIndex++)
- clearFlag(group->_aspect[creatureIndex++], k0x0080_MaskActiveGroupIsAttacking);
+ clearFlag(group->_aspect[creatureIndex++], kDMAspectMaskActiveGroupIsAttacking);
groupDeleteEvents(mapX, mapY);
}
@@ -1752,7 +1752,7 @@ Thing GroupMan::groupGetGenerated(CreatureType creatureType, int16 healthMultipl
group->_health[creatureCount] = (baseHealth * healthMultiplier) + _vm->getRandomNumber((baseHealth >> 2) + 1);
if (severalCreaturesInGroup) {
groupCells = getGroupValueUpdatedWithCreatureValue(groupCells, creatureCount, cell++);
- if (getFlag(creatureInfo->_attributes, kDMCreatureMaskSize) == k1_MaskCreatureSizeHalf)
+ if (getFlag(creatureInfo->_attributes, kDMCreatureMaskSize) == kDMCreatureSizeHalf)
cell++;
cell &= 0x0003;
diff --git a/engines/dm/group.h b/engines/dm/group.h
index 08ce611464..82985a29e6 100644
--- a/engines/dm/group.h
+++ b/engines/dm/group.h
@@ -66,29 +66,34 @@ enum CreatureType {
kDMCreatureTypeLordOrder = 25, // @ C25_CREATURE_LORD_ORDER
kDMCreatureTypeGreyLord = 26 // @ C26_CREATURE_GREY_LORD
};
+
#define k255_CreatureTypeSingleCenteredCreature 255 // @ C255_SINGLE_CENTERED_CREATURE
enum CreatureSize {
kDMCreatureSizeQuarter = 0, // @ C0_SIZE_QUARTER_SQUARE
- k1_MaskCreatureSizeHalf = 1, // @ C1_SIZE_HALF_SQUARE
- k2_MaskCreatureSizeFull = 2 // @ C2_SIZE_FULL_SQUARE
+ kDMCreatureSizeHalf = 1, // @ C1_SIZE_HALF_SQUARE
+ kDMCreatureSizeFull = 2 // @ C2_SIZE_FULL_SQUARE
+};
+
+enum CreatureMask {
+ kDMCreatureMaskSize = 0x0003, // @ MASK0x0003_SIZE
+ kDMCreatureMaskSideAttack = 0x0004, // @ MASK0x0004_SIDE_ATTACK
+ kDMCreatureMaskPreferBackRow = 0x0008, // @ MASK0x0008_PREFER_BACK_ROW
+ kDMCreatureMaskAttackAnyChamp = 0x0010, // @ MASK0x0010_ATTACK_ANY_CHAMPION
+ kDMCreatureMaskLevitation = 0x0020, // @ MASK0x0020_LEVITATION
+ kDMCreatureMaskNonMaterial = 0x0040, // @ MASK0x0040_NON_MATERIAL
+ kDMCreatureMaskDropFixedPoss = 0x0200, // @ MASK0x0200_DROP_FIXED_POSSESSIONS
+ kDMCreatureMaskKeepThrownSharpWeapon = 0x0400, // @ MASK0x0400_KEEP_THROWN_SHARP_WEAPONS
+ kDMCreatureMaskSeeInvisible = 0x0800, // @ MASK0x0800_SEE_INVISIBLE
+ kDMCreatureMaskNightVision = 0x1000, // @ MASK0x1000_NIGHT_VISION
+ kDMCreatureMaskArchenemy = 0x2000, // @ MASK0x2000_ARCHENEMY
+ kDMCreatureMaskMagicMap = 0x4000 // @ MASK0x4000_MAGICMAP
};
-#define kDMCreatureMaskSize 0x0003 // @ MASK0x0003_SIZE
-#define kDMCreatureMaskSideAttack 0x0004 // @ MASK0x0004_SIDE_ATTACK
-#define kDMCreatureMaskPreferBackRow 0x0008 // @ MASK0x0008_PREFER_BACK_ROW
-#define kDMCreatureMaskAttackAnyChamp 0x0010 // @ MASK0x0010_ATTACK_ANY_CHAMPION
-#define kDMCreatureMaskLevitation 0x0020 // @ MASK0x0020_LEVITATION
-#define kDMCreatureMaskNonMaterial 0x0040 // @ MASK0x0040_NON_MATERIAL
-#define kDMCreatureMaskDropFixedPoss 0x0200 // @ MASK0x0200_DROP_FIXED_POSSESSIONS
-#define kDMCreatureMaskKeepThrownSharpWeapon 0x0400 // @ MASK0x0400_KEEP_THROWN_SHARP_WEAPONS
-#define kDMCreatureMaskSeeInvisible 0x0800 // @ MASK0x0800_SEE_INVISIBLE
-#define kDMCreatureMaskNightVision 0x1000 // @ MASK0x1000_NIGHT_VISION
-#define kDMCreatureMaskArchenemy 0x2000 // @ MASK0x2000_ARCHENEMY
-#define kDMCreatureMaskMagicMap 0x4000 // @ MASK0x4000_MAGICMAP
-
-#define k0x0040_MaskActiveGroupFlipBitmap 0x0040 // @ MASK0x0040_FLIP_BITMAP
-#define k0x0080_MaskActiveGroupIsAttacking 0x0080 // @ MASK0x0080_IS_ATTACKING
+enum aspectMask {
+ kDMAspectMaskActiveGroupFlipBitmap = 0x0040, // @ MASK0x0040_FLIP_BITMAP
+ kDMAspectMaskActiveGroupIsAttacking = 0x0080 // @ MASK0x0080_IS_ATTACKING
+};
class ActiveGroup {
public:
diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp
index 92843ee041..93f66289ff 100644
--- a/engines/dm/inventory.cpp
+++ b/engines/dm/inventory.cpp
@@ -71,7 +71,7 @@ void InventoryMan::initConstants() {
InventoryMan::InventoryMan(DMEngine *vm) : _vm(vm) {
_inventoryChampionOrdinal = 0;
- _panelContent = k0_PanelContentFoodWaterPoisoned;
+ _panelContent = kDMPanelContentFoodWaterPoisoned;
for (uint16 i = 0; i < 8; ++i)
_chestSlots[i] = Thing(0);
_openChest = Thing::_none;
@@ -168,7 +168,7 @@ void InventoryMan::drawStatusBoxPortrait(ChampionIndex championIndex) {
Box box;
box._rect.top = 0;
box._rect.bottom = 28;
- box._rect.left = championIndex * k69_ChampionStatusBoxSpacing + 7;
+ box._rect.left = championIndex * kDMChampionStatusBoxSpacing + 7;
box._rect.right = box._rect.left + 31;
dispMan.blitToScreen(_vm->_championMan->_champions[championIndex]._portrait, &box, k16_byteWidth, kDMColorNoTransparency, 29);
}
@@ -233,7 +233,7 @@ void InventoryMan::drawPanelFoodWaterPoisoned() {
}
void InventoryMan::drawPanelResurrectReincarnate() {
- _panelContent = k5_PanelContentResurrectReincarnate;
+ _panelContent = kDMPanelContentResurrectReincarnate;
_vm->_displayMan->blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k40_PanelResurectReincaranteIndice),
_boxPanel, k72_byteWidth, kDMColorDarkGreen, 73);
}
@@ -249,13 +249,13 @@ void InventoryMan::drawPanel() {
Thing thing = cm._champions[_vm->ordinalToIndex(_inventoryChampionOrdinal)].getSlot(kDMSlotActionHand);
- _panelContent = k0_PanelContentFoodWaterPoisoned;
+ _panelContent = kDMPanelContentFoodWaterPoisoned;
switch (thing.getType()) {
case kDMThingTypeContainer:
- _panelContent = k4_PanelContentChest;
+ _panelContent = kDMPanelContentChest;
break;
case kDMThingTypeScroll:
- _panelContent = k2_PanelContentScroll;
+ _panelContent = kDMPanelContentScroll;
break;
default:
thing = Thing::_none;
@@ -376,12 +376,12 @@ void InventoryMan::openAndDrawChest(Thing thingToOpen, Container *chest, bool is
if (++thingCount > 8)
break; // CHANGE8_08_FIX, make sure that no more than the first 8 objects in a chest are drawn
- objMan.drawIconInSlotBox(chestSlotIndex + k38_SlotBoxChestFirstSlot, objMan.getIconIndex(thing));
+ objMan.drawIconInSlotBox(chestSlotIndex + kDMSlotBoxChestFirstSlot, objMan.getIconIndex(thing));
_chestSlots[chestSlotIndex++] = thing;
thing = _vm->_dungeonMan->getNextThing(thing);
}
while (chestSlotIndex < 8) {
- objMan.drawIconInSlotBox(chestSlotIndex + k38_SlotBoxChestFirstSlot, kDMIconIndiceNone);
+ objMan.drawIconInSlotBox(chestSlotIndex + kDMSlotBoxChestFirstSlot, kDMIconIndiceNone);
_chestSlots[chestSlotIndex++] = Thing::_none;
}
}
@@ -535,7 +535,7 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {
uint16 actualAttribMask = 0;
switch (thingType) {
case kDMThingTypeWeapon: {
- potentialAttribMask = k0x0008_DescriptionMaskCursed | k0x0002_DescriptionMaskPoisoned | k0x0004_DescriptionMaskBroken;
+ potentialAttribMask = kDMDescriptionMaskCursed | kDMDescriptionMaskPoisoned | kDMDescriptionMaskBroken;
Weapon *weapon = (Weapon *)rawThingPtr;
actualAttribMask = (weapon->getCursed() << 3) | (weapon->getPoisoned() << 1) | (weapon->getBroken() << 2);
if ((iconIndex >= kDMIconIndiceWeaponTorchUnlit)
@@ -558,13 +558,13 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {
break;
}
case kDMThingTypeArmour: {
- potentialAttribMask = k0x0008_DescriptionMaskCursed | k0x0004_DescriptionMaskBroken;
+ potentialAttribMask = kDMDescriptionMaskCursed | kDMDescriptionMaskBroken;
Armour *armour = (Armour *)rawThingPtr;
actualAttribMask = (armour->getCursed() << 3) | (armour->getBroken() << 2);
break;
}
case kDMThingTypePotion: {
- potentialAttribMask = k0x0001_DescriptionMaskConsumable;
+ potentialAttribMask = kDMDescriptionMaskConsumable;
Potion *potion = (Potion *)rawThingPtr;
actualAttribMask = _vm->_dungeonMan->_objectInfos[kDMObjectInfoIndexFirstPotion + potion->getType()].getAllowedSlots();
break;
@@ -615,7 +615,7 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {
drawPanelObjectDescriptionString(str.c_str());
} else {
Junk *junk = (Junk *)rawThingPtr;
- potentialAttribMask = k0x0001_DescriptionMaskConsumable;
+ potentialAttribMask = kDMDescriptionMaskConsumable;
actualAttribMask = _vm->_dungeonMan->_objectInfos[kDMObjectInfoIndexFirstJunk + junk->getType()].getAllowedSlots();
}
break;
@@ -877,7 +877,7 @@ void InventoryMan::clickOnMouth() {
};
if (_vm->_championMan->_leaderEmptyHanded) {
- if (_panelContent == k0_PanelContentFoodWaterPoisoned)
+ if (_panelContent == kDMPanelContentFoodWaterPoisoned)
return;
_vm->_eventMan->_ignoreMouseMovements = true;
@@ -1021,7 +1021,7 @@ void InventoryMan::clickOnMouth() {
_vm->_sound->requestPlay(k08_soundSWALLOW, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayImmediately);
setFlag(curChampion->_attributes, kDMAttributeStatistics);
- if (_panelContent == k0_PanelContentFoodWaterPoisoned)
+ if (_panelContent == kDMPanelContentFoodWaterPoisoned)
setFlag(curChampion->_attributes, kDMAttributePanel);
_vm->_championMan->drawChampionState((ChampionIndex)championIndex);
diff --git a/engines/dm/inventory.h b/engines/dm/inventory.h
index c4685575c2..8819e5b109 100644
--- a/engines/dm/inventory.h
+++ b/engines/dm/inventory.h
@@ -35,21 +35,22 @@
namespace DM {
-#define k0x0001_DescriptionMaskConsumable 0x0001 // @ MASK0x0001_DESCRIPTION_CONSUMABLE
-#define k0x0002_DescriptionMaskPoisoned 0x0002 // @ MASK0x0002_DESCRIPTION_POISONED
-#define k0x0004_DescriptionMaskBroken 0x0004 // @ MASK0x0004_DESCRIPTION_BROKEN
-#define k0x0008_DescriptionMaskCursed 0x0008 // @ MASK0x0008_DESCRIPTION_CURSED
-
-#define k69_ChampionStatusBoxSpacing 69 // @ C69_CHAMPION_STATUS_BOX_SPACING
-#define k38_SlotBoxChestFirstSlot 38 // @ C38_SLOT_BOX_CHEST_FIRST_SLOT
+enum DescriptionMask {
+ kDMDescriptionMaskConsumable = 0x0001, // @ MASK0x0001_DESCRIPTION_CONSUMABLE
+ kDMDescriptionMaskPoisoned = 0x0002, // @ MASK0x0002_DESCRIPTION_POISONED
+ kDMDescriptionMaskBroken = 0x0004, // @ MASK0x0004_DESCRIPTION_BROKEN
+ kDMDescriptionMaskCursed = 0x0008 // @ MASK0x0008_DESCRIPTION_CURSED
+};
enum PanelContent {
- k0_PanelContentFoodWaterPoisoned = 0, // @ C00_PANEL_FOOD_WATER_POISONED
- k2_PanelContentScroll = 2, // @ C02_PANEL_SCROLL
- k4_PanelContentChest = 4, // @ C04_PANEL_CHEST
- k5_PanelContentResurrectReincarnate = 5 // @ C05_PANEL_RESURRECT_REINCARNATE
+ kDMPanelContentFoodWaterPoisoned = 0, // @ C00_PANEL_FOOD_WATER_POISONED
+ kDMPanelContentScroll = 2, // @ C02_PANEL_SCROLL
+ kDMPanelContentChest = 4, // @ C04_PANEL_CHEST
+ kDMPanelContentResurrectReincarnate = 5 // @ C05_PANEL_RESURRECT_REINCARNATE
};
+#define kDMChampionStatusBoxSpacing 69 // @ C69_CHAMPION_STATUS_BOX_SPACING
+
class InventoryMan {
DMEngine *_vm;
@@ -93,7 +94,6 @@ public:
void adjustStatisticCurrentValue(Champion *champ, uint16 statIndex, int16 valueDelta); // @ F0348_INVENTORY_AdjustStatisticCurrentValue
void clickOnEye(); // @ F0352_INVENTORY_ProcessCommand71_ClickOnEye
};
-
}
#endif
diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp
index 4a41136395..41579f4afe 100644
--- a/engines/dm/menus.cpp
+++ b/engines/dm/menus.cpp
@@ -231,7 +231,7 @@ void MenuMan::drawDisabledMenu() {
_vm->_eventMan->highlightBoxDisable();
_vm->_displayMan->_useByteBoxCoordinates = false;
if (_vm->_inventoryMan->_inventoryChampionOrdinal) {
- if (_vm->_inventoryMan->_panelContent == k4_PanelContentChest) {
+ if (_vm->_inventoryMan->_panelContent == kDMPanelContentChest) {
_vm->_inventoryMan->closeChest();
}
} else {
diff --git a/engines/dm/objectman.h b/engines/dm/objectman.h
index bb7d06c606..7a69d75566 100644
--- a/engines/dm/objectman.h
+++ b/engines/dm/objectman.h
@@ -35,7 +35,6 @@ namespace DM {
#define k8_SlotBoxInventoryFirstSlot 8 // @ C08_SLOT_BOX_INVENTORY_FIRST_SLOT
#define k9_SlotBoxInventoryActionHand 9 // @ C09_SLOT_BOX_INVENTORY_ACTION_HAND
-#define k38_SlotBoxChestFirstSlot 38 // @ C38_SLOT_BOX_CHEST_FIRST_SLOT
#define k14_ObjectNameMaximumLength 14 // @ C014_OBJECT_NAME_MAXIMUM_LENGTH
#define k199_ObjectNameCount 199 // @ C199_OBJECT_NAME_COUNT
diff --git a/engines/dm/projexpl.cpp b/engines/dm/projexpl.cpp
index 33ae021280..f692e70656 100644
--- a/engines/dm/projexpl.cpp
+++ b/engines/dm/projexpl.cpp
@@ -516,7 +516,7 @@ void ProjExpl::processEvent25(TimelineEvent *event) {
nonMaterialAdditionalAttack++;
int16 creatureCount = group->getCount();
do {
- if (getFlag(_vm->_groupMan->_activeGroups[group->getActiveGroupIndex()]._aspect[creatureCount], k0x0080_MaskActiveGroupIsAttacking)) /* Materializer / Zytaz can only be damaged while they are attacking */
+ if (getFlag(_vm->_groupMan->_activeGroups[group->getActiveGroupIndex()]._aspect[creatureCount], kDMAspectMaskActiveGroupIsAttacking)) /* Materializer / Zytaz can only be damaged while they are attacking */
_vm->_groupMan->groupGetDamageCreatureOutcome(group, creatureCount, mapX, mapY, attack + _vm->getRandomNumber(nonMaterialAdditionalAttack) + _vm->getRandomNumber(4), true);
} while (--creatureCount >= 0);
} else