AGI: Fix Missing Default Switch Cases

These are flagged by GCC if -Wswitch-default is enabled.
This commit is contained in:
D G Turner 2019-10-14 03:54:10 +01:00
parent edf310c894
commit 95c0afa2c3
20 changed files with 61 additions and 0 deletions

View File

@ -138,6 +138,9 @@ int AgiEngine::agiInit() {
(int)(getVersion() >> 12) & 0xF,
(int)(getVersion()) & 0xFFF);
break;
default:
warning("Unknown AGI Emulation Version %x", (int)(getVersion() >> 12));
break;
}
if (getPlatform() == Common::kPlatformAmiga)

View File

@ -339,6 +339,8 @@ void AgiEngine::fixPosition(ScreenObjEntry *screenObj) {
dir = 0;
size++;
break;
default:
break;
}
count = size;

View File

@ -532,6 +532,9 @@ bool Console::Cmd_ScreenObj(int argc, const char **argv) {
}
debugPrintf("x: %d, y: %d, stepSize: %d, flag: %x\n", screenObj->move_x, screenObj->move_y, screenObj->move_stepSize, screenObj->move_flag);
break;
default:
debugPrintf("motion: UNKNOWN (%d)\n", screenObj->motionType);
break;
}
}
return true;

View File

@ -88,6 +88,8 @@ void AgiEngine::newRoom(int16 newRoomNr) {
case 4:
screenObjEgo->xPos = SCRIPT_WIDTH - screenObjEgo->xSize;
break;
default:
break;
}
uint16 agiVersion = getVersion();

View File

@ -259,6 +259,10 @@ bool AgiMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameD
case GID_WINNIE:
*engine = new Agi::WinnieEngine(syst, gd);
break;
default:
res = false;
error("PreAGI engine: unknown gameID");
break;
}
break;
case Agi::GType_V1:

View File

@ -62,6 +62,8 @@ void AgiEngine::setVar(int16 varNr, byte newValue) {
case VM_VAR_VOLUME:
setVolumeViaScripts(newValue);
break;
default:
break;
}
}

View File

@ -156,6 +156,10 @@ int AgiLoader_v1::init() {
if (ec == errOK)
ec = loadDir_BC(_vm->_game.dirSound, BC_SNDDIR_SEC, BC_SNDDIR_MAX);
break;
default:
ec = errUnk;
break;
}
return ec;
@ -303,6 +307,8 @@ int AgiLoader_v1::unloadResource(int16 resourceType, int16 resourceNr) {
case RESOURCETYPE_SOUND:
_vm->_sound->unloadSound(resourceNr);
break;
default:
break;
}
return errOK;

View File

@ -129,6 +129,8 @@ int AgiLoader_v2::unloadResource(int16 resourceType, int16 resourceNr) {
case RESOURCETYPE_SOUND:
_vm->_sound->unloadSound(resourceNr);
break;
default:
break;
}
return errOK;

View File

@ -186,6 +186,8 @@ int AgiLoader_v3::unloadResource(int16 resourceType, int16 resourceNr) {
case RESOURCETYPE_SOUND:
_vm->_sound->unloadSound(resourceNr);
break;
default:
break;
}
return errOK;

View File

@ -221,6 +221,8 @@ void AgiEngine::checkMotion(ScreenObjEntry *screenObj) {
case kMotionMoveObj:
motionMoveObj(screenObj);
break;
default:
break;
}
if ((_game.block.active && (~screenObj->flags & fIgnoreBlocks)) && screenObj->direction)

View File

@ -327,6 +327,8 @@ bool MickeyEngine::getMenuSelRow(MSA_MENU &menu, int *sel0, int *sel1, int iRow)
case 1:
sel = sel1;
break;
default:
break;
}
nWords = menu.row[iRow].count;
_clickToMove = false;
@ -1887,6 +1889,8 @@ bool MickeyEngine::parse(int cmd, int arg) {
case 2:
getXtal(35);
break;
default:
break;
}
}
break;
@ -2190,6 +2194,10 @@ bool MickeyEngine::parse(int cmd, int arg) {
_gameStateMickey.iRoom = arg;
return true;
break;
default:
break;
}
return false;

View File

@ -219,6 +219,8 @@ void TrollEngine::waitAnyKeyIntro() {
drawStr(22, 3, kColorDefault, IDS_TRO_INTRO_3);
g_system->updateScreen();
break;
default:
break;
}
iMsg++;
@ -287,6 +289,8 @@ void TrollEngine::tutorial() {
case IDI_TRO_SEL_OPTION_3:
done = true;
break;
default:
break;
}
}

View File

@ -372,6 +372,8 @@ int WinnieEngine::parser(int pc, int index, uint8 *buffer) {
dropObj(_room);
setTakeDrop(fCanSel);
break;
default:
break;
}
}
@ -754,6 +756,8 @@ void WinnieEngine::drawMenu(char *szMenu, int iSel, int fCanSel[]) {
iRow = IDI_WTP_ROW_OPTION_4;
iCol = IDI_WTP_COL_DROP;
break;
default:
break;
}
drawStr(iRow, iCol - 1, IDA_DEFAULT, ">");
g_system->updateScreen();
@ -788,6 +792,8 @@ void WinnieEngine::getMenuMouseSel(int *iSel, int fCanSel[], int x, int y) {
if (fCanSel[IDI_WTP_SEL_TAKE] && (x > IDI_WTP_COL_TAKE - 1) && (x < 33)) *iSel = IDI_WTP_SEL_TAKE;
if (fCanSel[IDI_WTP_SEL_DROP] && (x > IDI_WTP_COL_DROP - 1) && (x < 39)) *iSel = IDI_WTP_SEL_DROP;
break;
default:
break;
}
}

View File

@ -1041,6 +1041,8 @@ void AgiEngine::replayImageStackCall(uint8 type, int16 p1, int16 p2, int16 p3,
agiLoadResource(RESOURCETYPE_VIEW, p1);
_sprites->addToPic(p1, p2, p3, p4, p5, p6, p7);
break;
default:
break;
}
}

View File

@ -66,6 +66,8 @@ AgiSound *AgiSound::createFromRawResource(uint8 *data, uint32 len, int resnum, i
} else {
return new PCjrSound(data, len, resnum);
}
default:
break;
}
warning("Sound resource (%d) has unknown type (0x%04x). Not using the sound", resnum, type);

View File

@ -337,6 +337,8 @@ void SoundGen2GS::advanceMidiPlayer() {
case 7:
_channels[chn].setVolume(parm2);
break;
default:
break;
}
break;
case MIDI_PROGRAM_CHANGE:

View File

@ -350,6 +350,8 @@ void SoundGenPCJr::writeData(uint8 val) {
case 3:
_channel[3].freqCount = _channel[2].freqCount * 2;
break;
default:
break;
}
} else if (val & 0x80) {
reg = (val >> 5) & 0x3;

View File

@ -311,6 +311,9 @@ uint32 SoundGenSarien::mixSound() {
} else {
_chn[c].env = 0;
}
break;
default:
break;
}
}

View File

@ -1192,6 +1192,8 @@ char *TextMgr::stringPrintf(const char *originalText) {
if (_vm->_game.logics[_vm->_game.curLogicNr].numTexts > i)
safeStrcat(resultString, stringPrintf(_vm->_game.logics[_vm->_game.curLogicNr].texts[i]));
break;
default:
break;
}
while (*originalText >= '0' && *originalText <= '9')

View File

@ -72,6 +72,8 @@ void AgiEngine::updateView(ScreenObjEntry *screenObj) {
celNr--;
}
break;
default:
break;
}
setCel(screenObj, celNr);