SCUMM: Fix Missing Default Switch Cases

These are flagged by GCC if -Wswitch-default is enabled.
This commit is contained in:
D G Turner 2019-12-23 11:56:16 +00:00
parent d5808d2903
commit 59b639ed4d
39 changed files with 282 additions and 30 deletions

View File

@ -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);

View File

@ -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];

View File

@ -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);

View File

@ -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;
}
}
}

View File

@ -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:

View File

@ -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;
}
}

View File

@ -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);
{
// 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);
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;
}
}

View File

@ -2777,6 +2777,9 @@ int AI::getMaxCollectors(int pool) {
case 63:
return 2;
default:
break;
}
return 0;

View File

@ -271,6 +271,9 @@ float Sortie::calcH() {
case DUT_SHIELD:
retValue += 1;
break;
default:
break;
}
}
}

View File

@ -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;
}
}

View File

@ -445,6 +445,8 @@ static void decodeWizMask(uint8 *&dst, uint8 &mask, int w, int maskType) {
}
}
break;
default:
break;
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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:

View File

@ -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

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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;
}
}
}

View File

@ -119,6 +119,9 @@ void MidiParser_RO::parseNextEvent (EventInfo &info) {
}
info.event = 0xFF;
break;
default:
break;
}
}

View File

@ -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;

View File

@ -409,6 +409,8 @@ void Player_AppleII::startSound(int nr) {
case 5:
_soundFunc = new AppleII_SoundFunction5_Noise();
break;
default:
break;
}
_soundFunc->init(this, _params);

View File

@ -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;
}
}

View File

@ -340,6 +340,7 @@ void PSG_HuC6280::write(int offset, byte data) {
break;
case 0x40:
default:
break;
case 0x80:

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -504,6 +504,9 @@ void Player_V2Base::execute_cmd(ChannelInfo *channel) {
if (opcode == 0)
goto end;
break;
default:
break;
}
} else { // opcode < 0xf8
for (;;) {

View File

@ -391,6 +391,9 @@ void Player_V2CMS::processChannel(Voice2 *channel) {
case Voice2::kEnvelopeRelease:
processRelease(channel);
break;
default:
break;
}
}

View File

@ -278,6 +278,9 @@ void ScummEngine::readIndexFile() {
_numSounds = _fileHandle->readUint16LE();
itemsize -= 2;
break;
default:
break;
}
_fileHandle->seek(itemsize - 8, SEEK_CUR);
}

View File

@ -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);
}

View File

@ -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));

View File

@ -719,6 +719,9 @@ void ScummEngine_v0::o_animateActor() {
case 0xFF:
a->stopActorMoving();
return;
default:
break;
}
a->animateActor(anim);

View File

@ -1542,6 +1542,8 @@ void ScummEngine_v2::o2_roomOps() {
}
_fullRedraw = true;
break;
default:
break;
}
}

View File

@ -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;
}
}
}

View File

@ -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;
}
}
}

View File

@ -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);

View File

@ -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

View File

@ -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) {

View File

@ -680,6 +680,8 @@ void ScummEngine_v2::checkExecVerbs() {
case 'l':
object = 3;
break;
default:
break;
}
if (object != -1) {