DIRECTOR: 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-17 21:43:00 +01:00
parent 9ce2ba2758
commit 80522f1187
5 changed files with 13 additions and 2 deletions

View File

@ -587,6 +587,8 @@ void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) {
case 7:
castType = kCastText;
break;
default:
break;
}
} else {
if (!_vm->getCurrentScore()->_castTypes.contains(_sprites[i]->_castId)) {
@ -708,6 +710,9 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) {
case kTypeRadio:
warning("STUB: renderButton: kTypeRadio");
break;
default:
warning("renderButton: Unknown buttonType");
break;
}
}
@ -743,7 +748,6 @@ void Frame::inkBasedBlit(Graphics::ManagedSurface &targetSurface, const Graphics
void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Common::Rect *textSize) {
TextCast *textCast = _sprites[spriteId]->_buttonCast != nullptr ? (TextCast*)_sprites[spriteId]->_buttonCast : _sprites[spriteId]->_textCast;
int x = _sprites[spriteId]->_startPoint.x; // +rectLeft;
int y = _sprites[spriteId]->_startPoint.y; // +rectTop;
int height = textCast->initialRect.height(); //_sprites[spriteId]->_height;
@ -829,6 +833,7 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo
switch (textCast->textAlign) {
case kTextAlignLeft:
default:
break;
case kTextAlignCenter:
textX = (width / 2) - (textSurface->w / 2) + (padding / 2) + borderSize;

View File

@ -226,9 +226,10 @@ BITDDecoderV4::BITDDecoderV4(int w, int h, uint16 bitsPerPixel) {
case 32:
//pf = Graphics::PixelFormat::PixelFormat(bitsPerPixel / 8, 8, 8, 8, 8, 24, 16, 8, 0);
break;
default:
break;
}
// HACK: Create a padded surface by adjusting w after create()
_surface->create(pitch, h, pf);
_surface->w = w;

View File

@ -327,6 +327,7 @@ void Lingo::func_cursor(int c) {
switch (c) {
case 0:
case -1:
default:
_vm->getMacWindowManager()->pushArrowCursor();
break;
case 1:

View File

@ -1644,6 +1644,9 @@ case YY_STATE_EOF(INITIAL):
else switch ( yy_get_next_buffer( ) )
{
default:
break;
case EOB_ACT_END_OF_FILE:
{
(yy_did_buffer_switch_on_eof) = 0;

View File

@ -895,6 +895,7 @@ void Score::dumpScript(const char *script, ScriptType type, uint16 id) {
switch (type) {
case kNoneScript:
default:
error("Incorrect dumpScript() call");
case kFrameScript:
typeName = "frame";