From 59b639ed4d9b8c45644053641522dedabd12fa56 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Mon, 23 Dec 2019 11:56:16 +0000 Subject: SCUMM: Fix Missing Default Switch Cases These are flagged by GCC if -Wswitch-default is enabled. --- engines/scumm/actor.cpp | 8 ++++ engines/scumm/akos.cpp | 2 + engines/scumm/costume.cpp | 3 ++ engines/scumm/detection.cpp | 4 ++ engines/scumm/file.cpp | 1 + engines/scumm/gfx.cpp | 8 ++++ engines/scumm/he/logic/soccer.cpp | 56 ++++++++++++---------- engines/scumm/he/moonbase/ai_main.cpp | 3 ++ engines/scumm/he/moonbase/ai_targetacquisition.cpp | 3 ++ engines/scumm/he/script_v72he.cpp | 6 +++ engines/scumm/he/wiz_he.cpp | 2 + engines/scumm/help.cpp | 8 ++++ engines/scumm/imuse/imuse.cpp | 12 +++++ engines/scumm/imuse_digi/dimuse_music.cpp | 3 ++ engines/scumm/input.cpp | 2 + engines/scumm/insane/insane_ben.cpp | 7 +++ engines/scumm/insane/insane_enemy.cpp | 37 ++++++++++++++ engines/scumm/insane/insane_iact.cpp | 25 ++++++++++ engines/scumm/insane/insane_scenes.cpp | 21 +++++--- engines/scumm/midiparser_ro.cpp | 3 ++ engines/scumm/object.cpp | 6 +++ engines/scumm/players/player_apple2.cpp | 2 + engines/scumm/players/player_nes.cpp | 14 ++++++ engines/scumm/players/player_pce.cpp | 1 + engines/scumm/players/player_v1.cpp | 16 +++++++ engines/scumm/players/player_v2a.cpp | 6 +++ engines/scumm/players/player_v2base.cpp | 3 ++ engines/scumm/players/player_v2cms.cpp | 3 ++ engines/scumm/resource.cpp | 3 ++ engines/scumm/resource_v4.cpp | 2 + engines/scumm/script.cpp | 2 + engines/scumm/script_v0.cpp | 3 ++ engines/scumm/script_v2.cpp | 2 + engines/scumm/script_v4.cpp | 4 ++ engines/scumm/script_v5.cpp | 21 ++++++++ engines/scumm/smush/codec47.cpp | 2 + engines/scumm/sound.cpp | 2 + engines/scumm/string.cpp | 6 +++ engines/scumm/verbs.cpp | 2 + 39 files changed, 283 insertions(+), 31 deletions(-) (limited to 'engines') diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp index 48035b5e89..7dcc1a693d 100644 --- a/engines/scumm/actor.cpp +++ b/engines/scumm/actor.cpp @@ -788,6 +788,8 @@ void Actor::startWalkAnim(int cmd, int angle) { turnToDirection(angle); startAnimActor(_standFrame); break; + default: + break; } } } @@ -1335,6 +1337,8 @@ int Actor::remapDirection(int dir, bool is_walking) { return 0; case 6: return 180; + default: + break; } // MM v0 stores flags as a part of the mask @@ -2398,6 +2402,8 @@ void Actor::startAnimActor(int f) { case 1005: f = _talkStopFrame; break; + default: + break; } if (_costume != 0) { @@ -2425,6 +2431,8 @@ void Actor::startAnimActor(int f) { case 0x3C: f = _talkStopFrame; break; + default: + break; } assert(f != 0x3E); diff --git a/engines/scumm/akos.cpp b/engines/scumm/akos.cpp index 3d98a7b9b2..2c0dc3804b 100644 --- a/engines/scumm/akos.cpp +++ b/engines/scumm/akos.cpp @@ -1525,6 +1525,8 @@ bool ScummEngine_v6::akos_increaseAnim(Actor *a, int chan, const byte *aksq, con if (curpos != end) curpos += (code & 0x8000) ? 2 : 1; break; + default: + break; } code = aksq[curpos]; diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp index f33d599f20..cd0d15e590 100644 --- a/engines/scumm/costume.cpp +++ b/engines/scumm/costume.cpp @@ -107,6 +107,9 @@ byte ClassicCostumeRenderer::mainRoutine(int xmoveCur, int ymoveCur) { ex1 = READ_LE_UINT16(_loaded._frameOffsets + ex1 * 2); _srcptr = _loaded._baseptr + READ_LE_UINT16(_loaded._baseptr + ex1 + ex2 * 2) + 14; } + break; + default: + break; } use_scaling = (_scaleX != 0xFF) || (_scaleY != 0xFF); diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 1576ee39f2..029b098048 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -467,6 +467,8 @@ static Common::Language detectLanguage(const Common::FSList &fslist, byte id) { return Common::RU_RUS; case 449787: // 64f3fe479d45b52902cf88145c41d172 return Common::ES_ESP; + default: + break; } } else { // The DIG switch (size) { @@ -484,6 +486,8 @@ static Common::Language detectLanguage(const Common::FSList &fslist, byte id) { return Common::JA_JPN; case 180730: // 424fdd60822722cdc75356d921dad9bf return Common::ZH_TWN; + default: + break; } } } diff --git a/engines/scumm/file.cpp b/engines/scumm/file.cpp index d4fc9bec3a..9e0dfeaff1 100644 --- a/engines/scumm/file.cpp +++ b/engines/scumm/file.cpp @@ -139,6 +139,7 @@ bool ScummFile::seek(int32 offs, int whence) { offs = _subFileStart + _subFileLen + offs; break; case SEEK_SET: + default: offs += _subFileStart; break; case SEEK_CUR: diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index 3fb93afcd5..5366691051 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -3644,6 +3644,9 @@ void Gdi::unkDecode9(byte *dst, int dstPitch, const byte *src, int height) const case 2: READ_N_BITS(4, run); break; + + default: + break; } } } @@ -3705,6 +3708,9 @@ void Gdi::unkDecode11(byte *dst, int dstPitch, const byte *src, int height) cons inc = 1; READ_N_BITS(8, color); break; + + default: + break; } } while (--h); dst -= _vertStripNextInc; @@ -4145,6 +4151,8 @@ void ScummEngine::scrollEffect(int dir) { x += step; } break; + default: + break; } } diff --git a/engines/scumm/he/logic/soccer.cpp b/engines/scumm/he/logic/soccer.cpp index 567f74efc9..af9ee7ac35 100644 --- a/engines/scumm/he/logic/soccer.cpp +++ b/engines/scumm/he/logic/soccer.cpp @@ -601,31 +601,35 @@ int LogicHEsoccer::op_1014(int32 srcX, int32 srcY, int32 srcZ, int32 velX, int32 adjustedVelZ = (double)velZ * (double)vecNumerator / (double)vecDenom / 100.0; break; case 2: - // length of movement vector - double v15 = vectorLength((double)velX * (double)vecNumerator / (double)vecDenom, (double)velY * (double)vecNumerator / (double)vecDenom, (double)velZ * (double)vecNumerator / (double)vecDenom); - - if (v15 != 0.0) { - // add the (scaled) movement vector to the input - double v26 = (double)ABS(velX) * (double)vecNumerator / (double)vecDenom * 50.0 / v15; - srcX = (int)((double)srcX + v26); - double v25 = (double)ABS(velY) * (double)vecNumerator / (double)vecDenom * 50.0 / v15; - srcY = (int)((double)srcY + v25); - double v24 = (double)ABS(velZ) * (double)vecNumerator / (double)vecDenom * 50.0 / v15; - srcZ = (int)((double)srcZ + v24); - } + { + // length of movement vector + double v15 = vectorLength((double)velX * (double)vecNumerator / (double)vecDenom, (double)velY * (double)vecNumerator / (double)vecDenom, (double)velZ * (double)vecNumerator / (double)vecDenom); + + if (v15 != 0.0) { + // add the (scaled) movement vector to the input + double v26 = (double)ABS(velX) * (double)vecNumerator / (double)vecDenom * 50.0 / v15; + srcX = (int)((double)srcX + v26); + double v25 = (double)ABS(velY) * (double)vecNumerator / (double)vecDenom * 50.0 / v15; + srcY = (int)((double)srcY + v25); + double v24 = (double)ABS(velZ) * (double)vecNumerator / (double)vecDenom * 50.0 / v15; + srcZ = (int)((double)srcZ + v24); + } - // srcX = (newX / newZ) * 3869 - startX = (double)srcX / (double)srcZ * 3869.0; - // srcY = (newY - (+524 * 100)) / (newZ * 3869 + (+524 * 100) - startY = ((double)srcY - _userDataD[524] * 100.0) / (double)srcZ * 3869.0 + _userDataD[524] * 100.0; - // srcZ = 3869 - startZ = 3869.0; - // vectorX = (newX - srcX) / 100 - adjustedVelX = ((double)srcX - startX) / 100.0; - // vectorY = (newY - srcY) / 100 - adjustedVelY = ((double)srcY - startY) / 100.0; - // vectorZ = (newZ - 3869 = srcZ) / 100 - adjustedVelZ = ((double)srcZ - 3869.0) / 100.0; + // srcX = (newX / newZ) * 3869 + startX = (double)srcX / (double)srcZ * 3869.0; + // srcY = (newY - (+524 * 100)) / (newZ * 3869 + (+524 * 100) + startY = ((double)srcY - _userDataD[524] * 100.0) / (double)srcZ * 3869.0 + _userDataD[524] * 100.0; + // srcZ = 3869 + startZ = 3869.0; + // vectorX = (newX - srcX) / 100 + adjustedVelX = ((double)srcX - startX) / 100.0; + // vectorY = (newY - srcY) / 100 + adjustedVelY = ((double)srcY - startY) / 100.0; + // vectorZ = (newZ - 3869 = srcZ) / 100 + adjustedVelZ = ((double)srcZ - 3869.0) / 100.0; + } + break; + default: break; } @@ -698,6 +702,8 @@ int LogicHEsoccer::op_1014(int32 srcX, int32 srcY, int32 srcZ, int32 velX, int32 for (int i = 0; i < 10; i++) _internalCollisionOutData[i] = outData[i]; break; + default: + break; } } } @@ -1040,6 +1046,8 @@ void LogicHEsoccer::getPointsForFace(int faceId, float &x1, float &y1, float &z1 y4 = objPoints[19]; z4 = objPoints[20]; break; + default: + break; } } diff --git a/engines/scumm/he/moonbase/ai_main.cpp b/engines/scumm/he/moonbase/ai_main.cpp index cc19cf501a..e56140bf10 100644 --- a/engines/scumm/he/moonbase/ai_main.cpp +++ b/engines/scumm/he/moonbase/ai_main.cpp @@ -2777,6 +2777,9 @@ int AI::getMaxCollectors(int pool) { case 63: return 2; + + default: + break; } return 0; diff --git a/engines/scumm/he/moonbase/ai_targetacquisition.cpp b/engines/scumm/he/moonbase/ai_targetacquisition.cpp index 53acffa00f..d3446f31bc 100644 --- a/engines/scumm/he/moonbase/ai_targetacquisition.cpp +++ b/engines/scumm/he/moonbase/ai_targetacquisition.cpp @@ -271,6 +271,9 @@ float Sortie::calcH() { case DUT_SHIELD: retValue += 1; break; + + default: + break; } } } diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp index d86b0cebdf..f8cbe962f0 100644 --- a/engines/scumm/he/script_v72he.cpp +++ b/engines/scumm/he/script_v72he.cpp @@ -186,6 +186,9 @@ int ScummEngine_v72he::readArray(int array, int idx2, int idx1) { case kDwordArray: return (int32)READ_LE_UINT32(ah->data + offset * 4); + + default: + break; } return 0; @@ -225,6 +228,9 @@ void ScummEngine_v72he::writeArray(int array, int idx2, int idx1, int value) { case kDwordArray: WRITE_LE_UINT32(ah->data + offset * 4, value); break; + + default: + break; } } diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp index c2cefeaa3b..0d3a75c17f 100644 --- a/engines/scumm/he/wiz_he.cpp +++ b/engines/scumm/he/wiz_he.cpp @@ -445,6 +445,8 @@ static void decodeWizMask(uint8 *&dst, uint8 &mask, int w, int maskType) { } } break; + default: + break; } } diff --git a/engines/scumm/help.cpp b/engines/scumm/help.cpp index ce0d13b4fc..15f1977c8f 100644 --- a/engines/scumm/help.cpp +++ b/engines/scumm/help.cpp @@ -250,6 +250,8 @@ void ScummHelp::updateStrings(byte gameId, byte version, Common::Platform platfo ADD_BIND("i", _("Inventory")); ADD_BIND("u", _("Use")); break; + default: + break; } break; case 4: @@ -320,6 +322,8 @@ void ScummHelp::updateStrings(byte gameId, byte version, Common::Platform platfo ADD_TEXT(_("7, 4, and 1 are switched with")); ADD_TEXT(_("9, 6, and 3, respectively.")); break; + default: + break; } break; case 6: @@ -336,8 +340,12 @@ void ScummHelp::updateStrings(byte gameId, byte version, Common::Platform platfo ADD_BIND("6", _("Fly to right")); ADD_BIND("3", _("Fly to lower right")); break; + default: + break; } break; + default: + break; } while (i < HELP_NUM_LINES) { ADD_LINE; diff --git a/engines/scumm/imuse/imuse.cpp b/engines/scumm/imuse/imuse.cpp index 1d52539ab5..af91a77c23 100644 --- a/engines/scumm/imuse/imuse.cpp +++ b/engines/scumm/imuse/imuse.cpp @@ -176,6 +176,9 @@ bool IMuseInternal::isMT32(int sound) { return true; else return false; + + default: + break; } // Old style 'RO' has equivalent properties to 'ROL' @@ -214,6 +217,9 @@ bool IMuseInternal::isMIDI(int sound) { case MKTAG('G', 'M', 'D', ' '): case MKTAG('M', 'I', 'D', 'I'): // Occurs in Sam & Max return true; + + default: + break; } // Old style 'RO' has equivalent properties to 'ROL' @@ -255,6 +261,9 @@ bool IMuseInternal::supportsPercussion(int sound) { case MKTAG('G', 'M', 'D', ' '): case MKTAG('M', 'I', 'D', 'I'): // Occurs in Sam & Max return true; + + default: + break; } // Old style 'RO' has equivalent properties to 'ROL' @@ -502,6 +511,9 @@ uint32 IMuseInternal::property(int prop, uint32 value) { case IMuse::PROP_PC_SPEAKER: _pcSpeaker = (value != 0); break; + + default: + break; } return 0; diff --git a/engines/scumm/imuse_digi/dimuse_music.cpp b/engines/scumm/imuse_digi/dimuse_music.cpp index 46c457c864..281d06b150 100644 --- a/engines/scumm/imuse_digi/dimuse_music.cpp +++ b/engines/scumm/imuse_digi/dimuse_music.cpp @@ -174,6 +174,7 @@ void IMuseDigital::playDigMusic(const char *songName, const imuseDigTable *table switch (table->transitionType) { case 0: case 5: + default: break; case 3: case 4: @@ -301,6 +302,7 @@ void IMuseDigital::playComiMusic(const char *songName, const imuseComiTable *tab switch (table->transitionType) { case 0: + default: break; case 8: setHookIdForMusic(table->hookId); @@ -432,6 +434,7 @@ void IMuseDigital::playFtMusic(const char *songName, int opcode, int volume) { switch (opcode) { case 0: case 4: + default: break; case 1: case 2: diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp index ecc1a16d29..6c6d0096d1 100644 --- a/engines/scumm/input.cpp +++ b/engines/scumm/input.cpp @@ -426,6 +426,8 @@ void ScummEngine_v6::processKeyboard(Common::KeyState lastKeyHit) { ConfMan.setBool("speech_mute", true); ConfMan.setBool("subtitles", true); break; + default: + break; } // We need to sync the current sound settings here to make sure that diff --git a/engines/scumm/insane/insane_ben.cpp b/engines/scumm/insane/insane_ben.cpp index 6697016983..8f3e0a7a42 100644 --- a/engines/scumm/insane/insane_ben.cpp +++ b/engines/scumm/insane/insane_ben.cpp @@ -1722,6 +1722,8 @@ void Insane::actor01Reaction(int32 buttons) { _actor[0].tilt = 2; } break; + default: + break; } if (_actor[0].curFacingFlag != _actor[0].newFacingFlag) { @@ -1885,6 +1887,9 @@ void Insane::chooseBenWeaponAnim(int buttons) { case INV_DUST: _actor[0].act[2].state = 0; switchBenWeapon(); + break; + default: + break; } _weaponBenJustSwitched = true; @@ -2023,6 +2028,8 @@ void Insane::ouchSoundBen() { case 3: smlayer_startVoice(98); break; + default: + break; } } diff --git a/engines/scumm/insane/insane_enemy.cpp b/engines/scumm/insane/insane_enemy.cpp index 40dd453722..9b8ccd08a8 100644 --- a/engines/scumm/insane/insane_enemy.cpp +++ b/engines/scumm/insane/insane_enemy.cpp @@ -50,6 +50,7 @@ int32 Insane::enemyInitializer(int num, int32 actor1, int32 actor2, int32 probab case EN_TORQUE: return enemy8initializer(actor1, actor2, probability); case -1: + default: // nothing break; } @@ -81,6 +82,7 @@ int32 Insane::enemyHandler(int num, int32 actor1, int32 actor2, int32 probabilit case EN_BEN: return enemyBenHandler(actor1, actor2, probability); case -1: + default: // nothing break; } @@ -175,6 +177,8 @@ int32 Insane::enemy0handler(int32 actor1, int32 actor2, int32 probability) { prepareScenePropScene(52, 0, 0); } break; + default: + break; } } else { switch (_vm->_rnd.getRandomNumber(14)) { @@ -340,6 +344,8 @@ int32 Insane::enemy1handler(int32 actor1, int32 actor2, int32 probability) { prepareScenePropScene(37, 0, 0); } break; + default: + break; } } else { switch (_vm->_rnd.getRandomNumber(14)) { @@ -493,6 +499,8 @@ int32 Insane::enemy2handler(int32 actor1, int32 actor2, int32 probability) { prepareScenePropScene(27, 0, 0); } break; + default: + break; } } else { if (_actor[actor1].kicking) { @@ -664,6 +672,8 @@ int32 Insane::enemy3handler(int32 actor1, int32 actor2, int32 probability) { prepareScenePropScene(8, 0, 0); } break; + default: + break; } _enHdlVar[EN_VULTF1][7] = _enHdlVar[EN_VULTF1][8]; } @@ -796,6 +806,8 @@ int32 Insane::enemy4handler(int32 actor1, int32 actor2, int32 probability) { prepareScenePropScene(47, 0, 0); } break; + default: + break; } } else { if (_actor[actor1].kicking) { @@ -806,6 +818,8 @@ int32 Insane::enemy4handler(int32 actor1, int32 actor2, int32 probability) { case 9: // Original is 10 here which never happens prepareScenePropScene(45, 0, 0); break; + default: + break; } } else { if (weaponMaxRange(actor2) >= dist) { @@ -822,6 +836,8 @@ int32 Insane::enemy4handler(int32 actor1, int32 actor2, int32 probability) { prepareScenePropScene(43, 0, 0); } break; + default: + break; } } else { switch (_vm->_rnd.getRandomNumber(14)) { @@ -837,6 +853,8 @@ int32 Insane::enemy4handler(int32 actor1, int32 actor2, int32 probability) { prepareScenePropScene(40, 0, 0); } break; + default: + break; } } } @@ -937,6 +955,8 @@ int32 Insane::enemy5handler(int32 actor1, int32 actor2, int32 probability) { prepareScenePropScene(12, 0, 0); } break; + default: + break; } else { if (_actor[actor1].kicking) { @@ -955,6 +975,8 @@ int32 Insane::enemy5handler(int32 actor1, int32 actor2, int32 probability) { _enemyState[EN_VULTF2][1] = 1; prepareScenePropScene(10, 0, 0); break; + default: + break; } } else { switch (_vm->_rnd.getRandomNumber(14)) { @@ -970,6 +992,8 @@ int32 Insane::enemy5handler(int32 actor1, int32 actor2, int32 probability) { prepareScenePropScene(14, 0, 0); } break; + default: + break; } } } @@ -1062,6 +1086,8 @@ int32 Insane::enemy6handler(int32 actor1, int32 actor2, int32 probability) { prepareScenePropScene(22, 0, 0); } break; + default: + break; } _enHdlVar[EN_VULTM2][1] = 1; goto _label1; @@ -1101,6 +1127,8 @@ int32 Insane::enemy6handler(int32 actor1, int32 actor2, int32 probability) { prepareScenePropScene(24, 0, 0); } break; + default: + break; } } } @@ -1450,6 +1478,8 @@ void Insane::actor11Reaction(int32 buttons) { _actor[1].x += _actor[1].cursorX / 32; break; + default: + break; } tmpx = _actor[1].x; @@ -1607,6 +1637,9 @@ void Insane::setEnemyState() { case INV_DUST: _actor[1].weaponClass = 2; _actor[1].act[2].state = 1; + break; + default: + break; } } @@ -1754,6 +1787,8 @@ void Insane::actor12Reaction(int32 buttons) { if (calcBenDamage(1, 0)) smlayer_startSfx(73); break; + default: + break; } smlayer_setActorFacing(1, 2, 21, 180); _actor[1].act[2].state = 13; @@ -2105,6 +2140,8 @@ void Insane::actor12Reaction(int32 buttons) { case EN_VULTF2: smlayer_startVoice(276); break; + default: + break; } } break; diff --git a/engines/scumm/insane/insane_iact.cpp b/engines/scumm/insane/insane_iact.cpp index e2ed30733b..39915869e7 100644 --- a/engines/scumm/insane/insane_iact.cpp +++ b/engines/scumm/insane/insane_iact.cpp @@ -53,6 +53,8 @@ void Insane::procIACT(byte *renderBitmap, int32 codecparam, int32 setupsan12, case 21: iactScene21(renderBitmap, codecparam, setupsan12, setupsan13, b, size, flags, par1, par2, par3, par4); break; + default: + break; } } @@ -140,6 +142,9 @@ void Insane::iactScene1(byte *renderBitmap, int32 codecparam, int32 setupsan12, smlayer_setFluPalette(_smush_roadrsh3Rip, 0); if (par5 == par6 - 1) smlayer_setFluPalette(_smush_roadrashRip, 0); + break; + default: + break; } break; case 7: @@ -158,8 +163,12 @@ void Insane::iactScene1(byte *renderBitmap, int32 codecparam, int32 setupsan12, smlayer_startSfx(86); } break; + default: + break; } break; + default: + break; } if (_approachAnim < 0 || _approachAnim > 4) @@ -335,6 +344,8 @@ void Insane::iactScene4(byte *renderBitmap, int32 codecparam, int32 setupsan12, else setBit(par5); break; + default: + break; } break; case 6: @@ -377,8 +388,12 @@ void Insane::iactScene4(byte *renderBitmap, int32 codecparam, int32 setupsan12, _roadBranch = true; _iactSceneId = par4; break; + default: + break; } break; + default: + break; } } @@ -421,6 +436,8 @@ void Insane::iactScene6(byte *renderBitmap, int32 codecparam, int32 setupsan12, else setBit(par5); break; + default: + break; } break; case 6: @@ -462,8 +479,12 @@ void Insane::iactScene6(byte *renderBitmap, int32 codecparam, int32 setupsan12, _roadBranch = true; _iactSceneId = par4; break; + default: + break; } break; + default: + break; } } @@ -508,8 +529,12 @@ void Insane::iactScene17(byte *renderBitmap, int32 codecparam, int32 setupsan12, _objectDetected = true; _mineCaveIsNear = true; break; + default: + break; } break; + default: + break; } } diff --git a/engines/scumm/insane/insane_scenes.cpp b/engines/scumm/insane/insane_scenes.cpp index c5897bec9e..15a66aa1ba 100644 --- a/engines/scumm/insane/insane_scenes.cpp +++ b/engines/scumm/insane/insane_scenes.cpp @@ -276,6 +276,7 @@ void Insane::stopSceneSounds(int sceneId) { case 20: case 22: case 23: + default: break; } if (!flag) @@ -609,6 +610,7 @@ int Insane::loadSceneData(int scene, int flag, int phase) { break; default: retvalue = 0; + break; } if (phase == 1) { _sceneData1Loaded = 1; @@ -628,28 +630,28 @@ void Insane::setSceneCostumes(int sceneId) { smlayer_putActor(0, 2, _actor[0].x, _actor[0].y1 + 190, _smlayer_room2); smlayer_setFluPalette(_smush_roadrashRip, 0); setupValues(); - return; + break; case 17: smlayer_setFluPalette(_smush_goglpaltRip, 0); setupValues(); - return; + break; case 2: if ((_vm->_game.features & GF_DEMO) && (_vm->_game.platform == Common::kPlatformDOS)) smlayer_setActorCostume(0, 2, readArray(9)); else smlayer_setActorCostume(0, 2, readArray(10)); setupValues(); - return; + break; case 13: setEnemyCostumes(); smlayer_setFluPalette(_smush_roadrashRip, 0); - return; + break; case 21: _currEnemy = EN_ROTT3; //PATCH setEnemyCostumes(); _actor[1].y = 200; smlayer_setFluPalette(_smush_roadrashRip, 0); - return; + break; case 4: case 5: case 6: @@ -659,11 +661,13 @@ void Insane::setSceneCostumes(int sceneId) { smlayer_setActorCostume(0, 2, readArray(11)); smlayer_putActor(0, 2, _actor[0].x, _actor[0].y1+190, _smlayer_room2); setupValues(); - return; + break; case 7: case 8: writeArray(4, 0); - return; + break; + default: + break; } } @@ -959,6 +963,7 @@ void Insane::procPostRendering(byte *renderBitmap, int32 codecparam, int32 setup break; case 25: case 26: + default: break; } @@ -1441,6 +1446,8 @@ void Insane::postCase14(byte *renderBitmap, int32 codecparam, int32 setupsan12, case 6: queueSceneSwitch(4, 0, "tovista1.san", 64, 0, 0, 230); break; + default: + break; } } } diff --git a/engines/scumm/midiparser_ro.cpp b/engines/scumm/midiparser_ro.cpp index 5fc1ae41ab..c35876867d 100644 --- a/engines/scumm/midiparser_ro.cpp +++ b/engines/scumm/midiparser_ro.cpp @@ -119,6 +119,9 @@ void MidiParser_RO::parseNextEvent (EventInfo &info) { } info.event = 0xFF; break; + + default: + break; } } diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp index df0b3e1035..1581eb32a9 100644 --- a/engines/scumm/object.cpp +++ b/engines/scumm/object.cpp @@ -237,6 +237,8 @@ bool ScummEngine::getClass(int obj, int cls) const { case kObjectClassYFlip: cls = 18; break; + default: + break; } } @@ -267,6 +269,8 @@ void ScummEngine::putClass(int obj, int cls, bool set) { case kObjectClassYFlip: cls = 18; break; + default: + break; } } @@ -391,6 +395,8 @@ int ScummEngine::getObjectOrActorXY(int object, int &x, int &y) { } } return -1; + default: + break; } getObjectXYPos(object, x, y); return 0; diff --git a/engines/scumm/players/player_apple2.cpp b/engines/scumm/players/player_apple2.cpp index cba32bef2c..4eb3a074b0 100644 --- a/engines/scumm/players/player_apple2.cpp +++ b/engines/scumm/players/player_apple2.cpp @@ -409,6 +409,8 @@ void Player_AppleII::startSound(int nr) { case 5: _soundFunc = new AppleII_SoundFunction5_Noise(); break; + default: + break; } _soundFunc->init(this, _params); diff --git a/engines/scumm/players/player_nes.cpp b/engines/scumm/players/player_nes.cpp index b2f6eb0d40..02b999dc7c 100644 --- a/engines/scumm/players/player_nes.cpp +++ b/engines/scumm/players/player_nes.cpp @@ -179,6 +179,9 @@ void Square::Write(int Reg, byte Val) { if (!Enabled) Timer = 0; break; + + default: + break; } CheckActive(); } @@ -297,6 +300,9 @@ void Triangle::Write(int Reg, byte Val) { if (!Enabled) Timer = 0; break; + + default: + break; } CheckActive(); } @@ -394,6 +400,9 @@ void Noise::Write(int Reg, byte Val) { if (!Enabled) Timer = 0; break; + + default: + break; } } @@ -483,6 +492,8 @@ void APU::WriteReg(int Addr, byte Val) { _triangle.Write(4,Val & 0x4); _noise.Write(4,Val & 0x8); break; + default: + break; } } @@ -1025,6 +1036,9 @@ top: _mchan[x].envflags = 0x00; _mchan[x].voldelta = -10; break; + + default: + break; } } diff --git a/engines/scumm/players/player_pce.cpp b/engines/scumm/players/player_pce.cpp index 778c40f46d..31210025ca 100644 --- a/engines/scumm/players/player_pce.cpp +++ b/engines/scumm/players/player_pce.cpp @@ -340,6 +340,7 @@ void PSG_HuC6280::write(int offset, byte data) { break; case 0x40: + default: break; case 0x80: diff --git a/engines/scumm/players/player_v1.cpp b/engines/scumm/players/player_v1.cpp index b65c8a4d56..7c9ce0b614 100644 --- a/engines/scumm/players/player_v1.cpp +++ b/engines/scumm/players/player_v1.cpp @@ -192,6 +192,8 @@ void Player_V1::parseSpeakerChunk() { debug(6, "chunk 3: %d -> %d step %d", _start, _end, _delta); break; + default: + break; } } @@ -239,6 +241,7 @@ void Player_V1::nextSpeakerCmd() { set_mplex(_start); _forced_level = -_forced_level; break; + case 3: _start = (_start + _delta) & 0xffff; if (_start == _end) { @@ -251,6 +254,9 @@ void Player_V1::nextSpeakerCmd() { set_mplex((_start & lsr) | 0x180); _forced_level = -_forced_level; break; + + default: + break; } } @@ -365,6 +371,7 @@ parse_again: debug(6, "chunk 2: %d -> %d step %d", _start, _end, _delta); break; + case 3: set_mplex(READ_LE_UINT16(_next_chunk)); tmp = READ_LE_UINT16(_next_chunk + 2); @@ -379,6 +386,9 @@ parse_again: _delta = (int16) READ_LE_UINT16(_next_chunk + 8); _next_chunk += 10; break; + + default: + break; } } @@ -438,6 +448,8 @@ void Player_V1::nextPCjrCmd() { } } break; + default: + break; } } break; @@ -485,6 +497,7 @@ void Player_V1::nextPCjrCmd() { debug(7, "chunk 2: mplex %d curve %d", _start, _forced_level); _forced_level = -_forced_level; break; + case 3: dummy = _channels[3].volume + _delta; if (dummy >= 15) { @@ -503,6 +516,9 @@ void Player_V1::nextPCjrCmd() { _delta = READ_LE_UINT16(_next_chunk); _next_chunk += 2; break; + + default: + break; } } diff --git a/engines/scumm/players/player_v2a.cpp b/engines/scumm/players/player_v2a.cpp index 80a80a5584..3431c1668a 100644 --- a/engines/scumm/players/player_v2a.cpp +++ b/engines/scumm/players/player_v2a.cpp @@ -1401,6 +1401,8 @@ public: _mod->setChannelFreq(_id | 0x100, BASE_FREQUENCY / freq); _mod->setChannelVol(_id | 0x100, vol); break; + default: + break; } _loop = (_loop + 1) & 3; if (!_loop) { @@ -1457,6 +1459,8 @@ public: _mod->setChannelFreq(_id | 0x100, BASE_FREQUENCY / freq); _mod->setChannelVol(_id | 0x100, vol); break; + default: + break; } _loop = (_loop + 1) & 3; if (!_loop) { @@ -1638,6 +1642,8 @@ public: _volmod = 16; } break; + default: + break; } return true; } diff --git a/engines/scumm/players/player_v2base.cpp b/engines/scumm/players/player_v2base.cpp index 7d3dab7935..7aaeafe090 100644 --- a/engines/scumm/players/player_v2base.cpp +++ b/engines/scumm/players/player_v2base.cpp @@ -504,6 +504,9 @@ void Player_V2Base::execute_cmd(ChannelInfo *channel) { if (opcode == 0) goto end; break; + + default: + break; } } else { // opcode < 0xf8 for (;;) { diff --git a/engines/scumm/players/player_v2cms.cpp b/engines/scumm/players/player_v2cms.cpp index 94ba2cd388..d42fe5ed00 100644 --- a/engines/scumm/players/player_v2cms.cpp +++ b/engines/scumm/players/player_v2cms.cpp @@ -391,6 +391,9 @@ void Player_V2CMS::processChannel(Voice2 *channel) { case Voice2::kEnvelopeRelease: processRelease(channel); break; + + default: + break; } } diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp index e13bb8f3df..597a291c95 100644 --- a/engines/scumm/resource.cpp +++ b/engines/scumm/resource.cpp @@ -278,6 +278,9 @@ void ScummEngine::readIndexFile() { _numSounds = _fileHandle->readUint16LE(); itemsize -= 2; break; + + default: + break; } _fileHandle->seek(itemsize - 8, SEEK_CUR); } diff --git a/engines/scumm/resource_v4.cpp b/engines/scumm/resource_v4.cpp index d017514c82..49a5927530 100644 --- a/engines/scumm/resource_v4.cpp +++ b/engines/scumm/resource_v4.cpp @@ -89,6 +89,8 @@ void ScummEngine_v4::readIndexFile() { if (_game.id == GID_INDY3 && _game.platform == Common::kPlatformFMTowns) itemsize += 32; break; + default: + break; } _fileHandle->seek(itemsize - 8, SEEK_CUR); } diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp index 36a5fdb8f3..245de120c1 100644 --- a/engines/scumm/script.cpp +++ b/engines/scumm/script.cpp @@ -1336,6 +1336,8 @@ void ScummEngine_v2::runInputScript(int clickArea, int val, int mode) { case kInventoryClickArea: // Inventory clicked VAR(VAR_CLICK_OBJECT) = val; break; + default: + break; } memset(args, 0, sizeof(args)); diff --git a/engines/scumm/script_v0.cpp b/engines/scumm/script_v0.cpp index 7bacd847ac..9e6dba18ae 100644 --- a/engines/scumm/script_v0.cpp +++ b/engines/scumm/script_v0.cpp @@ -719,6 +719,9 @@ void ScummEngine_v0::o_animateActor() { case 0xFF: a->stopActorMoving(); return; + + default: + break; } a->animateActor(anim); diff --git a/engines/scumm/script_v2.cpp b/engines/scumm/script_v2.cpp index 208b1f4aef..a07d1f7015 100644 --- a/engines/scumm/script_v2.cpp +++ b/engines/scumm/script_v2.cpp @@ -1542,6 +1542,8 @@ void ScummEngine_v2::o2_roomOps() { } _fullRedraw = true; break; + default: + break; } } diff --git a/engines/scumm/script_v4.cpp b/engines/scumm/script_v4.cpp index 7ac21fea31..63eb26d301 100644 --- a/engines/scumm/script_v4.cpp +++ b/engines/scumm/script_v4.cpp @@ -196,6 +196,8 @@ void ScummEngine_v4::saveVars() { case 0x1F: // close file _saveLoadVarsFilename[0] = '\0'; return; + default: + break; } } } @@ -272,6 +274,8 @@ void ScummEngine_v4::loadVars() { case 0x1F: // close file _saveLoadVarsFilename[0] = '\0'; return; + default: + break; } } } diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp index a2dd83ab28..21dea366ae 100644 --- a/engines/scumm/script_v5.cpp +++ b/engines/scumm/script_v5.cpp @@ -595,6 +595,8 @@ void ScummEngine_v5::o5_add() { case 564: a -= 384; break; + default: + break; } } @@ -737,6 +739,8 @@ void ScummEngine_v5::o5_cursorCommand() { _charsetColorMap[i] = _charsetData[_string[1]._default.charset][i] = (unsigned char)table[i]; } break; + default: + break; } if (_game.version >= 4) { @@ -934,6 +938,8 @@ void ScummEngine_v5::o5_expression() { executeOpcode(_opcode); push(_scummVars[0]); break; + default: + break; } } @@ -1381,6 +1387,8 @@ void ScummEngine_v5::o5_matrixOps() { case 4: createBoxMatrix(); break; + default: + break; } } @@ -1786,6 +1794,8 @@ void ScummEngine_v5::o5_roomOps() { case 30: _townsOverrideShadowColor = 3; return; + default: + break; } } #endif // DISABLE_TOWNS_DUAL_LAYER_MODE @@ -1907,6 +1917,7 @@ void ScummEngine_v5::o5_roomOps() { break; default: error("o5_roomOps: unknown subopcode %d", _opcode & 0x1F); + break; } } @@ -2199,6 +2210,7 @@ void ScummEngine_v5::o5_stringOps() { case 1: /* loadstring */ loadPtrToResource(rtString, getVarOrDirectByte(PARAM_1), NULL); break; + case 2: /* copystring */ a = getVarOrDirectByte(PARAM_1); b = getVarOrDirectByte(PARAM_2); @@ -2208,6 +2220,7 @@ void ScummEngine_v5::o5_stringOps() { if (ptr) loadPtrToResource(rtString, a, ptr); break; + case 3: /* set string char */ a = getVarOrDirectByte(PARAM_1); b = getVarOrDirectByte(PARAM_2); @@ -2240,6 +2253,9 @@ void ScummEngine_v5::o5_stringOps() { } } break; + + default: + break; } } @@ -2321,6 +2337,8 @@ void ScummEngine_v5::o5_verbOps() { vs->curRect.left -= 54; vs->curRect.top += 8; break; + default: + break; } } else if (_game.id == GID_LOOM && _game.version == 4) { // FIXME: hack loom notes into right spot @@ -2344,6 +2362,9 @@ void ScummEngine_v5::o5_verbOps() { break; case 97: vs->curRect.top -= 5; + break; + default: + break; } } } diff --git a/engines/scumm/smush/codec47.cpp b/engines/scumm/smush/codec47.cpp index 5bac85ee82..53ac6482bd 100644 --- a/engines/scumm/smush/codec47.cpp +++ b/engines/scumm/smush/codec47.cpp @@ -605,6 +605,8 @@ bool Codec47Decoder::decode(byte *dst, const byte *src) { case 5: bompDecodeLine(_curBuf, gfx_data, READ_LE_UINT32(src + 14)); break; + default: + break; } memcpy(dst, _curBuf, _frameSize); diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index 14bf1c34c9..4f0801df6d 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -1211,6 +1211,8 @@ int ScummEngine::readSoundResource(ResId idx) { if (_sound->_musicType == MDT_PCSPK || _sound->_musicType == MDT_PCJR) pri = 11; break; + default: + break; } // We only allow SPK resources for PC Speaker and PCJr here diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp index a127de380e..421c72b21d 100644 --- a/engines/scumm/string.cpp +++ b/engines/scumm/string.cpp @@ -63,6 +63,8 @@ void ScummEngine::printString(int m, const byte *msg) { case 3: showMessageDialog(msg); break; + default: + break; } } @@ -955,6 +957,8 @@ void ScummEngine::drawString(int a, const byte *msg) { } _charset->_top += fontHeight; break; + default: + break; } } else if ((c == 0xFF || (_game.version <= 6 && c == 0xFE)) && (_game.heversion <= 71)) { c = buf[i++]; @@ -986,6 +990,8 @@ void ScummEngine::drawString(int a, const byte *msg) { else _charset->setColor(color); break; + default: + break; } } else { if (a == 1 && _game.version >= 6) { diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp index 8bcbb70e97..9675bd8f5a 100644 --- a/engines/scumm/verbs.cpp +++ b/engines/scumm/verbs.cpp @@ -680,6 +680,8 @@ void ScummEngine_v2::checkExecVerbs() { case 'l': object = 3; break; + default: + break; } if (object != -1) { -- cgit v1.2.3