aboutsummaryrefslogtreecommitdiff
path: root/engines/director/lingo
diff options
context:
space:
mode:
authorTobia Tesan2017-06-20 23:39:19 +0200
committerEugene Sandulenko2017-07-05 08:35:33 +0200
commit0584f936dc539d6f3bded18046df96eaf9b88b6b (patch)
treec563710a974ecacd525fe3b5edc8c9b09e3019e0 /engines/director/lingo
parentbfe3a316c44be89660ed999197af79b87be0f582 (diff)
downloadscummvm-rg350-0584f936dc539d6f3bded18046df96eaf9b88b6b.tar.gz
scummvm-rg350-0584f936dc539d6f3bded18046df96eaf9b88b6b.tar.bz2
scummvm-rg350-0584f936dc539d6f3bded18046df96eaf9b88b6b.zip
DIRECTOR: Reorder processInputEvent
Diffstat (limited to 'engines/director/lingo')
-rw-r--r--engines/director/lingo/lingo-events.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index 71cdc38802..4f261d8f11 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -140,11 +140,16 @@ void Lingo::primaryEventHandler(LEvent event) {
}
void Lingo::processInputEvent(LEvent event) {
- // Primary Event handler
- // Score Script
- // Script of Cast Member
- // Score Script
- // Movie Script
+ /* When the mouseDown or mouseUp occurs over a sprite, the message
+ * goes first to the sprite script, then to the script of the cast
+ * member, to the frame script and finally to the movie scripts.
+ *
+ * When the mouseDown or mouseUp doesn't occur over a sprite, the
+ * message goes to the frame script and then to the movie script.
+ *
+ * When more than one movie script [...]
+ * [D4 docs] */
+
Score *score = _vm->getCurrentScore();
Frame *currentFrame = score->_frames[score->getCurrentFrame()];
assert(currentFrame != nullptr);
@@ -155,25 +160,20 @@ void Lingo::processInputEvent(LEvent event) {
if (g_lingo->dontPassEvent) {
g_lingo->dontPassEvent = false;
} else {
- if (event == kEventMouseDown) {
- if (_vm->getVersion() > 3) {
- g_lingo->processEvent(kEventMouseDown, kSpriteScript, currentFrame->_sprites[spriteId]->_scriptId);
- g_lingo->processEvent(kEventMouseDown, kCastScript, currentFrame->_sprites[spriteId]->_castId);
+ if (_vm->getVersion() > 3) {
+ if (true) {
+ // TODO: Check whether occurring over a sprite
+ g_lingo->processEvent(event, kSpriteScript, currentFrame->_sprites[spriteId]->_scriptId);
}
- // TODO: Unhandled in D<3?
+ g_lingo->processEvent(event, kCastScript, currentFrame->_sprites[spriteId]->_castId);
} else if (event == kEventMouseUp) {
- if (_vm->getVersion() > 3) {
- // TODO: check that this is the order of script execution!
- g_lingo->processEvent(kEventMouseUp, kSpriteScript, currentFrame->_sprites[spriteId]->_scriptId);
- g_lingo->processEvent(kEventMouseUp, kCastScript, currentFrame->_sprites[spriteId]->_castId);
- } else {
- // Frame script overrides sprite script
- if (!currentFrame->_sprites[spriteId]->_scriptId)
- g_lingo->processEvent(kEventNone, kSpriteScript, currentFrame->_sprites[spriteId]->_castId + 1024);
- else
- g_lingo->processEvent(kEventNone, kFrameScript, currentFrame->_sprites[spriteId]->_scriptId);
- }
+ // Frame script overrides sprite script
+ if (!currentFrame->_sprites[spriteId]->_scriptId)
+ g_lingo->processEvent(kEventNone, kSpriteScript, currentFrame->_sprites[spriteId]->_castId + 1024);
+ else
+ g_lingo->processEvent(kEventNone, kFrameScript, currentFrame->_sprites[spriteId]->_scriptId);
}
+ runMovieScript(event);
}
}