[Scummvm-git-logs] scummvm master -> 348edec17606c9412ed23efefad36c76c7feac03

sev- sev at scummvm.org
Wed Jul 5 08:35:51 CEST 2017


This automated email contains information about 26 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
4f749fc007 DIRECTOR: Add Lingo::_dontPassEvent
ed66169adf DIRECTOR: Include frame.h in lingo-events.cpp
252c890bf5 DIRECTOR: Add Lingo::PrimaryEventHandler
38db7dfafe DIRECTOR: Add runMovieScript
ce3aaa08d0 DIRECTOR: Implement processFrameEvent
f9302e2c94 DIRECTOR: Handle frame enter/exit with 1-ary processEvent call
5a9a1571fa DIRECTOR: Include sprite.h in lingo-events.cpp
963bc4a351 DIRECTOR: Move kEventMouseUp/Down handling to processInputEvent
c267bc208f DIRECTOR: Handle kEventPrepareFrame in processFrameEvent
57dbfbf988 DIRECTOR: Call primaryEventHandler in processInputEvent
bfe3a316c4 DIRECTOR: Swap order of processEvent calls
0584f936dc DIRECTOR: Reorder processInputEvent
137e10eef2 DIRECTOR: Add kFrameScript call
3059c95abd DIRECTOR: Handle keyDown in 1-ary processEvent
5a4942b6c5 DIRECTOR: Remove "primary event handler" comment
8a6ef727cf DIRECTOR: Add kEventStart case for processGenericEvent
265b0882f6 DIRECTOR: Use 1-ary processEvent call to start movie
9735fb06ca DIRECTOR: Move #define CHANNEL_COUNT to director.h
f1d2149db6 DIRECTOR: Include director/frame.h and sprite.h in lingo.cpp
fd310f1fd3 DIRECTOR: Move executeImmediateScripts to lingo.cpp
1d5c92783e DIRECTOR: Add processSpriteEvent
8a6dce9fd3 DIRECTOR: Handle kEventIdle with 1-ary processEvent
7b675fc1de DIRECTOR: Handle kEventNone with 1-ary processEvent
9ddb97b4ed DIRECTOR: Handle kEventExitFrame with 1-ary processEvent
2ae7d9f86b DIRECTOR: Handle kEventPrepareMovie with 1-ary processEvent
348edec176 DIRECTOR: Make 3-ary processEvent private


Commit: 4f749fc0076fe8f56acb4263735a30363c072b61
    https://github.com/scummvm/scummvm/commit/4f749fc0076fe8f56acb4263735a30363c072b61
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Add Lingo::_dontPassEvent

I'm not sure whether this should go here or in Director.
I'm leaving it here because _dontPassEvent changes the semantics of event handling.

Changed paths:
    engines/director/lingo/lingo-builtins.cpp
    engines/director/lingo/lingo.h


diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index e12b20a..872008e 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -866,7 +866,8 @@ void Lingo::b_continue(int nargs) {
 }
 
 void Lingo::b_dontPassEvent(int nargs) {
-	warning("STUB: b_dontPassEvent");
+	g_lingo->dontPassEvent = true;
+	warning("dontPassEvent raised");
 }
 
 void Lingo::b_nothing(int nargs) {
diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h
index 15071b8..b0a014d 100644
--- a/engines/director/lingo/lingo.h
+++ b/engines/director/lingo/lingo.h
@@ -576,6 +576,8 @@ private:
 	DirectorEngine *_vm;
 
 	int _floatPrecision;
+
+	bool dontPassEvent;
 };
 
 extern Lingo *g_lingo;


Commit: ed66169adf760dc46d76e39b04f98d150dc73b98
    https://github.com/scummvm/scummvm/commit/ed66169adf760dc46d76e39b04f98d150dc73b98
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Include frame.h in lingo-events.cpp

Changed paths:
    engines/director/lingo/lingo-events.cpp


diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index f916020..3b49121 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "director/lingo/lingo.h"
+#include "director/frame.h"
 
 namespace Director {
 


Commit: 252c890bf5c60a451354cae17e6a9f90fe4a7ef6
    https://github.com/scummvm/scummvm/commit/252c890bf5c60a451354cae17e6a9f90fe4a7ef6
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Add Lingo::PrimaryEventHandler

Changed paths:
    engines/director/lingo/lingo-events.cpp
    engines/director/lingo/lingo.h


diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index 3b49121..e8f26c1 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -105,6 +105,39 @@ Symbol *Lingo::getHandler(Common::String &name) {
 	return _handlers[entityIndex];
 }
 
+void Lingo::primaryEventHandler(LEvent event) {
+	/* When an event occurs the message [...] is first sent to a
+	 * primary event handler: [... if exists it is executed] and the
+	 * event is passed on to other objects unless you explicitly stop
+	 * the message by including the dontPassEventCommand in the script
+	 * [D4 docs page 77]
+	 */
+	debugC(3, kDebugLingoExec, "STUB: primary event handler (%s) not implemented", _eventHandlerTypes[event]);
+	switch (event) {
+	case kEventMouseDown:
+	case kEventMouseUp:
+	case kEventKeyUp:
+	case kEventKeyDown:
+	case kEventTimeout:
+		// TODO
+		break;
+	default:
+		/* N.B.: No primary event handlers for events other than
+		 * keyup, keydown, mouseup, mousedown, timeout
+		 * [see: www.columbia.edu/itc/visualarts/r4110/s2001/handouts
+		 * /03_03_Event_Hierarchy.pdf]
+		 */
+		warning("primaryEventHandler() on event other than mouseDown, mouseUp, keyUp, keyDown, timeout");
+	}
+#ifdef DEBUG_DONTPASSEVENT
+	// #define DEBUG_DONTPASSEVENT to simulate raising of the dontPassEvent flag
+	g_lingo->dontPassEvent = true;
+	debugC(3, kDebugLingoExec, "STUB: primaryEventHandler raising dontPassEvent");
+#else
+	debugC(3, kDebugLingoExec, "STUB: primaryEventHandler not raising dontPassEvent");
+#endif
+}
+
 void Lingo::processInputEvent(LEvent event) {
 	// Primary Event handler
 	// Score Script
diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h
index b0a014d..acb086a 100644
--- a/engines/director/lingo/lingo.h
+++ b/engines/director/lingo/lingo.h
@@ -193,6 +193,7 @@ private:
 	// lingo-events.cpp
 private:
 	void initEventHandlerTypes();
+	void primaryEventHandler(LEvent event);
 	void processInputEvent(LEvent event);
 	void processFrameEvent(LEvent event);
 	void processGenericEvent(LEvent event);


Commit: 38db7dfafedb51d0c98cadde7df746a429a663c3
    https://github.com/scummvm/scummvm/commit/38db7dfafedb51d0c98cadde7df746a429a663c3
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Add runMovieScript

Changed paths:
    engines/director/lingo/lingo-events.cpp
    engines/director/lingo/lingo.h


diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index e8f26c1..7820367 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -146,6 +146,21 @@ void Lingo::processInputEvent(LEvent event) {
 	// Movie Script
 }
 
+void Lingo::runMovieScript(LEvent event) {
+	/* 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]
+	 */
+
+	for (uint i = 0; i < _scripts[kMovieScript].size(); i++) {
+		// processEvent(event,
+		//			 kMovieScript,
+		//			 ?);
+		// TODO: How do know which script handles the message?
+	}
+	debugC(3, kDebugLingoExec, "STUB: processEvent(event, kMovieScript, ?)");
+}
+
 void Lingo::processFrameEvent(LEvent event) {
 	// Primary Event handler
 	// Score Script
diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h
index acb086a..c17473f 100644
--- a/engines/director/lingo/lingo.h
+++ b/engines/director/lingo/lingo.h
@@ -197,7 +197,7 @@ private:
 	void processInputEvent(LEvent event);
 	void processFrameEvent(LEvent event);
 	void processGenericEvent(LEvent event);
-
+	void runMovieScript(LEvent event);
 public:
 	ScriptType event2script(LEvent ev);
 	Symbol *getHandler(Common::String &name);


Commit: ce3aaa08d071a4f12246f579a40d3e7c6de3ec15
    https://github.com/scummvm/scummvm/commit/ce3aaa08d071a4f12246f579a40d3e7c6de3ec15
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Implement processFrameEvent

Changed paths:
    engines/director/lingo/lingo-events.cpp


diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index 7820367..cd34db2 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) {


Commit: f9302e2c94773e32cd187377b01c65c2cad69abb
    https://github.com/scummvm/scummvm/commit/f9302e2c94773e32cd187377b01c65c2cad69abb
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Handle frame enter/exit with 1-ary processEvent call

Changed paths:
    engines/director/score.cpp


diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 2d78a70..639ac90 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -1179,7 +1179,7 @@ void Score::update() {
 	_frames[_currentFrame]->executeImmediateScripts();
 
 	// Enter and exit from previous frame (Director 4)
-	_lingo->processEvent(kEventEnterFrame, kFrameScript, _frames[_currentFrame]->_actionId);
+	_lingo->processEvent(kEventEnterFrame);
 	_lingo->processEvent(kEventNone, kFrameScript, _frames[_currentFrame]->_actionId);
 	// TODO Director 6 - another order
 


Commit: 5a9a1571fadac7711a177527db92d191d22290bf
    https://github.com/scummvm/scummvm/commit/5a9a1571fadac7711a177527db92d191d22290bf
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Include sprite.h in lingo-events.cpp

Changed paths:
    engines/director/lingo/lingo-events.cpp


diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index cd34db2..9e7f719 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -22,6 +22,7 @@
 
 #include "director/lingo/lingo.h"
 #include "director/frame.h"
+#include "director/sprite.h"
 
 namespace Director {
 


Commit: 963bc4a35121b6a9efacb5cf57194ee8e5ad23f8
    https://github.com/scummvm/scummvm/commit/963bc4a35121b6a9efacb5cf57194ee8e5ad23f8
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Move kEventMouseUp/Down handling to processInputEvent

Changed paths:
    engines/director/events.cpp
    engines/director/lingo/lingo-events.cpp


diff --git a/engines/director/events.cpp b/engines/director/events.cpp
index f55a7c8..81c80dc 100644
--- a/engines/director/events.cpp
+++ b/engines/director/events.cpp
@@ -71,12 +71,7 @@ void DirectorEngine::processEvents() {
 				sc->_currentMouseDownSpriteId = spriteId;
 
 				debugC(3, kDebugEvents, "event: Button Down @(%d, %d), sprite id: %d", pos.x, pos.y, spriteId);
-
-				if (getVersion() > 3) {
-					// TODO: check that this is the order of script execution!
-					_lingo->processEvent(kEventMouseDown, kCastScript, currentFrame->_sprites[spriteId]->_castId);
-					_lingo->processEvent(kEventMouseDown, kSpriteScript, currentFrame->_sprites[spriteId]->_scriptId);
-				}
+				_lingo->processEvent(kEventMouseDown);
 
 				if (currentFrame->_sprites[spriteId]->_moveable) {
 					warning("Moveable");
@@ -90,18 +85,7 @@ void DirectorEngine::processEvents() {
 
 				debugC(3, kDebugEvents, "event: Button Up @(%d, %d), sprite id: %d", pos.x, pos.y, spriteId);
 
-				if (getVersion() > 3) {
-					// TODO: check that this is the order of script execution!
-					_lingo->processEvent(kEventMouseUp, kCastScript, currentFrame->_sprites[spriteId]->_castId);
-					_lingo->processEvent(kEventMouseUp, kSpriteScript, currentFrame->_sprites[spriteId]->_scriptId);
-				} else {
-					// Frame script overrides sprite script
-					if (!currentFrame->_sprites[spriteId]->_scriptId)
-						_lingo->processEvent(kEventNone, kSpriteScript, currentFrame->_sprites[spriteId]->_castId + 1024);
-					else
-						_lingo->processEvent(kEventNone, kFrameScript, currentFrame->_sprites[spriteId]->_scriptId);
-				}
-
+				_lingo->processEvent(kEventMouseUp);
 				sc->_currentMouseDownSpriteId = 0;
 				break;
 
diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index 9e7f719..573ee52 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -145,6 +145,29 @@ void Lingo::processInputEvent(LEvent event) {
 	// Script of Cast Member
 	// Score Script
 	// Movie Script
+	Score *score = _vm->getCurrentScore();
+	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);
+		}
+	}
 }
 
 void Lingo::runMovieScript(LEvent event) {


Commit: c267bc208ffed2aef1ef7b7c47ebba070acb4775
    https://github.com/scummvm/scummvm/commit/c267bc208ffed2aef1ef7b7c47ebba070acb4775
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Handle kEventPrepareFrame in processFrameEvent

Changed paths:
    engines/director/lingo/lingo-events.cpp
    engines/director/score.cpp


diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index 573ee52..b65e752 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -205,12 +205,17 @@ void Lingo::processFrameEvent(LEvent 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);
+		int entity;
+
+		if (event == kEventPrepareFrame) {
+			entity = score->getCurrentFrame();
+		} else {
+			assert(score->_frames[score->getCurrentFrame()] != nullptr);
+			entity = score->_frames[score->getCurrentFrame()]->_actionId;
 		}
+		processEvent(event,
+		             kFrameScript,
+		             entity);
 		runMovieScript(event);
 	}
 }
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 639ac90..9a1f5dc 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -1195,7 +1195,7 @@ void Score::update() {
 
 	// TODO: Director 6 step: send prepareFrame event to all sprites and the script channel in upcoming frame
 	if (_vm->getVersion() >= 6)
-		_lingo->processEvent(kEventPrepareFrame, kFrameScript, _currentFrame);
+		_lingo->processEvent(kEventPrepareFrame);
 
 	Common::SortedArray<Label *>::iterator i;
 	if (_labels != NULL) {


Commit: 57dbfbf98806ac332926c0f3b133a6970ea7d442
    https://github.com/scummvm/scummvm/commit/57dbfbf98806ac332926c0f3b133a6970ea7d442
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Call primaryEventHandler in processInputEvent

Changed paths:
    engines/director/lingo/lingo-events.cpp


diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index b65e752..b9d901e 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);
+			}
 		}
 	}
 }


Commit: bfe3a316c44be89660ed999197af79b87be0f582
    https://github.com/scummvm/scummvm/commit/bfe3a316c44be89660ed999197af79b87be0f582
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Swap order of processEvent calls

This appears to be the correct order from docs and makes code easier to
reorder.

*Might* break stuff though.

Changed paths:
    engines/director/lingo/lingo-events.cpp


diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index b9d901e..71cdc38 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -164,8 +164,8 @@ void Lingo::processInputEvent(LEvent event) {
 		} 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);
+				g_lingo->processEvent(kEventMouseUp, kCastScript, currentFrame->_sprites[spriteId]->_castId);
 			} else {
 				// Frame script overrides sprite script
 				if (!currentFrame->_sprites[spriteId]->_scriptId)


Commit: 0584f936dc539d6f3bded18046df96eaf9b88b6b
    https://github.com/scummvm/scummvm/commit/0584f936dc539d6f3bded18046df96eaf9b88b6b
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Reorder processInputEvent

Changed paths:
    engines/director/lingo/lingo-events.cpp


diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index 71cdc38..4f261d8 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);
 	}
 }
 


Commit: 137e10eef24785a1e39aaffb6fd992e09bc49531
    https://github.com/scummvm/scummvm/commit/137e10eef24785a1e39aaffb6fd992e09bc49531
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Add kFrameScript call

This follows from D4 docs.

Changes semantics, *might* break stuff.

Changed paths:
    engines/director/lingo/lingo-events.cpp


diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index 4f261d8..e1a8cab 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -166,6 +166,8 @@ void Lingo::processInputEvent(LEvent event) {
 				g_lingo->processEvent(event, kSpriteScript, currentFrame->_sprites[spriteId]->_scriptId);
 			}
 			g_lingo->processEvent(event, kCastScript, currentFrame->_sprites[spriteId]->_castId);
+			g_lingo->processEvent(event, kFrameScript, score->_frames[score->getCurrentFrame()]->_actionId);
+			// TODO: Is the kFrameScript call above correct?
 		} else if (event == kEventMouseUp) {
 			// Frame script overrides sprite script
 			if (!currentFrame->_sprites[spriteId]->_scriptId)


Commit: 3059c95abd3944e6e628a32238dca1aeefecadbc
    https://github.com/scummvm/scummvm/commit/3059c95abd3944e6e628a32238dca1aeefecadbc
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Handle keyDown in 1-ary processEvent

Might change semantics by calling the standard chain for input events.

That is what the D4 docs suggest anyway.

Changed paths:
    engines/director/events.cpp
    engines/director/lingo/lingo-events.cpp


diff --git a/engines/director/events.cpp b/engines/director/events.cpp
index 81c80dc..b59202c 100644
--- a/engines/director/events.cpp
+++ b/engines/director/events.cpp
@@ -110,7 +110,7 @@ void DirectorEngine::processEvents() {
 					warning("Keycode: %d", _keyCode);
 				}
 
-				_lingo->processEvent(kEventKeyDown, kGlobalScript, 0);
+				_lingo->processEvent(kEventKeyDown);
 				break;
 
 			default:
diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index e1a8cab..15595b5 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -175,6 +175,10 @@ void Lingo::processInputEvent(LEvent event) {
 			else
 				g_lingo->processEvent(kEventNone, kFrameScript, currentFrame->_sprites[spriteId]->_scriptId);
 		}
+		if (event == kEventKeyDown) {
+			// TODO: is the above condition necessary or useful?
+			g_lingo->processEvent(event, kGlobalScript, 0);
+		}
 		runMovieScript(event);
 	}
 }


Commit: 5a4942b6c595d79d9aab6deef3552cbbeeeb2c2b
    https://github.com/scummvm/scummvm/commit/5a4942b6c595d79d9aab6deef3552cbbeeeb2c2b
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Remove "primary event handler" comment

According to D4 manual only mouse/key/timeout event can have primary
handler

Changed paths:
    engines/director/lingo/lingo-events.cpp


diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index 15595b5..f92ca8e 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -234,7 +234,6 @@ void Lingo::processFrameEvent(LEvent event) {
 }
 
 void Lingo::processGenericEvent(LEvent event) {
-	// Primary Event handler
 	// Movie Script
 }
 


Commit: 8a6ef727cf45b71647d9905363edc0a4805e4928
    https://github.com/scummvm/scummvm/commit/8a6ef727cf45b71647d9905363edc0a4805e4928
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Add kEventStart case for processGenericEvent

Changed paths:
    engines/director/lingo/lingo-events.cpp


diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index f92ca8e..ff3f2b0 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -235,6 +235,12 @@ void Lingo::processFrameEvent(LEvent event) {
 
 void Lingo::processGenericEvent(LEvent event) {
 	// Movie Script
+	int id = -1;
+	if (event == kEventStart)
+		id = 0;
+	else
+		warning("STUB: processGenericEvent called for something else than kEventStart or kEventPrepareMovie, additional logic probably needed");
+	g_lingo->processEvent(event, kMovieScript, id);
 }
 
 void Lingo::processEvent(LEvent event) {
@@ -251,6 +257,7 @@ void Lingo::processEvent(LEvent event) {
 			processFrameEvent(event);
 			break;
 
+		case kEventStart:
 		case kEventStartMovie:
 		case kEventStopMovie:
 		case kEventIdle:


Commit: 265b0882f60cf4d46af70c23462be7793973883e
    https://github.com/scummvm/scummvm/commit/265b0882f60cf4d46af70c23462be7793973883e
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Use 1-ary processEvent call to start movie

Perahsp a specialized Lingo::start() would be better for clarity for
this single one?

Changed paths:
    engines/director/resource.cpp


diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp
index da3b1b2..5e1d79c 100644
--- a/engines/director/resource.cpp
+++ b/engines/director/resource.cpp
@@ -75,7 +75,7 @@ void DirectorEngine::loadEXE(const Common::String movie) {
 	if (!exeStream)
 		error("Failed to open EXE '%s'", getEXEName().c_str());
 
-	_lingo->processEvent(kEventStart, kMovieScript, 0);
+	_lingo->processEvent(kEventStart);
 
 	exeStream->seek(-4, SEEK_END);
 	exeStream->seek(exeStream->readUint32LE());


Commit: 9735fb06ca24b2d4fe13cc74aa7672e67cbecd12
    https://github.com/scummvm/scummvm/commit/9735fb06ca24b2d4fe13cc74aa7672e67cbecd12
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Move #define CHANNEL_COUNT to director.h

Changed paths:
    engines/director/director.h
    engines/director/frame.h


diff --git a/engines/director/director.h b/engines/director/director.h
index 3c3e2e9..e199ff5 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -30,6 +30,8 @@
 #include "engines/engine.h"
 #include "director/cast.h"
 
+#define CHANNEL_COUNT 30
+
 namespace Common {
 class MacResManager;
 }
diff --git a/engines/director/frame.h b/engines/director/frame.h
index bf35af8..529a19a 100644
--- a/engines/director/frame.h
+++ b/engines/director/frame.h
@@ -33,8 +33,6 @@ namespace Director {
 
 class Sprite;
 
-#define CHANNEL_COUNT 30
-
 enum {
 	kChannelDataSize = (25 * 50)
 };


Commit: f1d2149db6b5da2a873f457a4d4687d8bcd1a908
    https://github.com/scummvm/scummvm/commit/f1d2149db6b5da2a873f457a4d4687d8bcd1a908
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Include director/frame.h and sprite.h in lingo.cpp

Changed paths:
    engines/director/lingo/lingo.cpp


diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index cb16431..d219362 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -26,6 +26,8 @@
 
 #include "director/lingo/lingo.h"
 #include "director/lingo/lingo-gr.h"
+#include "director/frame.h"
+#include "director/sprite.h"
 
 namespace Director {
 


Commit: fd310f1fd3b8336b7c9a2b771153e22a006a4e52
    https://github.com/scummvm/scummvm/commit/fd310f1fd3b8336b7c9a2b771153e22a006a4e52
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Move executeImmediateScripts to lingo.cpp

Changed paths:
    engines/director/frame.cpp
    engines/director/lingo/lingo.cpp
    engines/director/lingo/lingo.h
    engines/director/score.cpp


diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index cdf5283..cecc46d 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -545,14 +545,6 @@ void Frame::playTransition(Score *score) {
 	}
 }
 
-void Frame::executeImmediateScripts() {
-	for (uint16 i = 0; i < CHANNEL_COUNT; i++) {
-		if (_vm->getCurrentScore()->_immediateActions.contains(_sprites[i]->_scriptId)) {
-			g_lingo->processEvent(kEventMouseUp, kFrameScript, _sprites[i]->_scriptId);
-		}
-	}
-}
-
 void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) {
 	for (uint16 i = 0; i < CHANNEL_COUNT; i++) {
 		if (_sprites[i]->_enabled) {
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index d219362..77c0bbc 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -404,4 +404,12 @@ void Lingo::runTests() {
 	}
 }
 
+void Lingo::executeImmediateScripts(Frame *frame) {
+	for (uint16 i = 0; i < CHANNEL_COUNT; i++) {
+		if (_vm->getCurrentScore()->_immediateActions.contains(frame->_sprites[i]->_scriptId)) {
+			g_lingo->processEvent(kEventMouseUp, kFrameScript, frame->_sprites[i]->_scriptId);
+		}
+	}
+}
+
 } // End of namespace Director
diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h
index c17473f..0d0c56c 100644
--- a/engines/director/lingo/lingo.h
+++ b/engines/director/lingo/lingo.h
@@ -579,6 +579,9 @@ private:
 	int _floatPrecision;
 
 	bool dontPassEvent;
+
+public:
+	void executeImmediateScripts(Frame *frame);
 };
 
 extern Lingo *g_lingo;
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 9a1f5dc..e543054 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -1176,7 +1176,7 @@ void Score::update() {
 	_surface->clear();
 	_surface->copyFrom(*_trailSurface);
 
-	_frames[_currentFrame]->executeImmediateScripts();
+	_lingo->executeImmediateScripts(_frames[_currentFrame]);
 
 	// Enter and exit from previous frame (Director 4)
 	_lingo->processEvent(kEventEnterFrame);


Commit: 1d5c92783e2803d4db4c504ec87c327007c0f8a7
    https://github.com/scummvm/scummvm/commit/1d5c92783e2803d4db4c504ec87c327007c0f8a7
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Add processSpriteEvent

Changed paths:
    engines/director/lingo/lingo-events.cpp
    engines/director/lingo/lingo.h
    engines/director/score.cpp


diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index ff3f2b0..65c0249 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -203,10 +203,7 @@ void Lingo::processFrameEvent(LEvent event) {
 	 * 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]
+	 * [p.81 of D4 docs]
 	 */
 	// TODO: Same for D2-3 or not?
 	Score *score = _vm->getCurrentScore();
@@ -243,6 +240,21 @@ void Lingo::processGenericEvent(LEvent event) {
 	g_lingo->processEvent(event, kMovieScript, id);
 }
 
+void Lingo::processSpriteEvent(LEvent event) {
+	Score *score = _vm->getCurrentScore();
+	Frame *currentFrame = score->_frames[score->getCurrentFrame()];
+	if (event == kEventBeginSprite) {
+		// TODO: Check if this is also possibly a kSpriteScript?
+		for (uint16 i = 0; i < CHANNEL_COUNT; i++)
+			if (currentFrame->_sprites[i]->_enabled)
+				g_lingo->processEvent(event, kCastScript, currentFrame->_sprites[i]->_scriptId);
+
+	} else {
+		warning("STUB: processSpriteEvent called for something else than kEventBeginSprite, additional logic probably needed");
+	}
+
+}
+
 void Lingo::processEvent(LEvent event) {
 	switch (event) {
 		case kEventKeyUp:
@@ -264,7 +276,8 @@ void Lingo::processEvent(LEvent event) {
 		case kEventTimeout:
 			processGenericEvent(event);
 			break;
-
+		case kEventBeginSprite:
+			processSpriteEvent(event);
 		default:
 			warning("processEvent: Unhandled event %s", _eventHandlerTypes[event]);
 	}
diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h
index 0d0c56c..9a425f6 100644
--- a/engines/director/lingo/lingo.h
+++ b/engines/director/lingo/lingo.h
@@ -198,6 +198,7 @@ private:
 	void processFrameEvent(LEvent event);
 	void processGenericEvent(LEvent event);
 	void runMovieScript(LEvent event);
+	void processSpriteEvent(LEvent event);
 public:
 	ScriptType event2script(LEvent ev);
 	Symbol *getHandler(Common::String &name);
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index e543054..29be599 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -1183,19 +1183,12 @@ void Score::update() {
 	_lingo->processEvent(kEventNone, kFrameScript, _frames[_currentFrame]->_actionId);
 	// TODO Director 6 - another order
 
-	// TODO Director 6 step: send beginSprite event to any sprites whose span begin in the upcoming frame
 	if (_vm->getVersion() >= 6) {
-		for (uint16 i = 0; i < CHANNEL_COUNT; i++) {
-			if (_frames[_currentFrame]->_sprites[i]->_enabled) {
-				// TODO: Check if this is also possibly a kSpriteScript?
-				_lingo->processEvent(kEventBeginSprite, kCastScript, _frames[_currentFrame]->_sprites[i]->_scriptId);
-			}
-		}
-	}
-
-	// TODO: Director 6 step: send prepareFrame event to all sprites and the script channel in upcoming frame
-	if (_vm->getVersion() >= 6)
+		_lingo->processEvent(kEventBeginSprite);
+		// TODO Director 6 step: send beginSprite event to any sprites whose span begin in the upcoming frame
 		_lingo->processEvent(kEventPrepareFrame);
+		// TODO: Director 6 step: send prepareFrame event to all sprites and the script channel in upcoming frame
+	}
 
 	Common::SortedArray<Label *>::iterator i;
 	if (_labels != NULL) {


Commit: 8a6dce9fd334230ec80b2c444cbddfad2cb429d6
    https://github.com/scummvm/scummvm/commit/8a6dce9fd334230ec80b2c444cbddfad2cb429d6
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Handle kEventIdle with 1-ary processEvent

Changed paths:
    engines/director/events.cpp
    engines/director/lingo/lingo-events.cpp


diff --git a/engines/director/events.cpp b/engines/director/events.cpp
index b59202c..603582b 100644
--- a/engines/director/events.cpp
+++ b/engines/director/events.cpp
@@ -122,7 +122,7 @@ void DirectorEngine::processEvents() {
 		g_system->delayMillis(10);
 
 		if (sc->getCurrentFrame() > 0)
-			_lingo->processEvent(kEventIdle, kFrameScript, sc->getCurrentFrame());
+			_lingo->processEvent(kEventIdle);
 	}
 }
 
diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index 65c0249..7aabcff 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -217,7 +217,7 @@ void Lingo::processFrameEvent(LEvent event) {
 	} else {
 		int entity;
 
-		if (event == kEventPrepareFrame) {
+		if (event == kEventPrepareFrame || event == kEventIdle) {
 			entity = score->getCurrentFrame();
 		} else {
 			assert(score->_frames[score->getCurrentFrame()] != nullptr);
@@ -264,6 +264,7 @@ void Lingo::processEvent(LEvent event) {
 			processInputEvent(event);
 			break;
 
+		case kEventIdle:
 		case kEventEnterFrame:
 		case kEventExitFrame:
 			processFrameEvent(event);
@@ -272,7 +273,6 @@ void Lingo::processEvent(LEvent event) {
 		case kEventStart:
 		case kEventStartMovie:
 		case kEventStopMovie:
-		case kEventIdle:
 		case kEventTimeout:
 			processGenericEvent(event);
 			break;


Commit: 7b675fc1dee428aed4debff51383073a378d3784
    https://github.com/scummvm/scummvm/commit/7b675fc1dee428aed4debff51383073a378d3784
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Handle kEventNone with 1-ary processEvent

Changed paths:
    engines/director/lingo/lingo-events.cpp
    engines/director/score.cpp


diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index 7aabcff..7342bff 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -267,6 +267,7 @@ void Lingo::processEvent(LEvent event) {
 		case kEventIdle:
 		case kEventEnterFrame:
 		case kEventExitFrame:
+		case kEventNone:
 			processFrameEvent(event);
 			break;
 
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 29be599..ee0d416 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -1180,7 +1180,7 @@ void Score::update() {
 
 	// Enter and exit from previous frame (Director 4)
 	_lingo->processEvent(kEventEnterFrame);
-	_lingo->processEvent(kEventNone, kFrameScript, _frames[_currentFrame]->_actionId);
+	_lingo->processEvent(kEventNone);
 	// TODO Director 6 - another order
 
 	if (_vm->getVersion() >= 6) {


Commit: 9ddb97b4edf5be70233b0ec84cd7dea47329aa26
    https://github.com/scummvm/scummvm/commit/9ddb97b4edf5be70233b0ec84cd7dea47329aa26
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Handle kEventExitFrame with 1-ary processEvent

Changed paths:
    engines/director/score.cpp


diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index ee0d416..9371cba 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -1241,7 +1241,7 @@ void Score::update() {
 		}
 	}
 
-	_lingo->processEvent(kEventExitFrame, kFrameScript, _frames[_currentFrame]->_actionId);
+	_lingo->processEvent(kEventExitFrame);
 
 	_nextFrameTime = g_system->getMillis() + (float)_currentFrameRate / 60 * 1000;
 }


Commit: 2ae7d9f86bb5956fd0705d413f29dcfa6878b1a8
    https://github.com/scummvm/scummvm/commit/2ae7d9f86bb5956fd0705d413f29dcfa6878b1a8
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Handle kEventPrepareMovie with 1-ary processEvent

Changed paths:
    engines/director/lingo/lingo-events.cpp
    engines/director/score.cpp


diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index 7342bff..1dc131e 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -233,7 +233,7 @@ void Lingo::processFrameEvent(LEvent event) {
 void Lingo::processGenericEvent(LEvent event) {
 	// Movie Script
 	int id = -1;
-	if (event == kEventStart)
+	if (event == kEventStart || event == kEventPrepareMovie)
 		id = 0;
 	else
 		warning("STUB: processGenericEvent called for something else than kEventStart or kEventPrepareMovie, additional logic probably needed");
@@ -275,6 +275,7 @@ void Lingo::processEvent(LEvent event) {
 		case kEventStartMovie:
 		case kEventStopMovie:
 		case kEventTimeout:
+		case kEventPrepareMovie:
 			processGenericEvent(event);
 			break;
 		case kEventBeginSprite:
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 9371cba..64a4479 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -72,8 +72,6 @@ Score::Score(DirectorEngine *vm) {
 	if (_vm->getVersion() <= 3) {
 		_lingo->executeScript(kMovieScript, 0);
 	}
-
-	_lingo->processEvent(kEventPrepareMovie, kMovieScript, 0);
 	_movieScriptCount = 0;
 	_labels = NULL;
 	_font = NULL;


Commit: 348edec17606c9412ed23efefad36c76c7feac03
    https://github.com/scummvm/scummvm/commit/348edec17606c9412ed23efefad36c76c7feac03
Author: Tobia Tesan (tobia.tesan at gmail.com)
Date: 2017-07-05T08:35:33+02:00

Commit Message:
DIRECTOR: Make 3-ary processEvent private

Changed paths:
    engines/director/lingo/lingo.h


diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h
index 9a425f6..6cf7ceb 100644
--- a/engines/director/lingo/lingo.h
+++ b/engines/director/lingo/lingo.h
@@ -199,11 +199,11 @@ private:
 	void processGenericEvent(LEvent event);
 	void runMovieScript(LEvent event);
 	void processSpriteEvent(LEvent event);
+	void processEvent(LEvent event, ScriptType st, int entityId);
 public:
 	ScriptType event2script(LEvent ev);
 	Symbol *getHandler(Common::String &name);
 
-	void processEvent(LEvent event, ScriptType st, int entityId);
 	void processEvent(LEvent event);
 
 public:





More information about the Scummvm-git-logs mailing list