aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTobia Tesan2017-06-19 12:20:51 +0200
committerEugene Sandulenko2017-07-05 08:35:33 +0200
commitce3aaa08d071a4f12246f579a40d3e7c6de3ec15 (patch)
tree03afbf2138df1ed1ffc00a0f5d152bb7a402bc87 /engines
parent38db7dfafedb51d0c98cadde7df746a429a663c3 (diff)
downloadscummvm-rg350-ce3aaa08d071a4f12246f579a40d3e7c6de3ec15.tar.gz
scummvm-rg350-ce3aaa08d071a4f12246f579a40d3e7c6de3ec15.tar.bz2
scummvm-rg350-ce3aaa08d071a4f12246f579a40d3e7c6de3ec15.zip
DIRECTOR: Implement processFrameEvent
Diffstat (limited to 'engines')
-rw-r--r--engines/director/lingo/lingo-events.cpp30
1 files changed, 27 insertions, 3 deletions
diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index 7820367b1b..cd34db280c 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -162,9 +162,33 @@ void Lingo::runMovieScript(LEvent event) {
}
void Lingo::processFrameEvent(LEvent event) {
- // Primary Event handler
- // Score Script
- // Movie Script
+ /* [in D4] the enterFrame, exitFrame, idle and timeout messages
+ * are sent to a frame script and then a movie script. If the
+ * current frame has no frame script when the event occurs, the
+ * message goes to movie scripts.
+ * [...]
+ * If more than one movie script handles the same message, Lingo
+ * searches the movie scripts according to their order in the cast
+ * window [p.81 of D4 docs]
+ */
+ // TODO: Same for D2-3 or not?
+ Score *score = _vm->getCurrentScore();
+
+ if (event == kEventTimeout) {
+ primaryEventHandler(event);
+ }
+
+ if (g_lingo->dontPassEvent) {
+ g_lingo->dontPassEvent = false;
+ } else {
+ assert(score->_frames[score->getCurrentFrame()] != nullptr);
+ if (!g_lingo->_scripts[kFrameScript].contains(kFrameScript)) {
+ processEvent(event,
+ kFrameScript,
+ score->_frames[score->getCurrentFrame()]->_actionId);
+ }
+ runMovieScript(event);
+ }
}
void Lingo::processGenericEvent(LEvent event) {