From 27ec158e04be2aaff388464c9ec87b35d1ad84c6 Mon Sep 17 00:00:00 2001 From: stevenhoefel Date: Mon, 6 Apr 2020 23:42:15 +1000 Subject: [PATCH] DIRECTOR: Correct MouseDown Event Handler and fix switch statements missing breaks. --- engines/director/frame.cpp | 3 +++ engines/director/lingo/lingo-events.cpp | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp index 477d2be2bc2..4c5185522ec 100644 --- a/engines/director/frame.cpp +++ b/engines/director/frame.cpp @@ -577,8 +577,10 @@ void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) { switch (_sprites[i]->_cast->_type) { case kCastButton: castType = kCastButton; + break; default: castType = kCastShape; + break; } } else { castType = kCastShape; @@ -591,6 +593,7 @@ void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) { case kCheckboxSprite: case kRadioButtonSprite: castType = kCastButton; + break; default: warning("Frame::renderSprites(): Unhandled sprite type %d", _sprites[i]->_spriteType); break; diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp index b869856b9e0..c3f7840742a 100644 --- a/engines/director/lingo/lingo-events.cpp +++ b/engines/director/lingo/lingo-events.cpp @@ -174,7 +174,7 @@ void Lingo::processInputEvent(LEvent event) { processEvent(event, kCastScript, currentFrame->_sprites[spriteId]->_castId); processEvent(event, kFrameScript, score->_frames[score->getCurrentFrame()]->_actionId); // TODO: Is the kFrameScript call above correct? - } else if (event == kEventMouseUp || event == kEventMouseDown) { + } else if (event == kEventMouseUp) { // Frame script overrides sprite script if (!currentFrame->_sprites[spriteId]->_scriptId) { processEvent(kEventNone, kSpriteScript, currentFrame->_sprites[spriteId]->_castId + score->_castIDoffset); @@ -182,6 +182,8 @@ void Lingo::processInputEvent(LEvent event) { } else { processEvent(kEventNone, kFrameScript, currentFrame->_sprites[spriteId]->_scriptId); } + } else if (event == kEventMouseDown) { + processEvent(event, kSpriteScript, currentFrame->_sprites[spriteId]->_castId + score->_castIDoffset); } if (event == kEventKeyDown) { // TODO: is the above condition necessary or useful?