aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorD G Turner2019-10-16 20:49:38 +0100
committerD G Turner2019-10-16 20:49:38 +0100
commitca800c3c6233ae0a43cf09eb8f4b57737dd0c934 (patch)
treedd2ad374f5619c3de1d07f0d54551e180d774168
parent7e31014e987dc80e375e6c71b64cd987a7790f82 (diff)
downloadscummvm-rg350-ca800c3c6233ae0a43cf09eb8f4b57737dd0c934.tar.gz
scummvm-rg350-ca800c3c6233ae0a43cf09eb8f4b57737dd0c934.tar.bz2
scummvm-rg350-ca800c3c6233ae0a43cf09eb8f4b57737dd0c934.zip
CGE: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
-rw-r--r--engines/cge/bitmap.cpp4
-rw-r--r--engines/cge/cge_main.cpp15
-rw-r--r--engines/cge/snail.cpp51
-rw-r--r--engines/cge/vga13h.cpp6
4 files changed, 50 insertions, 26 deletions
diff --git a/engines/cge/bitmap.cpp b/engines/cge/bitmap.cpp
index 76ba48dd6e..e76499afca 100644
--- a/engines/cge/bitmap.cpp
+++ b/engines/cge/bitmap.cpp
@@ -300,6 +300,9 @@ bool Bitmap::solidAt(int16 x, int16 y) {
case kBmpREP:
w = 1;
break;
+ case kBmpCPY:
+ default:
+ break;
}
m += w;
}
@@ -317,6 +320,7 @@ bool Bitmap::solidAt(int16 x, int16 y) {
n += w;
switch (t) {
+ default:
case kBmpEOI:
return false;
case kBmpSKP:
diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp
index 05461e30e1..c944772e12 100644
--- a/engines/cge/cge_main.cpp
+++ b/engines/cge/cge_main.cpp
@@ -941,6 +941,8 @@ void CGEEngine::optionTouch(int opt, uint16 mask) {
if (mask & kMouseLeftUp)
quit();
break;
+ default:
+ break;
}
}
@@ -1065,22 +1067,23 @@ void CGEEngine::loadSprite(const char *fname, int ref, int scene, int col = 0, i
switch (i) {
- case 0 : // Name - will be taken in Expand routine
+ default:
+ case 0: // Name - will be taken in Expand routine
break;
- case 1 : // Type
+ case 1: // Type
if ((type = takeEnum(Type, strtok(NULL, " \t,;/"))) < 0)
error("Bad line %d [%s]", lcnt, fname);
break;
- case 2 : // Phase
+ case 2: // Phase
shpcnt++;
break;
- case 3 : // East
+ case 3: // East
east = (atoi(strtok(NULL, " \t,;/")) != 0);
break;
- case 11 : // Portable
+ case 11: // Portable
port = (atoi(strtok(NULL, " \t,;/")) != 0);
break;
- case 12 : // Transparent
+ case 12: // Transparent
tran = (atoi(strtok(NULL, " \t,;/")) != 0);
break;
}
diff --git a/engines/cge/snail.cpp b/engines/cge/snail.cpp
index c98aee22b8..bd0c41c4ff 100644
--- a/engines/cge/snail.cpp
+++ b/engines/cge/snail.cpp
@@ -508,26 +508,29 @@ void CGEEngine::snGame(Sprite *spr, int num) {
}
_commandHandler->addCommand(kCmdSetZ, 20700, 0, NULL);
- bool hit = (_sprK1->_seqPtr + _sprK2->_seqPtr + _sprK3->_seqPtr == 15);
- if (hit) {
- if (spr->_ref == 1) {
- _commandHandler->addCommand(kCmdSay, 1, 20003, NULL); // hurray!
- _commandHandler->addCommand(kCmdSeq, 20011, 2, NULL); // Camera away
- _commandHandler->addCommand(kCmdSend, 20701, -1, NULL); // move dice1 to scene -1
- _commandHandler->addCommand(kCmdSend, 20702, -1, NULL); // move dice2 to scene -1
- _commandHandler->addCommand(kCmdSend, 20703, -1, NULL); // move dice3 to scene -1
- _commandHandler->addCommand(kCmdSend, 20700, -1, NULL); // move TV to scene -1
- _commandHandler->addCommand(kCmdKeep, 20007, 0, NULL); // to pocket
- _commandHandler->addCommand(kCmdSend, 20006, 20, NULL); // Move Coin to scene 20
- _commandHandler->addCommand(kCmdSound, 20006, 20002, NULL); // Play Coin sound
- _commandHandler->addCommand(kCmdSay, 20002, 20004, NULL); // Say "Luck guy..."
- _commandHandler->addCommand(kCmdSend, 20010, 20, NULL); // Move Paper to scene 20
- _commandHandler->addCommand(kCmdSound, 20010, 20003, NULL); // Play "ksh" sound! (fx20003.wav)
- _commandHandler->addCommand(kCmdSay, 20001, 20005, NULL); // Say "Congratulations"
- _game = false;
- return;
- } else
- _sprK3->step(newRandom(5));
+ {
+ bool hit = (_sprK1->_seqPtr + _sprK2->_seqPtr + _sprK3->_seqPtr == 15);
+ if (hit) {
+ if (spr->_ref == 1) {
+ _commandHandler->addCommand(kCmdSay, 1, 20003, NULL); // hurray!
+ _commandHandler->addCommand(kCmdSeq, 20011, 2, NULL); // Camera away
+ _commandHandler->addCommand(kCmdSend, 20701, -1, NULL); // move dice1 to scene -1
+ _commandHandler->addCommand(kCmdSend, 20702, -1, NULL); // move dice2 to scene -1
+ _commandHandler->addCommand(kCmdSend, 20703, -1, NULL); // move dice3 to scene -1
+ _commandHandler->addCommand(kCmdSend, 20700, -1, NULL); // move TV to scene -1
+ _commandHandler->addCommand(kCmdKeep, 20007, 0, NULL); // to pocket
+ _commandHandler->addCommand(kCmdSend, 20006, 20, NULL); // Move Coin to scene 20
+ _commandHandler->addCommand(kCmdSound, 20006, 20002, NULL); // Play Coin sound
+ _commandHandler->addCommand(kCmdSay, 20002, 20004, NULL); // Say "Luck guy..."
+ _commandHandler->addCommand(kCmdSend, 20010, 20, NULL); // Move Paper to scene 20
+ _commandHandler->addCommand(kCmdSound, 20010, 20003, NULL); // Play "ksh" sound! (fx20003.wav)
+ _commandHandler->addCommand(kCmdSay, 20001, 20005, NULL); // Say "Congratulations"
+ _game = false;
+ return;
+ } else {
+ _sprK3->step(newRandom(5));
+ }
+ }
}
if (_gameCase2Cpt < 100) {
@@ -543,6 +546,8 @@ void CGEEngine::snGame(Sprite *spr, int num) {
// Tell to use ALT key
_commandHandler->addCommand(kCmdSay, 20003, 20022, NULL);
break;
+ default:
+ break;
}
_gameCase2Cpt++;
}
@@ -593,7 +598,13 @@ void CGEEngine::snGame(Sprite *spr, int num) {
_commandHandler->addCommand(kCmdUncover, 1, 20101, NULL); // SDS ??
_commandHandler->addCommand(kCmdGame, 1, 2, NULL); // again!
break;
+
+ default:
+ break;
}
+
+ default:
+ break;
}
}
diff --git a/engines/cge/vga13h.cpp b/engines/cge/vga13h.cpp
index a7e065fe01..7feb953d5a 100644
--- a/engines/cge/vga13h.cpp
+++ b/engines/cge/vga13h.cpp
@@ -252,6 +252,8 @@ Sprite *Sprite::expand() {
case 0xFE:
s->_next = seqCount - 1;
break;
+ default:
+ break;
}
if (s->_next > maxnxt)
maxnxt = s->_next;
@@ -285,6 +287,8 @@ Sprite *Sprite::expand() {
c->_val = atoi(strtok(NULL, " \t,;/"));
c->_spritePtr = NULL;
break;
+ default:
+ break;
}
}
} else {
@@ -880,6 +884,7 @@ void Bitmap::xShow(int16 x, int16 y) {
while (count-- > 0) {
// Transfer operation
switch (cmd) {
+ default:
case 1:
// SKIP
break;
@@ -927,6 +932,7 @@ void Bitmap::show(int16 x, int16 y) {
while (count-- > 0) {
// Transfer operation
switch (cmd) {
+ default:
case 1:
// SKIP
break;