[Scummvm-git-logs] scummvm master -> 60f936d1f7e0abb92e1bb12b19c61d2b45b53749

stevenhoefel stevenhoefel at hotmail.com
Mon Jan 9 23:24:31 CET 2017


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

Summary:
60f936d1f7 DIRECTOR: More work to get events triggering. Loop all frames in score.


Commit: 60f936d1f7e0abb92e1bb12b19c61d2b45b53749
    https://github.com/scummvm/scummvm/commit/60f936d1f7e0abb92e1bb12b19c61d2b45b53749
Author: stevenhoefel (stevenhoefel at hotmail.com)
Date: 2017-01-10T09:24:21+11:00

Commit Message:
DIRECTOR: More work to get events triggering. Loop all frames in score.

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


diff --git a/engines/director/cast.h b/engines/director/cast.h
index a739ccc..0d06f23 100644
--- a/engines/director/cast.h
+++ b/engines/director/cast.h
@@ -40,7 +40,7 @@ enum CastType {
 	kCastShape = 8,
 	kCastMovie = 9,
 	kCastDigitalVideo = 10,
-	kCastScript = 11
+	kCastLingoScript = 11
 };
 
 struct Cast {
diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index c9f9c14..7531a87 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -856,7 +856,7 @@ void Lingo::c_call() {
 	g_lingo->call(name, nargs);
 }
 
-void Lingo::call(Common::String name, int nargs) {
+void Lingo::call(Common::String name, int entityId) {
 	bool dropArgs = false;
 
 	Symbol *sym;
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index 5eb687f..2811c0c 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -269,6 +269,7 @@ ScriptType Lingo::event2script(LEvent ev) {
 }
 
 void Lingo::processEvent(LEvent event, int entityId) {
+	if (entityId <= 0) return;
 	if (!_eventHandlerTypes.contains(event))
 		error("processEvent: Unknown event %d for entity %d", event, entityId);
 
@@ -277,7 +278,7 @@ void Lingo::processEvent(LEvent event, int entityId) {
 	if (st != kNoneScript) {
 		executeScript(st, entityId + 1);
 	} else if (_handlers.contains(_eventHandlerTypes[event])) {
-		call(_eventHandlerTypes[event], 0);
+		call(_eventHandlerTypes[event], entityId);
 		pop();
 	} else {
 		debugC(8, kDebugLingoExec, "STUB: processEvent(%s) for %d", _eventHandlerTypes[event], entityId);
diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h
index 0ed69de..a0355f3 100644
--- a/engines/director/lingo/lingo.h
+++ b/engines/director/lingo/lingo.h
@@ -275,7 +275,7 @@ public:
 	static void c_le();
 	static void c_call();
 
-	void call(Common::String name, int nargs);
+	void call(Common::String name, int entityId);
 
 	static void c_procret();
 
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index b3aee97..e525fba 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -477,12 +477,12 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id,
 		_casts[id] = new ButtonCast(castStream, _vm->getVersion());
 		_casts[id]->type = kCastButton;
 		break;
-	case kCastScript:
+	case kCastLingoScript:
 		warning("CASt: Script");
 		Common::hexdump(data, size1 + 16);
 
 		_casts[id] = new ScriptCast(castStream, _vm->getVersion());
-		_casts[id]->type = kCastScript;
+		_casts[id]->type = kCastLingoScript;
 		break;
 	default:
 		warning("Score::loadCastData(): Unhandled cast type: %d", castType);
@@ -519,7 +519,7 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id,
 
 		if (!ci->script.empty()) {
 			//the script type here could be wrong!
-			_lingo->addCode(ci->script.c_str(), _casts[id]->type == kCastScript ? kFrameScript : kSpriteScript, id);
+			_lingo->addCode(ci->script.c_str(), kCastScript, id);
 		}
 
 		_castsInfo[id] = ci;
@@ -898,7 +898,7 @@ void Score::startLoop() {
 	_lingo->processEvent(kEventStartMovie, 0);
 	_frames[_currentFrame]->prepareFrame(this);
 
-	while (!_stopPlay && _currentFrame < _frames.size() - 2) {
+	while (!_stopPlay && _currentFrame < _frames.size()) {
 		debugC(1, kDebugImages, "Current frame: %d", _currentFrame);
 		update();
 		processEvents();
diff --git a/engines/director/score.h b/engines/director/score.h
index b665842..cc3289e 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -47,8 +47,9 @@ enum ScriptType {
 	kMovieScript = 0,
 	kSpriteScript = 1,
 	kFrameScript = 2,
+	kCastScript = 3,
 	kNoneScript = -1,
-	kMaxScriptType = 2
+	kMaxScriptType = 3
 };
 
 class Score {





More information about the Scummvm-git-logs mailing list