DIRECTOR: Correct MouseDown Event Handler and fix switch statements missing breaks.

This commit is contained in:
stevenhoefel 2020-04-06 23:42:15 +10:00
parent 7ac78c9172
commit 27ec158e04
2 changed files with 6 additions and 1 deletions

View File

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

View File

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