aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorD G Turner2019-10-15 21:46:14 +0100
committerD G Turner2019-10-15 21:46:14 +0100
commit66011fcae80b84620d2b1f0c466f75e03fb113d7 (patch)
tree0566a5cf1d7a5e401e5fa022f0b295e88f8e1f28 /engines
parent06b038a1c15d1486fc3466050391e12d22b5356a (diff)
downloadscummvm-rg350-66011fcae80b84620d2b1f0c466f75e03fb113d7.tar.gz
scummvm-rg350-66011fcae80b84620d2b1f0c466f75e03fb113d7.tar.bz2
scummvm-rg350-66011fcae80b84620d2b1f0c466f75e03fb113d7.zip
AVALANCHE: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
Diffstat (limited to 'engines')
-rw-r--r--engines/avalanche/animation.cpp17
-rw-r--r--engines/avalanche/avalot.cpp14
-rw-r--r--engines/avalanche/background.cpp12
-rw-r--r--engines/avalanche/dialogs.cpp13
-rw-r--r--engines/avalanche/dropdown.cpp30
-rw-r--r--engines/avalanche/parser.cpp29
-rw-r--r--engines/avalanche/sequence.cpp2
-rw-r--r--engines/avalanche/timer.cpp14
8 files changed, 113 insertions, 18 deletions
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 6946e448d8..590e76ccd8 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -260,6 +260,9 @@ void AnimationType::walk() {
case kMagicOpenDoor:
_anim->_vm->openDoor((Room)(magic->_data >> 8), magic->_data & 0xff, magicColor);
break;
+ case kMagicNothing:
+ default:
+ break;
}
}
}
@@ -495,6 +498,8 @@ void Animation::catacombMove(byte ped) {
_sprites[0]->_moveY = 1;
_sprites[0]->_moveX = 0;
return;
+ default:
+ break;
}
if (!_vm->_enterCatacombsFromLustiesRoom)
@@ -564,6 +569,8 @@ void Animation::catacombMove(byte ped) {
_vm->_magics[1]._operation = kMagicNothing; // Sloping wall.
_vm->_magics[2]._operation = kMagicSpecial; // Straight wall.
break;
+ default:
+ break;
}
/* ---- */
@@ -617,6 +624,8 @@ void Animation::catacombMove(byte ped) {
_vm->_magics[5]._operation = kMagicSpecial; // Straight wall.
_vm->_portals[6]._operation = kMagicNothing; // Door.
break;
+ default:
+ break;
}
switch ((here & 0xf00) >> 8) { // South
@@ -648,6 +657,8 @@ void Animation::catacombMove(byte ped) {
_vm->_magics[6]._operation = kMagicBounce;
_vm->_magics[12]._operation = kMagicBounce;
break;
+ default:
+ break;
}
switch ((here & 0xf000) >> 12) { // North
@@ -724,6 +735,8 @@ void Animation::catacombMove(byte ped) {
_vm->_background->draw(-1, -1, 0);
_vm->_portals[3]._operation = kMagicSpecial; // Door.
break;
+ default:
+ break;
}
switch (xy) {
@@ -756,6 +769,8 @@ void Animation::catacombMove(byte ped) {
_vm->_background->draw(-1, -1, 11);
_vm->_background->draw(-1, -1, 12);
break; // [1,1] : the other two.
+ default:
+ break;
}
if (_vm->_geidaFollows && (ped > 0)) {
@@ -935,6 +950,8 @@ void Animation::callSpecial(uint16 which) {
appearPed(0, 2);
dawnDelay();
break;
+ default:
+ break;
}
}
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index e21999bc42..c8ef4bb0ac 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -484,6 +484,8 @@ void AvalancheEngine::exitRoom(byte x) {
case kRoomRobins:
_timer->loseTimer(Timer::kReasonGettingTiedUp);
break;
+ default:
+ break;
}
_interrogation = 0; // Leaving the room cancels all the questions automatically.
@@ -738,8 +740,10 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) {
case kRoomCatacombs:
if ((ped == 0) || (ped == 3) || (ped == 5) || (ped == 6)) {
-
switch (ped) {
+ case 0:
+ default:
+ break;
case 3: // Enter from oubliette
_catacombX = 8;
_catacombY = 4;
@@ -1026,6 +1030,8 @@ void AvalancheEngine::useCompass(const Common::Point &cursorPos) {
_animation->stopWalking();
drawDirection();
break;
+ default:
+ break;
}
}
@@ -1072,6 +1078,7 @@ void AvalancheEngine::guideAvvy(Common::Point cursorPos) {
switch (what) {
case 0:
+ default:
_animation->stopWalking();
break; // Clicked on Avvy: no movement.
case 1:
@@ -1524,6 +1531,8 @@ Common::String AvalancheEngine::getItem(byte which) {
case 3:
result = "some vinegar";
break;
+ default:
+ break;
}
break;
case kObjectOnion:
@@ -1539,6 +1548,7 @@ Common::String AvalancheEngine::getItem(byte which) {
result = Common::String(items[which - 1]);
else
result = "";
+ break;
}
return result;
}
@@ -1661,6 +1671,8 @@ void AvalancheEngine::openDoor(Room whither, byte ped, byte magicnum) {
case 12:
_sequence->startLustiesSeq3(whither, ped);
break;
+ default:
+ break;
}
break;
default:
diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index f1ba659a55..781c7ed903 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -90,6 +90,8 @@ void Background::update() {
case 33:
_vm->_malagauche = 0;
break;
+ default:
+ break;
}
}
@@ -141,6 +143,8 @@ void Background::update() {
case 2:
draw(-1, -1, 2);
break;
+ default:
+ break;
}
}
break;
@@ -173,6 +177,8 @@ void Background::update() {
case 1:
draw(-1, -1, 2); // Frame 1: Natural.
break;
+ default:
+ break;
}
}
break;
@@ -185,6 +191,8 @@ void Background::update() {
case 23:
draw(-1, -1, 1); // Frame 1: Back to normal.
break;
+ default:
+ break;
}
}
break;
@@ -214,6 +222,8 @@ void Background::update() {
case 49 :
draw(-1, -1, 9);
break;
+ default:
+ break;
}
break;
}
@@ -257,6 +267,8 @@ void Background::update() {
case 2:
_vm->_sound->stopSound();
break;
+ default:
+ break;
}
}
}
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index d1a7234b03..3ccba4e139 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -97,6 +97,7 @@ void Dialogs::setReadyLight(byte state) {
// TODO: Implement different patterns for green color.
Color color = kColorBlack;
switch (state) {
+ default:
case 0:
color = kColorBlack;
break; // Off
@@ -459,6 +460,7 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) {
byte iconIndent = 0;
switch (_useIcon) {
+ default:
case 0:
iconIndent = 0;
break; // No icon.
@@ -495,6 +497,8 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) {
_vm->_graphics->drawShadowBox(_shadowBoxX - 65, _shadowBoxY - 24, _shadowBoxX - 5, _shadowBoxY - 10, "Yes.");
_vm->_graphics->drawShadowBox(_shadowBoxX + 5, _shadowBoxY - 24, _shadowBoxX + 65, _shadowBoxY - 10, "No.");
break;
+ default:
+ break;
}
if (center)
@@ -734,7 +738,7 @@ void Dialogs::displayText(Common::String text) {
return;
break;
- // CHECME: The whole kControlNegative block seems completely unused, as the only use (the easter egg check) is a false positive
+ // CHECKME: The whole kControlNegative block seems completely unused, as the only use (the easter egg check) is a false positive
case kControlNegative:
switch (_param) {
case 1:
@@ -783,6 +787,8 @@ void Dialogs::displayText(Common::String text) {
displayText(_vm->getItem(j) + ", " + kControlToBuffer);
}
break;
+ default:
+ break;
}
break;
case kControlIcon:
@@ -1031,6 +1037,8 @@ void Dialogs::talkTo(byte whom) {
case 3:
displayScrollChain('Q', 30); // Need any help with the game?
return;
+ default:
+ break;
}
} else {
displayScrollChain('Q', 42); // Haven't talked to Crapulus. Go and talk to him.
@@ -1085,6 +1093,9 @@ void Dialogs::talkTo(byte whom) {
}
}
break;
+
+ default:
+ break;
}
// On a subject. Is there any reason to block it?
} else if ((whom == kPeopleAyles) && (!_vm->_aylesIsAwake)) {
diff --git a/engines/avalanche/dropdown.cpp b/engines/avalanche/dropdown.cpp
index ba4e452aaa..a8f902eb5a 100644
--- a/engines/avalanche/dropdown.cpp
+++ b/engines/avalanche/dropdown.cpp
@@ -526,6 +526,8 @@ void DropDownMenu::setupMenuWith() {
_activeMenuItem.setupOption("Buy an onion", 'o', "", !_vm->_objects[kObjectOnion - 1]);
_verbStr = _verbStr + 105;
break;
+ default:
+ break;
}
}
_activeMenuItem.display();
@@ -549,6 +551,8 @@ void DropDownMenu::runMenuGame() {
case 4:
_vm->callVerb(kVerbCodeInfo);
break;
+ default:
+ break;
}
}
@@ -576,6 +580,8 @@ void DropDownMenu::runMenuFile() {
case 5:
_vm->callVerb(kVerbCodeQuit);
break;
+ default:
+ break;
}
}
@@ -613,6 +619,8 @@ void DropDownMenu::runMenuAction() {
_vm->_animation->updateSpeed();
}
break;
+ default:
+ break;
}
}
@@ -809,23 +817,27 @@ Common::String DropDownMenu::getThing(byte which) {
switch (which) {
case kObjectWine:
switch (_vm->_wineState) {
- case 1:
- case 4:
- result = Common::String(things[which - 1]);
- break;
- case 3:
- result = "Vinegar";
- break;
+ case 1:
+ case 4:
+ result = Common::String(things[which - 1]);
+ break;
+ case 3:
+ result = "Vinegar";
+ break;
+ default:
+ break;
}
break;
case kObjectOnion:
- if (_vm->_rottenOnion)
+ if (_vm->_rottenOnion) {
result = Common::String("rotten onion");
- else
+ } else {
result = Common::String(things[which - 1]);
+ }
break;
default:
result = Common::String(things[which - 1]);
+ break;
}
return result;
}
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 112dce93ac..26c3cbd75a 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -689,6 +689,8 @@ bool Parser::doPronouns() {
displayWhat(_vm->_it, false, ambiguous);
_thats.setChar(_vm->_it, i);
break;
+ default:
+ break;
}
}
@@ -755,6 +757,8 @@ void Parser::storeInterrogation(byte interrogation) {
//store_high(_inputText);
warning("STUB: Parser::store_interrogation()");
break;
+ default:
+ break;
}
if (interrogation < 4)
@@ -979,19 +983,23 @@ void Parser::examineObject() {
// Vinegar
_vm->_dialogs->displayScrollChain('D', 7);
break;
+ default:
+ break;
}
break;
case kObjectOnion:
- if (_vm->_rottenOnion)
+ if (_vm->_rottenOnion) {
// Yucky onion
_vm->_dialogs->displayScrollChain('Q', 21);
- else
+ } else {
// Normal onion
_vm->_dialogs->displayScrollChain('T', 18);
+ }
break;
default:
// Ordinarily
_vm->_dialogs->displayScrollChain('T', _thing);
+ break;
}
}
@@ -1157,6 +1165,8 @@ void Parser::swallow() {
// You can't drink it!
_vm->_dialogs->displayScrollChain('D', 8);
break;
+ default:
+ break;
}
break;
case kObjectPotion:
@@ -1272,6 +1282,8 @@ void Parser::lookAround() {
// Outside Geida's room.
_vm->_dialogs->displayScrollChain('Q', 82);
break;
+ default:
+ break;
}
break;
default:
@@ -1326,6 +1338,10 @@ void Parser::openDoor() {
case kMagicOpenDoor:
_vm->openDoor((Room)(portal->_data >> 8), portal->_data & 0x0F, i + 9);
break;
+ case kMagicBounce: // Not valid for portals.
+ case kMagicNothing:
+ default:
+ break;
}
return;
@@ -1373,8 +1389,9 @@ void Parser::putProc() {
_vm->_dialogs->displayScrollChain('U', 9);
}
}
- } else
+ } else {
_vm->_dialogs->saySilly();
+ }
break;
case 54:
@@ -1415,12 +1432,14 @@ void Parser::putProc() {
}
}
}
- } else
+ } else {
_vm->_dialogs->saySilly();
+ }
break;
default:
_vm->_dialogs->saySilly();
+ break;
}
}
@@ -2194,6 +2213,8 @@ void Parser::doThat() {
_vm->_timer->addTimer(27, Timer::kProcBuyWine, Timer::kReasonDrinks);
}
break;
+ default:
+ break;
}
} else
// Go to the bar!
diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp
index d63532a457..c8498c47dd 100644
--- a/engines/avalanche/sequence.cpp
+++ b/engines/avalanche/sequence.cpp
@@ -100,6 +100,8 @@ void Sequence::callSequencer() {
_vm->flipRoom(_flipToWhere, _flipToPed);
shoveLeft();
break;
+ default:
+ break;
}
if (curSeq <= 176) {
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index a9753b3cce..be83282fc6 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -198,6 +198,8 @@ void Timer::updateTimer() {
case kProcGiveLuteToGeida:
giveLuteToGeida();
break;
+ default:
+ break;
}
}
}
@@ -363,20 +365,22 @@ void Timer::jacquesWakesUp() {
_vm->_jacquesState++;
switch (_vm->_jacquesState) { // Additional pictures.
- case 1 :
+ case 1:
_vm->_background->draw(-1, -1, 0); // Eyes open.
_vm->_dialogs->displayScrollChain('Q', 45);
break;
- case 2 : // Going through the door.
+ case 2: // Going through the door.
_vm->_background->draw(-1, -1, 1); // Not on the floor.
_vm->_background->draw(-1, -1, 2); // But going through the door.
_vm->_magics[5]._operation = kMagicNothing; // You can't wake him up now.
break;
- case 3 : // Gone through the door.
+ case 3: // Gone through the door.
_vm->_background->draw(-1, -1, 1); // Not on the floor, either.
_vm->_background->draw(-1, -1, 3); // He's gone... so the door's open.
_vm->setRoom(kPeopleJacques, kRoomNowhere); // Gone!
break;
+ default:
+ break;
}
if (_vm->_jacquesState == 5) {
@@ -394,6 +398,8 @@ void Timer::jacquesWakesUp() {
case 4:
addTimer(24, kProcJacquesWakesUp, kReasonJacquesWakingUp);
break;
+ default:
+ break;
}
}
@@ -445,6 +451,8 @@ void Timer::jump() {
case 19:
avvy->_y++;
break;
+ default:
+ break;
}
if (_vm->_jumpStatus == 20) { // End of jump.