[Scummvm-git-logs] scummvm master -> ed9b88354313bf19f867be098b06354c4c1682b3
Strangerke
Strangerke at scummvm.org
Mon Sep 12 22:56:35 CEST 2016
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
668142e905 DM: Change the declaration of addEvent
4e28542029 DM: Rename some enums in DungeonMan
edf6e4f2d9 DM: Enforce the use of SoundMode
ed9b883543 DM: more renaming in DungeonMan
Commit: 668142e9055f491159d552ae0df27fa5c752f4f3
https://github.com/scummvm/scummvm/commit/668142e9055f491159d552ae0df27fa5c752f4f3
Author: Strangerke (strangerke at scummvm.org)
Date: 2016-09-12T22:37:48+02:00
Commit Message:
DM: Change the declaration of addEvent
Changed paths:
engines/dm/movesens.cpp
engines/dm/movesens.h
diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp
index 2ab4b4b..bd95c7f 100644
--- a/engines/dm/movesens.cpp
+++ b/engines/dm/movesens.cpp
@@ -582,7 +582,7 @@ T0266017_CheckProjectileImpacts:
return false;
}
-void MovesensMan::addEvent(byte type, byte mapX, byte mapY, Cell cell, byte effect, int32 time) {
+void MovesensMan::addEvent(byte type, byte mapX, byte mapY, Cell cell, SensorEffect effect, int32 time) {
TimelineEvent newEvent;
_vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_currMapIndex, time);
newEvent._type = type;
diff --git a/engines/dm/movesens.h b/engines/dm/movesens.h
index 7c2a6bb..f82ad18 100644
--- a/engines/dm/movesens.h
+++ b/engines/dm/movesens.h
@@ -64,7 +64,7 @@ public:
bool getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destMapX, int16 destMapY); // @ F0267_MOVE_GetMoveResult_CPSCE
bool isLevitating(Thing thing); // @ F0264_MOVE_IsLevitating
bool moveIsKilledByProjectileImpact(int16 srcMapX, int16 srcMapY, int16 destMapX, int16 destMapY, Thing thing); // @ F0266_MOVE_IsKilledByProjectileImpact
- void addEvent(byte type, byte mapX, byte mapY, Cell cell, byte effect, int32 time); // @ F0268_SENSOR_AddEvent
+ void addEvent(byte type, byte mapX, byte mapY, Cell cell, SensorEffect effect, int32 time); // @ F0268_SENSOR_AddEvent
int16 getSound(byte creatureType); // @ F0514_MOVE_GetSound
int16 getTeleporterRotatedGroupResult(Teleporter *teleporter, Thing thing, uint16 mapIndex);// @ F0262_MOVE_GetTeleporterRotatedGroupResult
Thing getTeleporterRotatedProjectileThing(Teleporter *teleporter, Thing projectileThing); // @ F0263_MOVE_GetTeleporterRotatedProjectileThing
Commit: 4e28542029792a495a4420e5feda6030c67365da
https://github.com/scummvm/scummvm/commit/4e28542029792a495a4420e5feda6030c67365da
Author: Strangerke (strangerke at scummvm.org)
Date: 2016-09-12T22:37:51+02:00
Commit Message:
DM: Rename some enums in DungeonMan
Changed paths:
engines/dm/champion.cpp
engines/dm/dungeonman.cpp
engines/dm/dungeonman.h
engines/dm/eventman.cpp
engines/dm/group.cpp
engines/dm/inventory.cpp
engines/dm/menus.cpp
engines/dm/projexpl.cpp
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp
index da477a1..fb77c09 100644
--- a/engines/dm/champion.cpp
+++ b/engines/dm/champion.cpp
@@ -1472,7 +1472,7 @@ void ChampionMan::championKill(uint16 champIndex) {
uint16 curCell = 0;
if (unusedThing != Thing::_none) {
Junk *L0966_ps_Junk = (Junk *)_vm->_dungeonMan->getThingData(unusedThing);
- L0966_ps_Junk->setType(k5_JunkTypeBones);
+ L0966_ps_Junk->setType(kDMJunkTypeBones);
L0966_ps_Junk->setDoNotDiscard(true);
L0966_ps_Junk->setChargeCount(champIndex);
curCell = curChampion->_cell;
diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp
index 7497985..a9658b8 100644
--- a/engines/dm/dungeonman.cpp
+++ b/engines/dm/dungeonman.cpp
@@ -1257,7 +1257,7 @@ uint16 DungeonMan::getObjectWeight(Thing thing) {
break;
case kDMThingTypeJunk:
weight = junkInfo[junk->getType()];
- if (junk->getType() == k1_JunkTypeWaterskin)
+ if (junk->getType() == kDMJunkTypeWaterskin)
weight += junk->getChargeCount() << 1;
break;
@@ -1270,7 +1270,7 @@ uint16 DungeonMan::getObjectWeight(Thing thing) {
}
break;
case kDMThingTypePotion:
- if (((Potion *)junk)->getType() == k20_PotionTypeEmptyFlask)
+ if (((Potion *)junk)->getType() == kDMPotionTypeEmptyFlask)
weight = 1;
else
weight = 3;
@@ -1627,7 +1627,7 @@ Thing DungeonMan::getObjForProjectileLaucherOrObjGen(uint16 iconIndex) {
junkType = kDMWeaponRock;
break;
case kDMIconIndiceJunkBoulder:
- junkType = k25_JunkTypeBoulder;
+ junkType = kDMJunkTypeBoulder;
thingType = kDMThingTypeJunk;
break;
case kDMIconIndiceWeaponArrow:
diff --git a/engines/dm/dungeonman.h b/engines/dm/dungeonman.h
index cfa16b0..6eb34f2 100644
--- a/engines/dm/dungeonman.h
+++ b/engines/dm/dungeonman.h
@@ -186,38 +186,40 @@ enum ArmourType {
};
enum PotionType {
- k3_PotionTypeVen = 3, // @ C03_POTION_VEN_POTION,
- k6_PotionTypeRos = 6, // @ C06_POTION_ROS_POTION,
- k7_PotionTypeKu = 7, // @ C07_POTION_KU_POTION,
- k8_PotionTypeDane = 8, // @ C08_POTION_DANE_POTION,
- k9_PotionTypeNeta = 9, // @ C09_POTION_NETA_POTION,
- k10_PotionTypeAntivenin = 10, // @ C10_POTION_ANTIVENIN,
- k11_PotionTypeMon = 11, // @ C11_POTION_MON_POTION,
- k12_PotionTypeYa = 12, // @ C12_POTION_YA_POTION,
- k13_PotionTypeEe = 13, // @ C13_POTION_EE_POTION,
- k14_PotionTypeVi = 14, // @ C14_POTION_VI_POTION,
- k15_PotionTypeWaterFlask = 15, // @ C15_POTION_WATER_FLASK,
- k19_PotionTypeFulBomb = 19, // @ C19_POTION_FUL_BOMB,
- k20_PotionTypeEmptyFlask = 20 // @ C20_POTION_EMPTY_FLASK,
+ kDMPotionTypeVen = 3, // @ C03_POTION_VEN_POTION,
+ kDMPotionTypeRos = 6, // @ C06_POTION_ROS_POTION,
+ kDMPotionTypeKu = 7, // @ C07_POTION_KU_POTION,
+ kDMPotionTypeDane = 8, // @ C08_POTION_DANE_POTION,
+ kDMPotionTypeNeta = 9, // @ C09_POTION_NETA_POTION,
+ kDMPotionTypeAntivenin = 10, // @ C10_POTION_ANTIVENIN,
+ kDMPotionTypeMon = 11, // @ C11_POTION_MON_POTION,
+ kDMPotionTypeYa = 12, // @ C12_POTION_YA_POTION,
+ kDMPotionTypeEe = 13, // @ C13_POTION_EE_POTION,
+ kDMPotionTypeVi = 14, // @ C14_POTION_VI_POTION,
+ kDMPotionTypeWaterFlask = 15, // @ C15_POTION_WATER_FLASK,
+ kDMPotionTypeFulBomb = 19, // @ C19_POTION_FUL_BOMB,
+ kDMPotionTypeEmptyFlask = 20 // @ C20_POTION_EMPTY_FLASK,
};
enum JunkType {
- k1_JunkTypeWaterskin = 1, // @ C01_JUNK_WATERSKIN,
- k5_JunkTypeBones = 5, // @ C05_JUNK_BONES,
- k25_JunkTypeBoulder = 25, // @ C25_JUNK_BOULDER,
- k33_JunkTypeScreamerSlice = 33, // @ C33_JUNK_SCREAMER_SLICE,
- k34_JunkTypeWormRound = 34, // @ C34_JUNK_WORM_ROUND,
- k35_JunkTypeDrumstickShank = 35, // @ C35_JUNK_DRUMSTICK_SHANK,
- k36_JunkTypeDragonSteak = 36, // @ C36_JUNK_DRAGON_STEAK,
- k42_JunkTypeMagicalBoxBlue = 42, // @ C42_JUNK_MAGICAL_BOX_BLUE,
- k43_JunkTypeMagicalBoxGreen = 43, // @ C43_JUNK_MAGICAL_BOX_GREEN,
- k51_JunkTypeZokathra = 51 // @ C51_JUNK_ZOKATHRA,
+ kDMJunkTypeWaterskin = 1, // @ C01_JUNK_WATERSKIN,
+ kDMJunkTypeBones = 5, // @ C05_JUNK_BONES,
+ kDMJunkTypeBoulder = 25, // @ C25_JUNK_BOULDER,
+ kDMJunkTypeScreamerSlice = 33, // @ C33_JUNK_SCREAMER_SLICE,
+ kDMJunkTypeWormRound = 34, // @ C34_JUNK_WORM_ROUND,
+ kDMJunkTypeDrumstickShank = 35, // @ C35_JUNK_DRUMSTICK_SHANK,
+ kDMJunkTypeDragonSteak = 36, // @ C36_JUNK_DRAGON_STEAK,
+ kDMJunkTypeMagicalBoxBlue = 42, // @ C42_JUNK_MAGICAL_BOX_BLUE,
+ kDMJunkTypeMagicalBoxGreen = 43, // @ C43_JUNK_MAGICAL_BOX_GREEN,
+ kDMJunkTypeZokathra = 51 // @ C51_JUNK_ZOKATHRA,
};
-#define kM1_soundModeDoNotPlaySound -1 // @ CM1_MODE_DO_NOT_PLAY_SOUND
-#define k0_soundModePlayImmediately 0 // @ C00_MODE_PLAY_IMMEDIATELY
-#define k1_soundModePlayIfPrioritized 1 // @ C01_MODE_PLAY_IF_PRIORITIZED
-#define k2_soundModePlayOneTickLater 2 // @ C02_MODE_PLAY_ONE_TICK_LATER
+enum SoundMode {
+ kM1_soundModeDoNotPlaySound = -1, // @ CM1_MODE_DO_NOT_PLAY_SOUND
+ k0_soundModePlayImmediately = 0, // @ C00_MODE_PLAY_IMMEDIATELY
+ k1_soundModePlayIfPrioritized = 1, // @ C01_MODE_PLAY_IF_PRIORITIZED
+ k2_soundModePlayOneTickLater = 2 // @ C02_MODE_PLAY_ONE_TICK_LATER
+};
#define k0_ExplosionType_Fireball 0 // @ C000_EXPLOSION_FIREBALL
#define k1_ExplosionType_Slime 1 // @ C001_EXPLOSION_SLIME
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp
index 5d36424..08882ad 100644
--- a/engines/dm/eventman.cpp
+++ b/engines/dm/eventman.cpp
@@ -1214,7 +1214,7 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY
if ((iconIdx >= kDMIconIndiceJunkWater) && (iconIdx <= kDMIconIndiceJunkWaterSkin))
junkPtr->setChargeCount(3); /* Full */
else if (iconIdx == kDMIconIndicePotionEmptyFlask)
- ((Potion*)junkPtr)->setType(k15_PotionTypeWaterFlask);
+ ((Potion*)junkPtr)->setType(kDMPotionTypeWaterFlask);
else {
commandProcessType80ClickInDungeonViewTouchFrontWall();
return;
diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp
index 9e7335c..93fb718 100644
--- a/engines/dm/group.cpp
+++ b/engines/dm/group.cpp
@@ -191,39 +191,39 @@ void GroupMan::dropCreatureFixedPossessions(uint16 creatureType, int16 mapX, int
0
};
static uint16 fixedPossessionCreature7rockRockPile[5] = { // @ G0249_aui_Graphic559_FixedPossessionsCreature07Rock_RockPile
- kDMObjectInfoIndexFirstJunk + k25_JunkTypeBoulder,
- kDMObjectInfoIndexFirstJunk + k25_JunkTypeBoulder | kDMMaskRandomDrop,
+ kDMObjectInfoIndexFirstJunk + kDMJunkTypeBoulder,
+ kDMObjectInfoIndexFirstJunk + kDMJunkTypeBoulder | kDMMaskRandomDrop,
kDMObjectInfoIndexFirstWeapon + kDMWeaponRock | kDMMaskRandomDrop,
kDMObjectInfoIndexFirstWeapon + kDMWeaponRock | kDMMaskRandomDrop,
0
};
static uint16 fixedPossessionCreature4PainRatHellHound[3] = { // @ G0250_aui_Graphic559_FixedPossessionsCreature04PainRat_Hellhound
- kDMObjectInfoIndexFirstJunk + k35_JunkTypeDrumstickShank,
- kDMObjectInfoIndexFirstJunk + k35_JunkTypeDrumstickShank | kDMMaskRandomDrop,
+ kDMObjectInfoIndexFirstJunk + kDMJunkTypeDrumstickShank,
+ kDMObjectInfoIndexFirstJunk + kDMJunkTypeDrumstickShank | kDMMaskRandomDrop,
0
};
static uint16 fixedPossessionCreature6screamer[3] = { // @ G0251_aui_Graphic559_FixedPossessionsCreature06Screamer
- kDMObjectInfoIndexFirstJunk + k33_JunkTypeScreamerSlice,
- kDMObjectInfoIndexFirstJunk + k33_JunkTypeScreamerSlice | kDMMaskRandomDrop,
+ kDMObjectInfoIndexFirstJunk + kDMJunkTypeScreamerSlice,
+ kDMObjectInfoIndexFirstJunk + kDMJunkTypeScreamerSlice | kDMMaskRandomDrop,
0
};
static uint16 fixedPossessionCreature15MagnetaWormWorm[4] = { // @ G0252_aui_Graphic559_FixedPossessionsCreature15MagentaWorm_Worm
- kDMObjectInfoIndexFirstJunk + k34_JunkTypeWormRound,
- kDMObjectInfoIndexFirstJunk + k34_JunkTypeWormRound | kDMMaskRandomDrop,
- kDMObjectInfoIndexFirstJunk + k34_JunkTypeWormRound | kDMMaskRandomDrop,
+ kDMObjectInfoIndexFirstJunk + kDMJunkTypeWormRound,
+ kDMObjectInfoIndexFirstJunk + kDMJunkTypeWormRound | kDMMaskRandomDrop,
+ kDMObjectInfoIndexFirstJunk + kDMJunkTypeWormRound | kDMMaskRandomDrop,
0
};
static uint16 fixedPossessionCreature24RedDragon[11] = { // @ G0253_aui_Graphic559_FixedPossessionsCreature24RedDragon
- kDMObjectInfoIndexFirstJunk + k36_JunkTypeDragonSteak,
- kDMObjectInfoIndexFirstJunk + k36_JunkTypeDragonSteak,
- kDMObjectInfoIndexFirstJunk + k36_JunkTypeDragonSteak,
- kDMObjectInfoIndexFirstJunk + k36_JunkTypeDragonSteak,
- kDMObjectInfoIndexFirstJunk + k36_JunkTypeDragonSteak,
- kDMObjectInfoIndexFirstJunk + k36_JunkTypeDragonSteak,
- kDMObjectInfoIndexFirstJunk + k36_JunkTypeDragonSteak,
- kDMObjectInfoIndexFirstJunk + k36_JunkTypeDragonSteak,
- kDMObjectInfoIndexFirstJunk + k36_JunkTypeDragonSteak | kDMMaskRandomDrop,
- kDMObjectInfoIndexFirstJunk + k36_JunkTypeDragonSteak | kDMMaskRandomDrop, 0};
+ kDMObjectInfoIndexFirstJunk + kDMJunkTypeDragonSteak,
+ kDMObjectInfoIndexFirstJunk + kDMJunkTypeDragonSteak,
+ kDMObjectInfoIndexFirstJunk + kDMJunkTypeDragonSteak,
+ kDMObjectInfoIndexFirstJunk + kDMJunkTypeDragonSteak,
+ kDMObjectInfoIndexFirstJunk + kDMJunkTypeDragonSteak,
+ kDMObjectInfoIndexFirstJunk + kDMJunkTypeDragonSteak,
+ kDMObjectInfoIndexFirstJunk + kDMJunkTypeDragonSteak,
+ kDMObjectInfoIndexFirstJunk + kDMJunkTypeDragonSteak,
+ kDMObjectInfoIndexFirstJunk + kDMJunkTypeDragonSteak | kDMMaskRandomDrop,
+ kDMObjectInfoIndexFirstJunk + kDMJunkTypeDragonSteak | kDMMaskRandomDrop, 0};
uint16 *fixedPossessions;
bool cursedPossessions = false;
diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp
index 1efc905..ca4734b 100644
--- a/engines/dm/inventory.cpp
+++ b/engines/dm/inventory.cpp
@@ -931,25 +931,25 @@ void InventoryMan::clickOnMouth() {
uint16 adjustedPotionPower = (potionPower / 25) + 8; /* Value between 8 and 18 */
switch (((Potion *)junkData)->getType()) {
- case k6_PotionTypeRos:
+ case kDMPotionTypeRos:
adjustStatisticCurrentValue(curChampion, kDMStatDexterity, adjustedPotionPower);
break;
- case k7_PotionTypeKu:
+ case kDMPotionTypeKu:
adjustStatisticCurrentValue(curChampion, kDMStatStrength, (((Potion *)junkData)->getPower() / 35) + 5); /* Value between 5 and 12 */
break;
- case k8_PotionTypeDane:
+ case kDMPotionTypeDane:
adjustStatisticCurrentValue(curChampion, kDMStatWisdom, adjustedPotionPower);
break;
- case k9_PotionTypeNeta:
+ case kDMPotionTypeNeta:
adjustStatisticCurrentValue(curChampion, kDMStatVitality, adjustedPotionPower);
break;
- case k10_PotionTypeAntivenin:
+ case kDMPotionTypeAntivenin:
_vm->_championMan->unpoison(championIndex);
break;
- case k11_PotionTypeMon:
+ case kDMPotionTypeMon:
curChampion->_currStamina += MIN(curChampion->_maxStamina - curChampion->_currStamina, curChampion->_maxStamina / counter);
break;
- case k12_PotionTypeYa: {
+ case kDMPotionTypeYa: {
adjustedPotionPower += adjustedPotionPower >> 1;
if (curChampion->_shieldDefense > 50)
adjustedPotionPower >>= 2;
@@ -964,7 +964,7 @@ void InventoryMan::clickOnMouth() {
setFlag(curChampion->_attributes, kDMAttributeStatusBox);
}
break;
- case k13_PotionTypeEe: {
+ case kDMPotionTypeEe: {
uint16 mana = MIN(900, (curChampion->_currMana + adjustedPotionPower) + (adjustedPotionPower - 8));
if (mana > curChampion->_maxMana)
mana -= (mana - MAX(curChampion->_currMana, curChampion->_maxMana)) >> 1;
@@ -972,7 +972,7 @@ void InventoryMan::clickOnMouth() {
curChampion->_currMana = mana;
}
break;
- case k14_PotionTypeVi: {
+ case kDMPotionTypeVi: {
uint16 healWoundIterationCount = MAX(1, (((Potion *)junkData)->getPower() / 42));
curChampion->_currHealth += curChampion->_maxHealth / counter;
int16 wounds = curChampion->_wounds;
@@ -988,13 +988,13 @@ void InventoryMan::clickOnMouth() {
setFlag(curChampion->_attributes, kDMAttributeLoad | kDMAttributeWounds);
}
break;
- case k15_PotionTypeWaterFlask:
+ case kDMPotionTypeWaterFlask:
curChampion->_water = MIN(curChampion->_water + 1600, 2048);
break;
default:
break;
}
- ((Potion *)junkData)->setType(k20_PotionTypeEmptyFlask);
+ ((Potion *)junkData)->setType(kDMPotionTypeEmptyFlask);
} else if ((iconIndex >= kDMIconIndiceJunkApple) && (iconIndex < kDMIconIndiceJunkIronKey))
curChampion->_food = MIN(curChampion->_food + foodAmounts[iconIndex - kDMIconIndiceJunkApple], 2048);
diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp
index 8eeca98..0009458 100644
--- a/engines/dm/menus.cpp
+++ b/engines/dm/menus.cpp
@@ -655,7 +655,7 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
break;
Junk *junkData = (Junk *)_vm->_dungeonMan->getThingData(unusedObject);
- junkData->setType(k51_JunkTypeZokathra);
+ junkData->setType(kDMJunkTypeZokathra);
ChampionSlot slotIndex;
if (curChampion->_slots[kDMSlotReadyHand] == Thing::_none)
slotIndex = kDMSlotReadyHand;
@@ -1300,11 +1300,11 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
break;
case kDMActionFreezeLife: {
int16 freezeTicks;
- if (weaponInHand->getType() == (int)k42_JunkTypeMagicalBoxBlue) {
+ if (weaponInHand->getType() == (int)kDMJunkTypeMagicalBoxBlue) {
freezeTicks = 30;
_vm->_championMan->getObjectRemovedFromSlot(champIndex, kDMSlotActionHand);
weaponInHand->setNextThing(Thing::_none);
- } else if (weaponInHand->getType() == (int)k43_JunkTypeMagicalBoxGreen) {
+ } else if (weaponInHand->getType() == (int)kDMJunkTypeMagicalBoxGreen) {
freezeTicks = 125;
_vm->_championMan->getObjectRemovedFromSlot(champIndex, kDMSlotActionHand);
weaponInHand->setNextThing(Thing::_none);
diff --git a/engines/dm/projexpl.cpp b/engines/dm/projexpl.cpp
index 7f8696f..97463b6 100644
--- a/engines/dm/projexpl.cpp
+++ b/engines/dm/projexpl.cpp
@@ -84,8 +84,8 @@ bool ProjExpl::hasProjectileImpactOccurred(int16 impactType, int16 mapXCombo, in
if (projectileAssociatedThingType == kDMThingTypePotion) {
Group *projectileAssociatedGroup = (Group *)_vm->_dungeonMan->getThingData(projectileAssociatedThing);
PotionType potionType = ((Potion *)projectileAssociatedGroup)->getType();
- if ((potionType == k3_PotionTypeVen) || (potionType == k19_PotionTypeFulBomb)) {
- explosionThing = (potionType == k3_PotionTypeVen) ? Thing::_explPoisonCloud: Thing::_explFireBall;
+ if ((potionType == kDMPotionTypeVen) || (potionType == kDMPotionTypeFulBomb)) {
+ explosionThing = (potionType == kDMPotionTypeVen) ? Thing::_explPoisonCloud: Thing::_explFireBall;
removePotion = true;
potionPower = ((Potion *)projectileAssociatedGroup)->getPower();
potion = (Potion *)projectileAssociatedGroup;
Commit: edf6e4f2d97794adf2af246c5577d46b1055472d
https://github.com/scummvm/scummvm/commit/edf6e4f2d97794adf2af246c5577d46b1055472d
Author: Strangerke (strangerke at scummvm.org)
Date: 2016-09-12T22:37:54+02:00
Commit Message:
DM: Enforce the use of SoundMode
Changed paths:
engines/dm/champion.cpp
engines/dm/dm.cpp
engines/dm/dungeonman.cpp
engines/dm/dungeonman.h
engines/dm/eventman.cpp
engines/dm/group.cpp
engines/dm/group.h
engines/dm/inventory.cpp
engines/dm/menus.cpp
engines/dm/movesens.cpp
engines/dm/projexpl.cpp
engines/dm/sounds.cpp
engines/dm/sounds.h
engines/dm/timeline.cpp
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp
index fb77c09..fc3131f 100644
--- a/engines/dm/champion.cpp
+++ b/engines/dm/champion.cpp
@@ -217,7 +217,7 @@ bool ChampionMan::isObjectThrown(uint16 champIndex, int16 slotIndex, int16 side)
return false;
}
- _vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized);
decrementStamina(champIndex, getThrowingStaminaCost(curThing));
disableAction(champIndex, 4);
int16 experience = 8;
diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp
index b8c1a80..2eed7b8 100644
--- a/engines/dm/dm.cpp
+++ b/engines/dm/dm.cpp
@@ -596,7 +596,7 @@ void DMEngine::endGame(bool doNotDrawCreditsOnly) {
_eventMan->_primaryKeyboardInput = nullptr;
_eventMan->_secondaryKeyboardInput = nullptr;
if (doNotDrawCreditsOnly && !_gameWon) {
- _sound->requestPlay(k06_soundSCREAM, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY, k0_soundModePlayImmediately);
+ _sound->requestPlay(k06_soundSCREAM, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY, kDMSoundModePlayImmediately);
delay(240);
}
@@ -940,7 +940,7 @@ void DMEngine::fuseSequence() {
_projexpl->createExplosion(Thing::_explFireBall, attackId, lordChaosMapX, lordChaosMapY, k255_CreatureTypeSingleCenteredCreature);
fuseSequenceUpdate();
}
- _sound->requestPlay(k17_soundBUZZ, lordChaosMapX, lordChaosMapY, k1_soundModePlayIfPrioritized);
+ _sound->requestPlay(k17_soundBUZZ, lordChaosMapX, lordChaosMapY, kDMSoundModePlayIfPrioritized);
lordGroup->_type = k25_CreatureTypeLordOrder;
fuseSequenceUpdate();
for (int16 attackId = 55; attackId <= 255; attackId += 40) {
@@ -949,7 +949,7 @@ void DMEngine::fuseSequence() {
}
for (int16 cycleCount = 3; cycleCount > 0; cycleCount--) {
for (int16 switchCount = 4; switchCount > 0; switchCount--) {
- _sound->requestPlay(k17_soundBUZZ, lordChaosMapX, lordChaosMapY, k1_soundModePlayIfPrioritized);
+ _sound->requestPlay(k17_soundBUZZ, lordChaosMapX, lordChaosMapY, kDMSoundModePlayIfPrioritized);
lordGroup->_type = (switchCount & 0x0001) ? k25_CreatureTypeLordOrder : k23_CreatureTypeLordChaos;
for (int16 fuseSequenceUpdateCount = cycleCount - 1; fuseSequenceUpdateCount >= 0; fuseSequenceUpdateCount--)
fuseSequenceUpdate();
diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp
index a9658b8..6dc5a73 100644
--- a/engines/dm/dungeonman.cpp
+++ b/engines/dm/dungeonman.cpp
@@ -1455,7 +1455,7 @@ Thing DungeonMan::getDiscardThing(uint16 thingType) {
case kDMThingTypeProjectile:
setCurrentMap(mapIndex);
if (thingType == kDMThingTypeGroup) {
- _vm->_groupMan->dropGroupPossessions(currMapX, currMapY, squareThing, kM1_soundModeDoNotPlaySound);
+ _vm->_groupMan->dropGroupPossessions(currMapX, currMapY, squareThing, kDMSoundModeDoNotPlaySound);
_vm->_groupMan->groupDelete(currMapX, currMapY);
} else {
_vm->_projexpl->projectileDeleteEvent(squareThing);
diff --git a/engines/dm/dungeonman.h b/engines/dm/dungeonman.h
index 6eb34f2..471a3b8 100644
--- a/engines/dm/dungeonman.h
+++ b/engines/dm/dungeonman.h
@@ -214,13 +214,6 @@ enum JunkType {
kDMJunkTypeZokathra = 51 // @ C51_JUNK_ZOKATHRA,
};
-enum SoundMode {
- kM1_soundModeDoNotPlaySound = -1, // @ CM1_MODE_DO_NOT_PLAY_SOUND
- k0_soundModePlayImmediately = 0, // @ C00_MODE_PLAY_IMMEDIATELY
- k1_soundModePlayIfPrioritized = 1, // @ C01_MODE_PLAY_IF_PRIORITIZED
- k2_soundModePlayOneTickLater = 2 // @ C02_MODE_PLAY_ONE_TICK_LATER
-};
-
#define k0_ExplosionType_Fireball 0 // @ C000_EXPLOSION_FIREBALL
#define k1_ExplosionType_Slime 1 // @ C001_EXPLOSION_SLIME
#define k2_ExplosionType_LightningBolt 2 // @ C002_EXPLOSION_LIGHTNING_BOLT
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp
index 08882ad..4cbcff3 100644
--- a/engines/dm/eventman.cpp
+++ b/engines/dm/eventman.cpp
@@ -1028,7 +1028,7 @@ void EventManager::commandMoveParty(CommandType cmdType) {
damage |= _vm->_championMan->addPendingDamageAndWounds_getDamage(secondDamagedChampionIndex, 1, kDMWoundTorso | kDMWoundLegs, kDMAttackTypeSelf);
if (damage)
- _vm->_sound->requestPlay(k18_soundPARTY_DAMAGED, partyMapX, partyMapY, k0_soundModePlayImmediately);
+ _vm->_sound->requestPlay(k18_soundPARTY_DAMAGED, partyMapX, partyMapY, kDMSoundModePlayImmediately);
} else {
isMovementBlocked = (_vm->_groupMan->groupGetThing(partyMapX, partyMapY) != Thing::_endOfList);
if (isMovementBlocked)
@@ -1174,7 +1174,7 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY
Junk *junkPtr = (Junk*)_vm->_dungeonMan->getSquareFirstThingData(mapX, mapY);
if ((((Door*)junkPtr)->hasButton()) && _vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn].isPointInside(posX, posY - 33)) {
_vm->_stopWaitingForPlayerInput = true;
- _vm->_sound->requestPlay(k01_soundSWITCH, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(k01_soundSWITCH, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized);
_vm->_moveSens->addEvent(k10_TMEventTypeDoor, mapX, mapY, kDMCellNorthWest, kDMSensorEffectToggle, _vm->_gameTime + 1);
return;
}
diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp
index 93fb718..1503d48 100644
--- a/engines/dm/group.cpp
+++ b/engines/dm/group.cpp
@@ -137,37 +137,37 @@ uint16 GroupMan::getCreatureValue(uint16 groupVal, uint16 creatureIndex) {
return (groupVal >> (creatureIndex << 1)) & 0x3;
}
-void GroupMan::dropGroupPossessions(int16 mapX, int16 mapY, Thing groupThing, int16 mode) {
+void GroupMan::dropGroupPossessions(int16 mapX, int16 mapY, Thing groupThing, SoundMode soundMode) {
Group *group = (Group *)_vm->_dungeonMan->getThingData(groupThing);
uint16 creatureType = group->_type;
- if ((mode >= k0_soundModePlayImmediately) && getFlag(_vm->_dungeonMan->_creatureInfos[creatureType]._attributes, k0x0200_MaskCreatureInfo_dropFixedPoss)) {
+ if ((soundMode != kDMSoundModeDoNotPlaySound) && getFlag(_vm->_dungeonMan->_creatureInfos[creatureType]._attributes, k0x0200_MaskCreatureInfo_dropFixedPoss)) {
int16 creatureIndex = group->getCount();
uint16 groupCells = getGroupCells(group, _vm->_dungeonMan->_currMapIndex);
do {
dropCreatureFixedPossessions(creatureType, mapX, mapY,
- (groupCells == k255_CreatureTypeSingleCenteredCreature) ? k255_CreatureTypeSingleCenteredCreature : getCreatureValue(groupCells, creatureIndex), mode);
+ (groupCells == k255_CreatureTypeSingleCenteredCreature) ? k255_CreatureTypeSingleCenteredCreature : getCreatureValue(groupCells, creatureIndex), soundMode);
} while (creatureIndex--);
}
Thing currentThing = group->_slot;
if ((currentThing) != Thing::_endOfList) {
- bool L0371_B_WeaponDropped = false;
+ bool weaponDropped = false;
Thing nextThing;
do {
nextThing = _vm->_dungeonMan->getNextThing(currentThing);
currentThing = _vm->thingWithNewCell(currentThing, _vm->getRandomNumber(4));
if ((currentThing).getType() == kDMThingTypeWeapon) {
- L0371_B_WeaponDropped = true;
+ weaponDropped = true;
}
_vm->_moveSens->getMoveResult(currentThing, kDMMapXNotOnASquare, 0, mapX, mapY);
} while ((currentThing = nextThing) != Thing::_endOfList);
- if (mode >= k0_soundModePlayImmediately)
- _vm->_sound->requestPlay(L0371_B_WeaponDropped ? k00_soundMETALLIC_THUD : k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, mapX, mapY, mode);
+ if (soundMode != kDMSoundModeDoNotPlaySound)
+ _vm->_sound->requestPlay(weaponDropped ? k00_soundMETALLIC_THUD : k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, mapX, mapY, soundMode);
}
}
-void GroupMan::dropCreatureFixedPossessions(uint16 creatureType, int16 mapX, int16 mapY, uint16 cell, int16 mode) {
+void GroupMan::dropCreatureFixedPossessions(uint16 creatureType, int16 mapX, int16 mapY, uint16 cell, SoundMode soundMode) {
static uint16 fixedPossessionCreature12Skeleton[3] = { // @ G0245_aui_Graphic559_FixedPossessionsCreature12Skeleton
kDMObjectInfoIndexFirstWeapon + kDMWeaponFalchion,
kDMObjectInfoIndexFirstArmour + kDMArmourWoodenShield,
@@ -291,7 +291,7 @@ void GroupMan::dropCreatureFixedPossessions(uint16 creatureType, int16 mapX, int
_vm->_moveSens->getMoveResult(nextUnusedThing, kDMMapXNotOnASquare, 0, mapX, mapY);
currFixedPossession = *fixedPossessions++;
}
- _vm->_sound->requestPlay(weaponDropped ? k00_soundMETALLIC_THUD : k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, mapX, mapY, mode);
+ _vm->_sound->requestPlay(weaponDropped ? k00_soundMETALLIC_THUD : k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, mapX, mapY, soundMode);
}
int16 GroupMan::getDirsWhereDestIsVisibleFromSource(int16 srcMapX, int16 srcMapY, int16 destMapX, int16 destMapY) {
@@ -397,7 +397,7 @@ int16 GroupMan::groupGetDamageCreatureOutcome(Group *group, uint16 creatureIndex
if (!creatureCount) { /* If there is a single creature in the group */
if (notMoving) {
- dropGroupPossessions(mapX, mapY, groupGetThing(mapX, mapY), k2_soundModePlayOneTickLater);
+ dropGroupPossessions(mapX, mapY, groupGetThing(mapX, mapY), kDMSoundModePlayOneTickLater);
groupDelete(mapX, mapY);
}
retVal = k2_outcomeKilledAllCreaturesInGroup;
@@ -405,7 +405,7 @@ int16 GroupMan::groupGetDamageCreatureOutcome(Group *group, uint16 creatureIndex
uint16 groupDirections = getGroupDirections(group, _vm->_dungeonMan->_currMapIndex);
if (getFlag(creatureInfo->_attributes, k0x0200_MaskCreatureInfo_dropFixedPoss)) {
if (notMoving)
- dropCreatureFixedPossessions(creatureType, mapX, mapY, cell, k2_soundModePlayOneTickLater);
+ dropCreatureFixedPossessions(creatureType, mapX, mapY, cell, kDMSoundModePlayOneTickLater);
else
_dropMovingCreatureFixedPossessionsCell[_dropMovingCreatureFixedPossCellCount++] = cell;
}
@@ -890,7 +890,7 @@ T0209089_DoubleSquareMove:
AL0450_i_DestinationMapX = eventMapX;
AL0451_i_DestinationMapY = eventMapY;
AL0450_i_DestinationMapX += _vm->_dirIntoStepCountEast[AL0446_i_Direction] * 2, AL0451_i_DestinationMapY += _vm->_dirIntoStepCountNorth[AL0446_i_Direction] * 2;
- _vm->_sound->requestPlay(k17_soundBUZZ, AL0450_i_DestinationMapX, AL0451_i_DestinationMapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(k17_soundBUZZ, AL0450_i_DestinationMapX, AL0451_i_DestinationMapY, kDMSoundModePlayIfPrioritized);
goto T0209061_MoveGroup;
}
}
@@ -1275,7 +1275,7 @@ int32 GroupMan::getCreatureAspectUpdateTime(ActiveGroup *activeGroup, int16 crea
if (getFlag(aspect, k0x0080_MaskActiveGroupIsAttacking) && (creatureType == k18_CreatureTypeAnimatedArmourDethKnight)) {
if (_vm->getRandomNumber(2)) {
toggleFlag(aspect, k0x0040_MaskActiveGroupFlipBitmap);
- _vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _currentGroupMapX, _currentGroupMapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _currentGroupMapX, _currentGroupMapY, kDMSoundModePlayIfPrioritized);
}
} else if (!getFlag(aspect, k0x0080_MaskActiveGroupIsAttacking) || !getFlag(creatureGraphicInfo, k0x0400_CreatureInfoGraphicMaskFlipDuringAttack)) {
if (_vm->getRandomNumber(2))
@@ -1294,7 +1294,7 @@ int32 GroupMan::getCreatureAspectUpdateTime(ActiveGroup *activeGroup, int16 crea
toggleFlag(aspect, k0x0040_MaskActiveGroupFlipBitmap);
uint16 soundIndex = _vm->_moveSens->getSound(k13_CreatureTypeCouatl);
if (soundIndex <= k34_D13_soundCount)
- _vm->_sound->requestPlay(soundIndex, _currentGroupMapX, _currentGroupMapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(soundIndex, _currentGroupMapX, _currentGroupMapY, kDMSoundModePlayIfPrioritized);
}
} else if (_vm->getRandomNumber(2))
setFlag(aspect, k0x0040_MaskActiveGroupFlipBitmap);
@@ -1472,7 +1472,7 @@ bool GroupMan::isCreatureAttacking(Group *group, int16 mapX, int16 mapY, uint16
int16 kineticEnergy = (creatureInfo->_attack >> 2) + 1;
kineticEnergy += _vm->getRandomNumber(kineticEnergy);
kineticEnergy += _vm->getRandomNumber(kineticEnergy);
- _vm->_sound->requestPlay(k13_soundSPELL, mapX, mapY, k0_soundModePlayImmediately);
+ _vm->_sound->requestPlay(k13_soundSPELL, mapX, mapY, kDMSoundModePlayImmediately);
_vm->_projexpl->createProjectile(projectileThing, mapX, mapY, targetCell, (Direction)_currGroupPrimaryDirToParty, CLIP<byte>(20, kineticEnergy, 255), creatureInfo->_dexterity, 8);
} else {
int16 championIndex;
@@ -1503,7 +1503,7 @@ bool GroupMan::isCreatureAttacking(Group *group, int16 mapX, int16 mapY, uint16
}
int16 attackSoundOrdinal = creatureInfo->_attackSoundOrdinal;
if (attackSoundOrdinal)
- _vm->_sound->requestPlay(creatureAttackSounds[--attackSoundOrdinal], mapX, mapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(creatureAttackSounds[--attackSoundOrdinal], mapX, mapY, kDMSoundModePlayIfPrioritized);
return true;
}
@@ -1612,7 +1612,7 @@ int16 GroupMan::getChampionDamage(Group *group, uint16 champIndex) {
int16 damage = _vm->_championMan->addPendingDamageAndWounds_getDamage(champIndex, attack, allowedWound, creatureInfo._attackType);
if (damage) {
- _vm->_sound->requestPlay(k09_soundCHAMPION_0_DAMAGED + champIndex, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k2_soundModePlayOneTickLater);
+ _vm->_sound->requestPlay(k09_soundCHAMPION_0_DAMAGED + champIndex, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayOneTickLater);
uint16 poisonAttack = creatureInfo._poisonAttack;
if (poisonAttack && _vm->getRandomNumber(2)) {
@@ -1632,7 +1632,7 @@ void GroupMan::dropMovingCreatureFixedPossession(Thing thing, int16 mapX, int16
Group *group = (Group *)_vm->_dungeonMan->getThingData(thing);
int16 creatureType = group->_type;
while (_dropMovingCreatureFixedPossCellCount) {
- dropCreatureFixedPossessions(creatureType, mapX, mapY, _dropMovingCreatureFixedPossessionsCell[--_dropMovingCreatureFixedPossCellCount], k2_soundModePlayOneTickLater);
+ dropCreatureFixedPossessions(creatureType, mapX, mapY, _dropMovingCreatureFixedPossessionsCell[--_dropMovingCreatureFixedPossCellCount], kDMSoundModePlayOneTickLater);
}
}
}
@@ -1763,7 +1763,7 @@ Thing GroupMan::groupGetGenerated(int16 creatureType, int16 healthMultiplier, ui
(in which case the thing is referenced in the event) */
return Thing::_none;
}
- _vm->_sound->requestPlay(k17_soundBUZZ, mapX, mapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(k17_soundBUZZ, mapX, mapY, kDMSoundModePlayIfPrioritized);
return groupThing;
}
diff --git a/engines/dm/group.h b/engines/dm/group.h
index 3b6cf2f..ad68a03 100644
--- a/engines/dm/group.h
+++ b/engines/dm/group.h
@@ -89,6 +89,13 @@ enum CreatureType {
#define k0x0040_MaskActiveGroupFlipBitmap 0x0040 // @ MASK0x0040_FLIP_BITMAP
#define k0x0080_MaskActiveGroupIsAttacking 0x0080 // @ MASK0x0080_IS_ATTACKING
+enum SoundMode {
+ kDMSoundModeDoNotPlaySound = -1, // @ CM1_MODE_DO_NOT_PLAY_SOUND
+ kDMSoundModePlayImmediately = 0, // @ C00_MODE_PLAY_IMMEDIATELY
+ kDMSoundModePlayIfPrioritized = 1, // @ C01_MODE_PLAY_IF_PRIORITIZED
+ kDMSoundModePlayOneTickLater = 2 // @ C02_MODE_PLAY_ONE_TICK_LATER
+};
+
class ActiveGroup {
public:
int16 _groupThingIndex;
@@ -185,9 +192,9 @@ public:
uint16 getGroupDirections(Group *group, int16 mapIndex); // @ F0147_DUNGEON_GetGroupDirections
int16 getCreatureOrdinalInCell(Group *group, uint16 cell); // @ F0176_GROUP_GetCreatureOrdinalInCell
uint16 getCreatureValue(uint16 groupVal, uint16 creatureIndex); // @ M50_CREATURE_VALUE
- void dropGroupPossessions(int16 mapX, int16 mapY, Thing groupThing, int16 mode); // @ F0188_GROUP_DropGroupPossessions
+ void dropGroupPossessions(int16 mapX, int16 mapY, Thing groupThing, SoundMode mode); // @ F0188_GROUP_DropGroupPossessions
void dropCreatureFixedPossessions(uint16 creatureType, int16 mapX, int16 mapY, uint16 cell,
- int16 mode); // @ F0186_GROUP_DropCreatureFixedPossessions
+ SoundMode soundMode); // @ F0186_GROUP_DropCreatureFixedPossessions
int16 getDirsWhereDestIsVisibleFromSource(int16 srcMapX, int16 srcMapY,
int16 destMapX, int16 destMapY); // @ F0228_GROUP_GetDirectionsWhereDestinationIsVisibleFromSource
bool isDestVisibleFromSource(uint16 dir, int16 srcMapX, int16 srcMapY, int16 destMapX,
diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp
index ca4734b..31d3436 100644
--- a/engines/dm/inventory.cpp
+++ b/engines/dm/inventory.cpp
@@ -31,6 +31,7 @@
#include "dm/inventory.h"
#include "dm/dungeonman.h"
#include "dm/eventman.h"
+#include "dm/group.h"
#include "dm/menus.h"
#include "dm/gfx.h"
#include "dm/text.h"
@@ -1017,7 +1018,7 @@ void InventoryMan::clickOnMouth() {
_vm->_championMan->_champions[_vm->_championMan->_leaderIndex]._load += _vm->_dungeonMan->getObjectWeight(handThing) - handThingWeight;
setFlag(_vm->_championMan->_champions[_vm->_championMan->_leaderIndex]._attributes, kDMAttributeLoad);
}
- _vm->_sound->requestPlay(k08_soundSWALLOW, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k0_soundModePlayImmediately);
+ _vm->_sound->requestPlay(k08_soundSWALLOW, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayImmediately);
setFlag(curChampion->_attributes, kDMAttributeStatistics);
if (_panelContent == k0_PanelContentFoodWaterPoisoned)
diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp
index 0009458..abf0d0a 100644
--- a/engines/dm/menus.cpp
+++ b/engines/dm/menus.cpp
@@ -1106,10 +1106,10 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
case kDMActionSwing:
case kDMActionChop:
if ((Square(targetSquare).getType() == k4_DoorElemType) && (Square(targetSquare).getDoorState() == k4_doorState_CLOSED)) {
- _vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized);
actionDisabledTicks = 6;
_vm->_groupMan->groupIsDoorDestoryedByAttack(nextMapX, nextMapY, _vm->_championMan->getStrength(champIndex, kDMSlotActionHand), false, 2);
- _vm->_sound->requestPlay(k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k2_soundModePlayOneTickLater);
+ _vm->_sound->requestPlay(k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayOneTickLater);
break;
}
case kDMActionDisrupt:
@@ -1136,9 +1136,9 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
case kDMActionBrandish:
case kDMActionBlowHorn:
if (actionIndex == kDMActionWarCry)
- _vm->_sound->requestPlay(k28_soundWAR_CRY, nextMapX, nextMapY, k0_soundModePlayImmediately);
+ _vm->_sound->requestPlay(k28_soundWAR_CRY, nextMapX, nextMapY, kDMSoundModePlayImmediately);
else if (actionIndex == kDMActionBlowHorn)
- _vm->_sound->requestPlay(k25_soundBLOW_HORN, nextMapX, nextMapY, k0_soundModePlayImmediately);
+ _vm->_sound->requestPlay(k25_soundBLOW_HORN, nextMapX, nextMapY, kDMSoundModePlayImmediately);
actionPerformed = isGroupFrightenedByAction(champIndex, actionIndex, nextMapX, nextMapY);
break;
@@ -1175,7 +1175,7 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
setChampionDirectionToPartyDirection(curChampion);
Thing removedObject = _vm->_championMan->getObjectRemovedFromSlot(champIndex, kDMSlotReadyHand);
- _vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized);
_vm->_championMan->championShootProjectile(curChampion, removedObject, weaponInfoActionHand->_kineticEnergy + weaponInfoReadyHand->_kineticEnergy, (weaponInfoActionHand->getShootAttack() + _vm->_championMan->getSkillLevel(champIndex, kDMSkillShoot)) << 1, stepEnergy);
}
break;
@@ -1482,7 +1482,7 @@ bool MenuMan::isMeleeActionPerformed(int16 champIndex, Champion *champ, int16 ac
0 /* FUSE */
};
- _vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized);
if (_actionTargetGroupThing == Thing::_endOfList)
return false;
diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp
index bd95c7f..d61a43e 100644
--- a/engines/dm/movesens.cpp
+++ b/engines/dm/movesens.cpp
@@ -182,7 +182,7 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16
if (!doNotTriggerSensor) {
atLeastOneSensorWasTriggered = true;
if (currentSensor->getAttrAudibleA())
- _vm->_sound->requestPlay(k01_soundSWITCH, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(k01_soundSWITCH, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized);
if (!_vm->_championMan->_leaderEmptyHanded && ((processedSensorType == kDMSensorWallOrnClickWithSpecObjRemoved) || (processedSensorType == kDMSensorWallOrnClickWithSpecObjRemovedRotateSensors) || (processedSensorType == kDMSensorWallOrnClickWithSpecObjRemovedSensor))) {
Thing *leaderThing = (Thing *)_vm->_dungeonMan->getThingData(leaderHandObject);
@@ -279,7 +279,7 @@ bool MovesensMan::getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destM
_vm->_dungeonMan->_partyMapX = destMapX;
_vm->_dungeonMan->_partyMapY = destMapY;
if (teleporter->isAudible())
- _vm->_sound->requestPlay(k17_soundBUZZ, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k0_soundModePlayImmediately);
+ _vm->_sound->requestPlay(k17_soundBUZZ, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayImmediately);
drawDungeonViewWhileFalling = true;
if (teleporter->getAbsoluteRotation())
@@ -289,7 +289,7 @@ bool MovesensMan::getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destM
} else {
if (thingType == kDMThingTypeGroup) {
if (teleporter->isAudible())
- _vm->_sound->requestPlay(k17_soundBUZZ, destMapX, destMapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(k17_soundBUZZ, destMapX, destMapY, kDMSoundModePlayIfPrioritized);
moveGroupResult = getTeleporterRotatedGroupResult(teleporter, thing, mapIndexSource);
} else {
@@ -327,7 +327,7 @@ bool MovesensMan::getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destM
_vm->_championMan->decrementStamina(championIdx, ((curChampion->_load * 25) / _vm->_championMan->getMaximumLoad(curChampion)) + 1);
}
} else if (_vm->_championMan->getDamagedChampionCount(20, kDMWoundLegs | kDMWoundFeet, kDMAttackTypeSelf))
- _vm->_sound->requestPlay(k06_soundSCREAM, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k0_soundModePlayImmediately);
+ _vm->_sound->requestPlay(k06_soundSCREAM, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayImmediately);
}
_useRopeToClimbDownPit = false;
} else if (thingType == kDMThingTypeGroup) {
@@ -358,7 +358,7 @@ bool MovesensMan::getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destM
}
if ((thingType == kDMThingTypeGroup) && (fallKilledGroup || !_vm->_dungeonMan->isCreatureAllowedOnMap(thing, mapIndexDestination))) {
_vm->_groupMan->dropMovingCreatureFixedPossession(thing, destMapX, destMapY);
- _vm->_groupMan->dropGroupPossessions(destMapX, destMapY, thing, k2_soundModePlayOneTickLater);
+ _vm->_groupMan->dropGroupPossessions(destMapX, destMapY, thing, kDMSoundModePlayOneTickLater);
_vm->_dungeonMan->setCurrentMap(mapIndexSource);
if (mapX >= 0)
_vm->_groupMan->groupDelete(mapX, mapY);
@@ -416,7 +416,7 @@ bool MovesensMan::getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destM
if (thing == Thing::_party) {
_vm->_dungeonMan->setCurrentMap(mapIndexDestination);
if ((thing = _vm->_groupMan->groupGetThing(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY)) != Thing::_endOfList) { /* Delete group if party moves onto its square */
- _vm->_groupMan->dropGroupPossessions(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, thing, k1_soundModePlayIfPrioritized);
+ _vm->_groupMan->dropGroupPossessions(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, thing, kDMSoundModePlayIfPrioritized);
_vm->_groupMan->groupDelete(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY);
}
@@ -444,7 +444,7 @@ bool MovesensMan::getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destM
}
uint16 movementSoundIndex = getSound(((Group *)_vm->_dungeonMan->_thingData[kDMThingTypeGroup])[thing.getIndex()]._type);
if (movementSoundIndex < k34_D13_soundCount)
- _vm->_sound->requestPlay(movementSoundIndex, destMapX, destMapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(movementSoundIndex, destMapX, destMapY, kDMSoundModePlayIfPrioritized);
if (groupOnPartyMap && (mapIndexDestination != _vm->_dungeonMan->_partyMapIndex)) { /* If the group leaves the party map */
_vm->_groupMan->removeActiveGroup(activeGroupIndex);
@@ -839,7 +839,7 @@ void MovesensMan::processThingAdditionOrRemoval(uint16 mapX, uint16 mapY, Thing
continue;
if (curSensor->getAttrAudibleA())
- _vm->_sound->requestPlay(k01_soundSWITCH, mapX, mapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(k01_soundSWITCH, mapX, mapY, kDMSoundModePlayIfPrioritized);
triggerEffect(curSensor, curSensorEffect, mapX, mapY, (uint16)kDMCellAny); // this will wrap around
continue;
diff --git a/engines/dm/projexpl.cpp b/engines/dm/projexpl.cpp
index 97463b6..8508735 100644
--- a/engines/dm/projexpl.cpp
+++ b/engines/dm/projexpl.cpp
@@ -218,7 +218,7 @@ bool ProjExpl::hasProjectileImpactOccurred(int16 impactType, int16 mapXCombo, in
else
soundIndex = k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM;
- _vm->_sound->requestPlay(soundIndex, projectileMapX, projectileMapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(soundIndex, projectileMapX, projectileMapY, kDMSoundModePlayIfPrioritized);
}
T0217044:
if (removePotion) {
@@ -305,9 +305,9 @@ void ProjExpl::createExplosion(Thing explThing, uint16 attack, uint16 mapXCombo,
explosion->setAttack(attack);
if (explThing.toUint16() < Thing::_explHarmNonMaterial.toUint16()) {
uint16 soundIndex = (attack > 80) ? k05_soundSTRONG_EXPLOSION : k20_soundWEAK_EXPLOSION;
- _vm->_sound->requestPlay(soundIndex, projectileMapX, projectileMapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(soundIndex, projectileMapX, projectileMapY, kDMSoundModePlayIfPrioritized);
} else if (explThing != Thing::_explSmoke)
- _vm->_sound->requestPlay(k13_soundSPELL, projectileMapX, projectileMapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(k13_soundSPELL, projectileMapX, projectileMapY, kDMSoundModePlayIfPrioritized);
_vm->_dungeonMan->linkThingToList(unusedThing, Thing(0), projectileMapX, projectileMapY);
TimelineEvent newEvent;
@@ -525,7 +525,7 @@ void ProjExpl::processEvent25(TimelineEvent *event) {
break;
case 0xFFE4:
explosion->setType(explosion->getType() + 1);
- _vm->_sound->requestPlay(k05_soundSTRONG_EXPLOSION, mapX, mapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(k05_soundSTRONG_EXPLOSION, mapX, mapY, kDMSoundModePlayIfPrioritized);
AddEventFl = true;
break;
case 0xFFA8:
diff --git a/engines/dm/sounds.cpp b/engines/dm/sounds.cpp
index d077ee5..0c14cda 100644
--- a/engines/dm/sounds.cpp
+++ b/engines/dm/sounds.cpp
@@ -34,6 +34,7 @@
#include "dm/gfx.h"
#include "dm/timeline.h"
#include "dm/dungeonman.h"
+#include "dm/group.h"
#include "dm/sounds.h"
namespace DM {
@@ -195,14 +196,14 @@ bool SoundMan::soundGetVolume(int16 mapX, int16 mapY, uint8 *leftVolume, uint8 *
return true;
}
-void SoundMan::requestPlay(uint16 soundIndex, int16 mapX, int16 mapY, uint16 mode) {
- if (mode && (_vm->_dungeonMan->_currMapIndex != _vm->_dungeonMan->_partyMapIndex))
+void SoundMan::requestPlay(uint16 soundIndex, int16 mapX, int16 mapY, SoundMode soundMode) {
+ if ((soundMode != kDMSoundModePlayImmediately) && (_vm->_dungeonMan->_currMapIndex != _vm->_dungeonMan->_partyMapIndex))
return;
Sound *sound = &_sounds[soundIndex];
- if (mode > k1_soundModePlayIfPrioritized) { /* Add an event in the timeline to play the sound (mode - 1) ticks later */
+ if (soundMode == kDMSoundModePlayOneTickLater) { /* Add an event in the timeline to play the sound (mode - 1) ticks later */
TimelineEvent newEvent;
- _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime + mode - 1);
+ _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime + soundMode - 1);
newEvent._type = k20_TMEventTypePlaySound;
newEvent._priority = sound->_priority;
newEvent._Cu._soundIndex = soundIndex;
@@ -216,7 +217,7 @@ void SoundMan::requestPlay(uint16 soundIndex, int16 mapX, int16 mapY, uint16 mod
if (!soundGetVolume(mapX, mapY, &leftVolume, &rightVolume))
return;
- if (!mode) { /* Play the sound immediately */
+ if (soundMode == kDMSoundModePlayImmediately) { /* Play the sound immediately */
play(soundIndex, sound->_period, leftVolume, rightVolume);
return;
}
diff --git a/engines/dm/sounds.h b/engines/dm/sounds.h
index fc9561a..92b9340 100644
--- a/engines/dm/sounds.h
+++ b/engines/dm/sounds.h
@@ -77,8 +77,8 @@ public:
Common::Queue<PendingSound> _pendingSounds;
virtual void loadSounds(); // @ F0503_SOUND_LoadAll
- virtual void requestPlay(uint16 P0088_ui_SoundIndex, int16 P0089_i_MapX, int16 P0090_i_MapY, uint16 P0091_ui_Mode); // @ F0064_SOUND_RequestPlay_CPSD
- virtual void play(uint16 P0921_ui_SoundIndex, uint16 P0085_i_Period, uint8 leftVol, uint8 rightVol); // @ F0060_SOUND_Play
+ virtual void requestPlay(uint16 soundIndex, int16 mapX, int16 mapY, SoundMode soundMode); // @ F0064_SOUND_RequestPlay_CPSD
+ virtual void play(uint16 soundIndex, uint16 period, uint8 leftVolume, uint8 rightVolume); // @ F0060_SOUND_Play
void playPendingSound(); // @ F0065_SOUND_PlayPendingSound_CPSD
bool soundGetVolume(int16 mapX, int16 mapY, uint8 *leftVolume, uint8 *rightVolume); // @ F0505_SOUND_GetVolume
@@ -92,8 +92,8 @@ class SoundMan_Atari: public SoundMan {
SoundMan_Atari(DMEngine *vm): SoundMan(vm) {};
public:
void loadSounds() override {} // @ F0503_SOUND_LoadAll
- void requestPlay(uint16 P0088_ui_SoundIndex, int16 P0089_i_MapX, int16 P0090_i_MapY, uint16 P0091_ui_Mode) override {} // @ F0064_SOUND_RequestPlay_CPSD
- void play(uint16 P0921_ui_SoundIndex, uint16 P0085_i_Period, uint8 leftVol, uint8 rightVol) override {} // @ F0060_SOUND_Play
+ void requestPlay(uint16 soundIndex, int16 mapX, int16 mapY, SoundMode soundMode) override {} // @ F0064_SOUND_RequestPlay_CPSD
+ void play(uint16 soundIndex, uint16 period, uint8 leftVolume, uint8 rightVolume) override {} // @ F0060_SOUND_Play
};
}
diff --git a/engines/dm/timeline.cpp b/engines/dm/timeline.cpp
index 6d854d1..0e61a87 100644
--- a/engines/dm/timeline.cpp
+++ b/engines/dm/timeline.cpp
@@ -304,7 +304,7 @@ void Timeline::processTimeline() {
procesEventEnableGroupGenerator(curEvent);
break;
case k20_TMEventTypePlaySound:
- _vm->_sound->requestPlay(newEvent._Cu._soundIndex, newEvent._Bu._location._mapX, newEvent._Bu._location._mapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(newEvent._Cu._soundIndex, newEvent._Bu._location._mapX, newEvent._Bu._location._mapY, kDMSoundModePlayIfPrioritized);
break;
case k24_TMEventTypeRemoveFluxcage:
if (!_vm->_gameWon) {
@@ -402,7 +402,7 @@ void Timeline::processEventDoorAnimation(TimelineEvent *event) {
// See BUG0_78
int16 wounds = kDMWoundTorso | (verticalDoorFl ? kDMWoundHead : kDMWoundReadHand | kDMWoundActionHand);
if (_vm->_championMan->getDamagedChampionCount(5, wounds, kDMAttackTypeSelf))
- _vm->_sound->requestPlay(k18_soundPARTY_DAMAGED, mapX, mapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(k18_soundPARTY_DAMAGED, mapX, mapY, kDMSoundModePlayIfPrioritized);
}
event->_mapTime++;
addEventGetEventIndex(event);
@@ -417,7 +417,7 @@ void Timeline::processEventDoorAnimation(TimelineEvent *event) {
doorState = (doorState == k0_doorState_OPEN) ? k0_doorState_OPEN : (doorState - 1);
curSquare->setDoorState(doorState);
- _vm->_sound->requestPlay(k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, mapX, mapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, mapX, mapY, kDMSoundModePlayIfPrioritized);
event->_mapTime++;
addEventGetEventIndex(event);
return;
@@ -432,7 +432,7 @@ void Timeline::processEventDoorAnimation(TimelineEvent *event) {
doorState += (sensorEffect == kDMSensorEffectSet) ? -1 : 1;
curSquare->setDoorState(doorState);
- _vm->_sound->requestPlay(k02_soundDOOR_RATTLE, mapX, mapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(k02_soundDOOR_RATTLE, mapX, mapY, kDMSoundModePlayIfPrioritized);
if (sensorEffect == kDMSensorEffectSet) {
if (doorState == k0_doorState_OPEN)
@@ -733,7 +733,7 @@ void Timeline::processEventSquareCorridor(TimelineEvent *event) {
_vm->_groupMan->groupGetGenerated(curSensor->getData(), healthMultiplier, creatureCount, (Direction)_vm->getRandomNumber(4), mapX, mapY);
if (curSensor->getAttrAudibleA())
- _vm->_sound->requestPlay(k17_soundBUZZ, mapX, mapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(k17_soundBUZZ, mapX, mapY, kDMSoundModePlayIfPrioritized);
if (curSensor->getAttrOnlyOnce())
curSensor->setTypeDisabled();
@@ -768,7 +768,7 @@ void Timeline::processEventsMoveGroup(TimelineEvent *event) {
T0252001:
if (((_vm->_dungeonMan->_currMapIndex != _vm->_dungeonMan->_partyMapIndex) || (mapX != _vm->_dungeonMan->_partyMapX) || (mapY != _vm->_dungeonMan->_partyMapY)) && (_vm->_groupMan->groupGetThing(mapX, mapY) == Thing::_endOfList)) { /* BUG0_24 Lord Chaos may teleport into one of the Black Flames and become invisible until the Black Flame is killed. In this case, _vm->_groupMan->f175_groupGetThing returns the Black Flame thing and the Lord Chaos thing is not moved into the dungeon until the Black Flame is killed */
if (event->_type == k61_TMEventTypeMoveGroupAudible)
- _vm->_sound->requestPlay(k17_soundBUZZ, mapX, mapY, k1_soundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(k17_soundBUZZ, mapX, mapY, kDMSoundModePlayIfPrioritized);
_vm->_moveSens->getMoveResult(Thing(event->_Cu._slot), kDMMapXNotOnASquare, 0, mapX, mapY);
} else {
Commit: ed9b88354313bf19f867be098b06354c4c1682b3
https://github.com/scummvm/scummvm/commit/ed9b88354313bf19f867be098b06354c4c1682b3
Author: Strangerke (strangerke at scummvm.org)
Date: 2016-09-12T22:46:38+02:00
Commit Message:
DM: more renaming in DungeonMan
Changed paths:
engines/dm/dm.cpp
engines/dm/dungeonman.h
engines/dm/gfx.cpp
engines/dm/group.cpp
diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp
index 2eed7b8..1eefd01 100644
--- a/engines/dm/dm.cpp
+++ b/engines/dm/dm.cpp
@@ -920,7 +920,7 @@ void DMEngine::fuseSequence() {
while (curThing != Thing::_endOfList) {
if (curThing.getType() == kDMThingTypeExplosion) {
Explosion *curExplosion = (Explosion*)_dungeonMan->getThingData(curThing);
- if (curExplosion->getType() == k50_ExplosionType_Fluxcage) {
+ if (curExplosion->getType() == kDMExplosionTypeFluxcage) {
_dungeonMan->unlinkThingFromList(curThing, Thing(0), fluxCageMapX, fluxcageMapY);
curExplosion->setNextThing(Thing::_none);
continue;
diff --git a/engines/dm/dungeonman.h b/engines/dm/dungeonman.h
index 471a3b8..985897a 100644
--- a/engines/dm/dungeonman.h
+++ b/engines/dm/dungeonman.h
@@ -214,17 +214,19 @@ enum JunkType {
kDMJunkTypeZokathra = 51 // @ C51_JUNK_ZOKATHRA,
};
-#define k0_ExplosionType_Fireball 0 // @ C000_EXPLOSION_FIREBALL
-#define k1_ExplosionType_Slime 1 // @ C001_EXPLOSION_SLIME
-#define k2_ExplosionType_LightningBolt 2 // @ C002_EXPLOSION_LIGHTNING_BOLT
-#define k3_ExplosionType_HarmNonMaterial 3 // @ C003_EXPLOSION_HARM_NON_MATERIAL
-#define k4_ExplosionType_OpenDoor 4 // @ C004_EXPLOSION_OPEN_DOOR
-#define k6_ExplosionType_PoisonBolt 6 // @ C006_EXPLOSION_POISON_BOLT
-#define k7_ExplosionType_PoisonCloud 7 // @ C007_EXPLOSION_POISON_CLOUD
-#define k40_ExplosionType_Smoke 40 // @ C040_EXPLOSION_SMOKE
-#define k50_ExplosionType_Fluxcage 50 // @ C050_EXPLOSION_FLUXCAGE
-#define k100_ExplosionType_RebirthStep1 100 // @ C100_EXPLOSION_REBIRTH_STEP1
-#define k101_ExplosionType_RebirthStep2 101 // @ C101_EXPLOSION_REBIRTH_STEP2
+enum ExplosionType {
+ kDMExplosionTypeFireball = 0, // @ C000_EXPLOSION_FIREBALL
+ kDMExplosionTypeSlime = 1, // @ C001_EXPLOSION_SLIME
+ kDMExplosionTypeLightningBolt = 2, // @ C002_EXPLOSION_LIGHTNING_BOLT
+ kDMExplosionTypeHarmNonMaterial = 3, // @ C003_EXPLOSION_HARM_NON_MATERIAL
+ kDMExplosionTypeOpenDoor = 4, // @ C004_EXPLOSION_OPEN_DOOR
+ kDMExplosionTypePoisonBolt = 6, // @ C006_EXPLOSION_POISON_BOLT
+ kDMExplosionTypePoisonCloud = 7, // @ C007_EXPLOSION_POISON_CLOUD
+ kDMExplosionTypeSmoke = 40, // @ C040_EXPLOSION_SMOKE
+ kDMExplosionTypeFluxcage = 50, // @ C050_EXPLOSION_FLUXCAGE
+ kDMExplosionTypeRebirthStep1 = 100, // @ C100_EXPLOSION_REBIRTH_STEP1
+ kDMExplosionTypeRebirthStep2 = 101 // @ C101_EXPLOSION_REBIRTH_STEP2
+};
enum SquareMask {
k0x0001_WallWestRandOrnAllowed = 0x1, // @ MASK0x0001_WALL_WEST_RANDOM_ORNAMENT_ALLOWED
diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp
index 2ad9a60..800ab41 100644
--- a/engines/dm/gfx.cpp
+++ b/engines/dm/gfx.cpp
@@ -3633,21 +3633,21 @@ T0115171_BackFromT0115015_DrawProjectileAsObject:;
if (thingParam.getType() == kDMThingTypeExplosion) {
AL_2_cellPurpleMan = thingParam.getCell();
Explosion *explosion = (Explosion *)_vm->_dungeonMan->getThingData(thingParam);
- bool rebirthExplosion = ((uint16)(AL_4_explosionType = explosion->getType()) >= k100_ExplosionType_RebirthStep1);
+ bool rebirthExplosion = ((uint16)(AL_4_explosionType = explosion->getType()) >= kDMExplosionTypeRebirthStep1);
if (rebirthExplosion && ((AL_1_viewSquareExplosionIndex < k3_ViewSquare_D3C_Explosion) || (AL_1_viewSquareExplosionIndex > k9_ViewSquare_D1C_Explosion) || (AL_2_cellPurpleMan != cellYellowBear))) /* If explosion is rebirth and is not visible */
continue;
bool smoke = false;
- if ((AL_4_explosionType == k0_ExplosionType_Fireball) || (AL_4_explosionType == k2_ExplosionType_LightningBolt) || (AL_4_explosionType == k101_ExplosionType_RebirthStep2)) {
+ if ((AL_4_explosionType == kDMExplosionTypeFireball) || (AL_4_explosionType == kDMExplosionTypeLightningBolt) || (AL_4_explosionType == kDMExplosionTypeRebirthStep2)) {
AL_4_explosionAspectIndex = k0_ExplosionAspectFire;
} else {
- if ((AL_4_explosionType == k6_ExplosionType_PoisonBolt) || (AL_4_explosionType == k7_ExplosionType_PoisonCloud)) {
+ if ((AL_4_explosionType == kDMExplosionTypePoisonBolt) || (AL_4_explosionType == kDMExplosionTypePoisonCloud)) {
AL_4_explosionAspectIndex = k2_ExplosionAspectPoison;
} else {
- if (AL_4_explosionType == k40_ExplosionType_Smoke) {
+ if (AL_4_explosionType == kDMExplosionTypeSmoke) {
smoke = true;
AL_4_explosionAspectIndex = k3_ExplosionAspectSmoke;
} else {
- if (AL_4_explosionType == k100_ExplosionType_RebirthStep1) {
+ if (AL_4_explosionType == kDMExplosionTypeRebirthStep1) {
objectAspect = (ObjectAspect *)&_projectileAspect[_vm->ordinalToIndex(-_vm->_dungeonMan->getProjectileAspect(Thing::_explLightningBolt))];
bitmapRedBanana = getNativeBitmapOrGraphic(((ProjectileAspect *)objectAspect)->_firstNativeBitmapRelativeIndex + (k316_FirstProjectileGraphicIndice + 1));
explosionCoordinates = rebirthStep1ExplosionCoordinates[AL_1_viewSquareExplosionIndex - 3];
@@ -3659,7 +3659,7 @@ T0115171_BackFromT0115015_DrawProjectileAsObject:;
}
goto T0115200_DrawExplosion;
}
- if (AL_4_explosionType == k50_ExplosionType_Fluxcage) {
+ if (AL_4_explosionType == kDMExplosionTypeFluxcage) {
if (AL_1_viewSquareExplosionIndex >= k4_ViewSquare_D3L_Explosion) {
fluxcageExplosion = explosion;
}
diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp
index 1503d48..5289caf 100644
--- a/engines/dm/group.cpp
+++ b/engines/dm/group.cpp
@@ -1082,7 +1082,7 @@ bool GroupMan::isMovementPossible(CreatureInfo *creatureInfo, int16 mapX, int16
while (curThing != Thing::_endOfList) {
if ((curThing).getType() == kDMThingTypeExplosion) {
Teleporter *curTeleporter = (Teleporter *)_vm->_dungeonMan->getThingData(curThing);
- if (((Explosion *)curTeleporter)->setType(k50_ExplosionType_Fluxcage)) {
+ if (((Explosion *)curTeleporter)->setType(kDMExplosionTypeFluxcage)) {
_fluxCages[dir] = true;
_fluxCageCount++;
_groupMovBlockedByWallStairsPitFakeWalFluxCageTeleporter = true;
@@ -1885,7 +1885,7 @@ void GroupMan::fluxCageAction(int16 mapX, int16 mapY) {
return;
_vm->_dungeonMan->linkThingToList(unusedThing, Thing(0), mapX, mapY);
- (((Explosion *)_vm->_dungeonMan->_thingData[kDMThingTypeExplosion])[unusedThing.getIndex()]).setType(k50_ExplosionType_Fluxcage);
+ (((Explosion *)_vm->_dungeonMan->_thingData[kDMThingTypeExplosion])[unusedThing.getIndex()]).setType(kDMExplosionTypeFluxcage);
TimelineEvent newEvent;
_vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime + 100);
newEvent._type = k24_TMEventTypeRemoveFluxcage;
@@ -1938,7 +1938,7 @@ bool GroupMan::isFluxcageOnSquare(int16 mapX, int16 mapY) {
Thing thing = _vm->_dungeonMan->getSquareFirstThing(mapX, mapY);
while (thing != Thing::_endOfList) {
- if ((thing.getType() == kDMThingTypeExplosion) && (((Explosion *)_vm->_dungeonMan->_thingData[kDMThingTypeExplosion])[thing.getIndex()].getType() == k50_ExplosionType_Fluxcage))
+ if ((thing.getType() == kDMThingTypeExplosion) && (((Explosion *)_vm->_dungeonMan->_thingData[kDMThingTypeExplosion])[thing.getIndex()].getType() == kDMExplosionTypeFluxcage))
return true;
thing = _vm->_dungeonMan->getNextThing(thing);
More information about the Scummvm-git-logs
mailing list