aboutsummaryrefslogtreecommitdiff
path: root/engines/director/lingo
diff options
context:
space:
mode:
authorEugene Sandulenko2019-12-18 14:53:46 +0100
committerEugene Sandulenko2019-12-18 22:47:32 +0100
commit836e47047070dd1031d20389cdc32a29bbaaa493 (patch)
tree0a925c694e7067fa830cb276f0245992b1c94b1c /engines/director/lingo
parent1d1f09f072fe597329a52096f724f848fdb57efa (diff)
downloadscummvm-rg350-836e47047070dd1031d20389cdc32a29bbaaa493.tar.gz
scummvm-rg350-836e47047070dd1031d20389cdc32a29bbaaa493.tar.bz2
scummvm-rg350-836e47047070dd1031d20389cdc32a29bbaaa493.zip
DIRECTOR: LINGO: Properly process dontPassEvent flag
Diffstat (limited to 'engines/director/lingo')
-rw-r--r--engines/director/lingo/lingo-events.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index b48278dd48..9b4b8c537e 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -184,8 +184,8 @@ void Lingo::processInputEvent(LEvent event) {
// TODO: is the above condition necessary or useful?
g_lingo->processEvent(event, kGlobalScript, 0);
}
- if (!g_lingo->_dontPassEvent)
- runMovieScript(event);
+
+ runMovieScript(event);
}
void Lingo::runMovieScript(LEvent event) {
@@ -194,10 +194,11 @@ void Lingo::runMovieScript(LEvent event) {
* window [p.81 of D4 docs]
*/
+ if (_dontPassEvent)
+ return;
+
for (uint i = 0; i < _scriptContexts[kMovieScript].size(); i++) {
- processEvent(event,
- kMovieScript,
- i);
+ processEvent(event, kMovieScript, i);
// TODO: How do know which script handles the message?
}
debugC(9, kDebugEvents, "STUB: processEvent(event, kMovieScript, ?)");
@@ -233,8 +234,7 @@ void Lingo::processFrameEvent(LEvent event) {
}
processEvent(event, kFrameScript, entity);
- if (!g_lingo->_dontPassEvent)
- runMovieScript(event);
+ runMovieScript(event);
}
void Lingo::processGenericEvent(LEvent event) {
@@ -292,12 +292,17 @@ void Lingo::processEvent(LEvent event) {
default:
warning("processEvent: Unhandled event %s", _eventHandlerTypes[event]);
}
+
+ _dontPassEvent = false;
}
void Lingo::processEvent(LEvent event, ScriptType st, int entityId) {
if (entityId < 0)
return;
+ if (_dontPassEvent)
+ return;
+
debugC(9, kDebugEvents, "Lingo::processEvent(%s, %s, %d)", _eventHandlerTypes[event], scriptType2str(st), entityId);
_currentEntityId = entityId;