aboutsummaryrefslogtreecommitdiff
path: root/engines/director
diff options
context:
space:
mode:
authorTobia Tesan2017-06-20 23:30:37 +0200
committerEugene Sandulenko2017-07-05 08:35:33 +0200
commit57dbfbf98806ac332926c0f3b133a6970ea7d442 (patch)
tree40b84538d9ee0c97dee3f79bd1dafce6af6bbfe7 /engines/director
parentc267bc208ffed2aef1ef7b7c47ebba070acb4775 (diff)
downloadscummvm-rg350-57dbfbf98806ac332926c0f3b133a6970ea7d442.tar.gz
scummvm-rg350-57dbfbf98806ac332926c0f3b133a6970ea7d442.tar.bz2
scummvm-rg350-57dbfbf98806ac332926c0f3b133a6970ea7d442.zip
DIRECTOR: Call primaryEventHandler in processInputEvent
Diffstat (limited to 'engines/director')
-rw-r--r--engines/director/lingo/lingo-events.cpp41
1 files changed, 24 insertions, 17 deletions
diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index b65e752388..b9d901e64a 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -149,23 +149,30 @@ void Lingo::processInputEvent(LEvent event) {
Frame *currentFrame = score->_frames[score->getCurrentFrame()];
assert(currentFrame != nullptr);
uint16 spriteId = score->_currentMouseDownSpriteId;
- 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);
- }
- // TODO: Unhandled in D<3?
- } else if (event == kEventMouseUp) {
- if (_vm->getVersion() > 3) {
- // TODO: check that this is the order of script execution!
- g_lingo->processEvent(kEventMouseUp, kCastScript, currentFrame->_sprites[spriteId]->_castId);
- g_lingo->processEvent(kEventMouseUp, kSpriteScript, currentFrame->_sprites[spriteId]->_scriptId);
- } 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);
+
+ primaryEventHandler(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);
+ }
+ // TODO: Unhandled in D<3?
+ } else if (event == kEventMouseUp) {
+ if (_vm->getVersion() > 3) {
+ // TODO: check that this is the order of script execution!
+ g_lingo->processEvent(kEventMouseUp, kCastScript, currentFrame->_sprites[spriteId]->_castId);
+ g_lingo->processEvent(kEventMouseUp, kSpriteScript, currentFrame->_sprites[spriteId]->_scriptId);
+ } 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);
+ }
}
}
}