aboutsummaryrefslogtreecommitdiff
path: root/engines/dm
diff options
context:
space:
mode:
authorD G Turner2019-11-16 10:10:45 +0000
committerD G Turner2019-11-16 10:10:45 +0000
commit4b6cb6878488577eb0c047e3baea412eb98d02c2 (patch)
tree00c4dfc70f13e9b67b07253878aacba765f6c0af /engines/dm
parentcc2973f04f5e46eb1c07ee5ff1e400cf9a85e64e (diff)
downloadscummvm-rg350-4b6cb6878488577eb0c047e3baea412eb98d02c2.tar.gz
scummvm-rg350-4b6cb6878488577eb0c047e3baea412eb98d02c2.tar.bz2
scummvm-rg350-4b6cb6878488577eb0c047e3baea412eb98d02c2.zip
DM: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
Diffstat (limited to 'engines/dm')
-rw-r--r--engines/dm/dungeonman.cpp4
-rw-r--r--engines/dm/eventman.cpp2
-rw-r--r--engines/dm/group.cpp10
-rw-r--r--engines/dm/menus.cpp21
-rw-r--r--engines/dm/movesens.cpp48
-rw-r--r--engines/dm/objectman.cpp2
-rw-r--r--engines/dm/projexpl.cpp4
-rw-r--r--engines/dm/sounds.cpp2
-rw-r--r--engines/dm/timeline.cpp6
9 files changed, 73 insertions, 26 deletions
diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp
index 23648e9c4d..7f66253fc8 100644
--- a/engines/dm/dungeonman.cpp
+++ b/engines/dm/dungeonman.cpp
@@ -992,6 +992,8 @@ T0172010_ClosedFakeWall:
if (AL0307_uc_FootprintsAllowed && (AL0307_uc_ScentOrdinal) && (--AL0307_uc_ScentOrdinal >= championMan._party._firstScentIndex) && (AL0307_uc_ScentOrdinal < championMan._party._lastScentIndex))
setFlag(aspectArray[kDMSquareAspectFloorOrn], kDMMaskFootprints);
break;
+ default:
+ break;
}
aspectArray[kDMSquareAspectFirstGroupOrObject] = curThing.toUint16();
}
@@ -1507,6 +1509,8 @@ Thing DungeonMan::getDiscardThing(uint16 thingType) {
setCurrentMap(mapIndex);
_vm->_moveSens->getMoveResult(squareThing, currMapX, currMapY, kDMMapXNotOnASquare, 0);
break;
+ default:
+ break;
}
setCurrentMap(currentMapIdx);
lastDiscardedThingMapIndex[thingType] = mapIndex;
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp
index 1d914bb183..96309c4876 100644
--- a/engines/dm/eventman.cpp
+++ b/engines/dm/eventman.cpp
@@ -573,6 +573,8 @@ void EventManager::buildpointerScreenArea(int16 mousePosX, int16 mousePosY) {
case k3_pointerTypeHand:
setMousePointerFromSpriteData(bitmapHanPointer);
break;
+ default:
+ break;
}
}
_previousMousePointerType = _mousePointerType;
diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp
index f36a8ddc31..9b65322930 100644
--- a/engines/dm/group.cpp
+++ b/engines/dm/group.cpp
@@ -355,6 +355,9 @@ bool GroupMan::isDestVisibleFromSource(uint16 dir, int16 srcMapX, int16 srcMapY,
SWAP(srcMapX, srcMapY);
SWAP(destMapX, destMapY);
break;
+ case kDMDirWest:
+ default:
+ break;
}
return ((srcMapX -= (destMapX - 1)) > 0) && ((((srcMapY -= destMapY) < 0) ? -srcMapY : srcMapY) <= srcMapX);
}
@@ -1500,6 +1503,10 @@ bool GroupMan::isCreatureAttacking(Group *group, int16 mapX, int16 mapY, uint16
break;
case 3:
projectileThing = _vm->_thingExplOpenDoor;
+ break;
+ default:
+ projectileThing = _vm->_thingNone;
+ break;
}
}
break;
@@ -2068,6 +2075,9 @@ void GroupMan::fuseAction(uint16 mapX, uint16 mapY) {
break;
case 3:
destMapY++;
+ break;
+ default:
+ break;
}
break;
}
diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp
index f547bbe934..56836e5346 100644
--- a/engines/dm/menus.cpp
+++ b/engines/dm/menus.cpp
@@ -694,6 +694,9 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
break;
}
}
+ break;
+ default:
+ break;
}
championMan.addSkillExperience(champIndex, curSpell->_skillIndex, experience);
championMan.disableAction(champIndex, curSpell->getDuration());
@@ -1352,6 +1355,8 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
if (actionPerformed)
_vm->_timeline->_events[curChampion->_enableActionEventIndex]._Bu._slotOrdinal = _vm->indexToOrdinal(kDMSlotActionHand);
break;
+ default:
+ break;
}
if (setDirectionFl) {
@@ -1522,13 +1527,17 @@ bool MenuMan::isMeleeActionPerformed(int16 champIndex, Champion *champ, int16 ac
switch (viewCell) {
case kDMViewCellBackRight: /* Champion is on the back right of the square and tries to attack a creature in the front right of its square */
case kDMViewCellBackLeft: /* Champion is on the back left of the square and tries to attack a creature in the front left of its square */
- uint16 cellDelta = (viewCell == kDMViewCellBackRight) ? 3 : 1;
- /* Check if there is another champion in front */
- if (_vm->_championMan->getIndexInCell(_vm->normalizeModulo4(championCell + cellDelta)) != kDMChampionNone) {
- _actionDamage = kDMDamageCantReach;
- return false;
+ {
+ uint16 cellDelta = (viewCell == kDMViewCellBackRight) ? 3 : 1;
+ /* Check if there is another champion in front */
+ if (_vm->_championMan->getIndexInCell(_vm->normalizeModulo4(championCell + cellDelta)) != kDMChampionNone) {
+ _actionDamage = kDMDamageCantReach;
+ return false;
+ }
}
break;
+ default:
+ break;
}
if ((actionIndex == kDMActionDisrupt) && !getFlag(dungeon.getCreatureAttributes(_actionTargetGroupThing), kDMCreatureMaskNonMaterial))
@@ -1578,6 +1587,8 @@ bool MenuMan::isGroupFrightenedByAction(int16 champIndex, uint16 actionIndex, in
frightAmount = 12;
experience = 45;
break;
+ default:
+ break;
}
frightAmount += championMan.getSkillLevel(champIndex, kDMSkillInfluence);
diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp
index 1dc36f7979..2eae1cb2fc 100644
--- a/engines/dm/movesens.cpp
+++ b/engines/dm/movesens.cpp
@@ -615,6 +615,7 @@ int16 MovesensMan::getSound(CreatureType creatureType) {
case kDMCreatureTypeLordChaos:
case kDMCreatureTypeLordOrder:
case kDMCreatureTypeGreyLord:
+ default:
return 35;
case kDMCreatureTypeGiggler:
case kDMCreatureTypeStoneGolem:
@@ -969,30 +970,35 @@ void MovesensMan::processRotationEffect() {
switch (_sensorRotationEffect) {
case kDMSensorEffectClear:
case kDMSensorEffectToggle:
- Thing firstSensorThing = dungeon.getSquareFirstThing(_sensorRotationEffMapX, _sensorRotationEffMapY);
- while ((firstSensorThing.getType() != kDMThingTypeSensor)
- || ((_sensorRotationEffCell != kDMCellAny) && (firstSensorThing.getCell() != _sensorRotationEffCell))) {
- firstSensorThing = dungeon.getNextThing(firstSensorThing);
- }
- Sensor *firstSensor = (Sensor *)dungeon.getThingData(firstSensorThing);
- Thing lastSensorThing = firstSensor->getNextThing();
- while ((lastSensorThing != _vm->_thingEndOfList)
- && ((lastSensorThing.getType() != kDMThingTypeSensor)
+ {
+ Thing firstSensorThing = dungeon.getSquareFirstThing(_sensorRotationEffMapX, _sensorRotationEffMapY);
+ while ((firstSensorThing.getType() != kDMThingTypeSensor)
+ || ((_sensorRotationEffCell != kDMCellAny) && (firstSensorThing.getCell() != _sensorRotationEffCell))) {
+ firstSensorThing = dungeon.getNextThing(firstSensorThing);
+ }
+ Sensor *firstSensor = (Sensor *)dungeon.getThingData(firstSensorThing);
+ Thing lastSensorThing = firstSensor->getNextThing();
+ while ((lastSensorThing != _vm->_thingEndOfList)
+ && ((lastSensorThing.getType() != kDMThingTypeSensor)
|| ((_sensorRotationEffCell != kDMCellAny) && (lastSensorThing.getCell() != _sensorRotationEffCell)))) {
+ lastSensorThing = dungeon.getNextThing(lastSensorThing);
+ }
+ if (lastSensorThing == _vm->_thingEndOfList)
+ break;
+ dungeon.unlinkThingFromList(firstSensorThing, Thing(0), _sensorRotationEffMapX, _sensorRotationEffMapY);
+ Sensor *lastSensor = (Sensor *)dungeon.getThingData(lastSensorThing);
lastSensorThing = dungeon.getNextThing(lastSensorThing);
+ while (((lastSensorThing != _vm->_thingEndOfList) && (lastSensorThing.getType() == kDMThingTypeSensor))) {
+ if ((_sensorRotationEffCell == kDMCellAny) || (lastSensorThing.getCell() == _sensorRotationEffCell))
+ lastSensor = (Sensor *)dungeon.getThingData(lastSensorThing);
+ lastSensorThing = dungeon.getNextThing(lastSensorThing);
+ }
+ firstSensor->setNextThing(lastSensor->getNextThing());
+ lastSensor->setNextThing(firstSensorThing);
}
- if (lastSensorThing == _vm->_thingEndOfList)
- break;
- dungeon.unlinkThingFromList(firstSensorThing, Thing(0), _sensorRotationEffMapX, _sensorRotationEffMapY);
- Sensor *lastSensor = (Sensor *)dungeon.getThingData(lastSensorThing);
- lastSensorThing = dungeon.getNextThing(lastSensorThing);
- while (((lastSensorThing != _vm->_thingEndOfList) && (lastSensorThing.getType() == kDMThingTypeSensor))) {
- if ((_sensorRotationEffCell == kDMCellAny) || (lastSensorThing.getCell() == _sensorRotationEffCell))
- lastSensor = (Sensor *)dungeon.getThingData(lastSensorThing);
- lastSensorThing = dungeon.getNextThing(lastSensorThing);
- }
- firstSensor->setNextThing(lastSensor->getNextThing());
- lastSensor->setNextThing(firstSensorThing);
+ break;
+ default:
+ break;
}
_sensorRotationEffect = kDMSensorEffectNone;
}
diff --git a/engines/dm/objectman.cpp b/engines/dm/objectman.cpp
index 66c6761f9a..e04f693c80 100644
--- a/engines/dm/objectman.cpp
+++ b/engines/dm/objectman.cpp
@@ -178,6 +178,8 @@ IconIndice ObjectMan::getIconIndex(Thing thing) {
if (((Weapon*)junkThing)->getChargeCount())
iconIndex++;
break;
+ default:
+ break;
}
}
}
diff --git a/engines/dm/projexpl.cpp b/engines/dm/projexpl.cpp
index 312cdc0043..3bcceb30e9 100644
--- a/engines/dm/projexpl.cpp
+++ b/engines/dm/projexpl.cpp
@@ -193,6 +193,8 @@ bool ProjExpl::hasProjectileImpactOccurred(int16 impactType, int16 mapXCombo, in
}
}
break;
+ default:
+ break;
}
if (championAttack && _projectilePoisonAttack && _vm->getRandomNumber(2)
&& _vm->_championMan->addPendingDamageAndWounds_getDamage(championIndex, attack, kDMWoundHead | kDMWoundTorso, _projectileAttackType))
@@ -550,6 +552,8 @@ void ProjExpl::processEvent25(TimelineEvent *event) {
AddEventFl = true;
}
break;
+ default:
+ break;
}
if (AddEventFl) {
TimelineEvent newEvent;
diff --git a/engines/dm/sounds.cpp b/engines/dm/sounds.cpp
index a4de3c3984..6da816b24c 100644
--- a/engines/dm/sounds.cpp
+++ b/engines/dm/sounds.cpp
@@ -180,6 +180,8 @@ bool SoundMan::soundGetVolume(int16 mapX, int16 mapY, uint8 *leftVolume, uint8 *
rightVolumeColumnIndex = -(mapY - _vm->_dungeonMan->_partyMapY);
lineIndex = mapX - _vm->_dungeonMan->_partyMapX;
break;
+ default:
+ break;
}
if ((rightVolumeColumnIndex < -12) || (rightVolumeColumnIndex > 12)) /* Sound is not audible if source is more than 12 squares away from the party */
diff --git a/engines/dm/timeline.cpp b/engines/dm/timeline.cpp
index 7ee1a467c7..331e296a35 100644
--- a/engines/dm/timeline.cpp
+++ b/engines/dm/timeline.cpp
@@ -794,6 +794,9 @@ T0252001:
break;
case 3:
mapY++;
+ break;
+ default:
+ break;
}
if (_vm->_groupMan->isSquareACorridorTeleporterPitOrDoor(mapX, mapY))
goto T0252001;
@@ -953,6 +956,9 @@ T0255002:
break;
case 0:
_vm->_championMan->viAltarRebirth(event->_priority);
+ break;
+ default:
+ break;
}
}