[Scummvm-git-logs] scummvm master -> fb7992568fb9a93c17eef16d9c0bfa0d55e237e0

sev- sev at scummvm.org
Fri Feb 17 18:51:30 CET 2017


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

Summary:
e48dd540cc DIRECTOR: Added Events debug channel, more debug output in Lingo
c5295a1e03 DIRECTOR: Fix script references for D3 (now for real)
fb7992568f DIRECTOR: Beutify debug output


Commit: e48dd540cc85823f8e33ad2195eef691f6515903
    https://github.com/scummvm/scummvm/commit/e48dd540cc85823f8e33ad2195eef691f6515903
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-02-17T18:39:39+01:00

Commit Message:
DIRECTOR: Added Events debug channel, more debug output in Lingo

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


diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index f26d873..89c8aef 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -45,6 +45,7 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
 	DebugMan.addDebugChannel(kDebugLoading, "loading", "Loading");
 	DebugMan.addDebugChannel(kDebugImages, "images", "Image drawing");
 	DebugMan.addDebugChannel(kDebugText, "text", "Text rendering");
+	DebugMan.addDebugChannel(kDebugEvents, "events", "Event processing");
 
 	g_director = this;
 
diff --git a/engines/director/director.h b/engines/director/director.h
index eeb9c6b..805a51c 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -57,7 +57,8 @@ enum {
 	kDebugLingoCompile	= 1 << 1,
 	kDebugLoading		= 1 << 2,
 	kDebugImages		= 1 << 3,
-	kDebugText			= 1 << 4
+	kDebugText			= 1 << 4,
+	kDebugEvents		= 1 << 5
 };
 
 extern byte defaultPalette[768];
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index d3132f9..7639e6a 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -294,6 +294,8 @@ void Lingo::processEvent(LEvent event, ScriptType st, int entityId) {
 	if (entityId <= 0)
 		return;
 
+	debugC(1, kDebugEvents, "Lingo::processEvent(%s, %d, %d)", _eventHandlerTypes[event], st, entityId);
+
 	_currentEntityId = entityId;
 
 	if (!_eventHandlerTypes.contains(event))


Commit: c5295a1e03c4fc917d87341918a515594fe89ba2
    https://github.com/scummvm/scummvm/commit/c5295a1e03c4fc917d87341918a515594fe89ba2
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-02-17T18:40:08+01:00

Commit Message:
DIRECTOR: Fix script references for D3 (now for real)

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


diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index 7639e6a..a37b66f 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -304,8 +304,8 @@ void Lingo::processEvent(LEvent event, ScriptType st, int entityId) {
 	if (_handlers.contains(ENTITY_INDEX(event, entityId))) {
 		call(_eventHandlerTypes[event], 0); // D4+ Events
 		pop();
-	} else if (_scripts[st].contains(entityId + 1)) {
-		executeScript(st, entityId + 1); // D3 list of scripts.
+	} else if (_scripts[st].contains(entityId)) {
+		executeScript(st, entityId); // D3 list of scripts.
 	} else {
 		debugC(8, kDebugLingoExec, "STUB: processEvent(%s) for %d", _eventHandlerTypes[event], entityId);
 	}
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 53d1546..d4bebdc 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -863,8 +863,8 @@ void Score::update() {
 	_surface->copyFrom(*_trailSurface);
 
 	// Enter and exit from previous frame (Director 4)
-	_lingo->processEvent(kEventEnterFrame, kFrameScript, _frames[_currentFrame]->_actionId);
-	_lingo->processEvent(kEventExitFrame, kFrameScript, _frames[_currentFrame]->_actionId);
+	_lingo->processEvent(kEventEnterFrame, kFrameScript, _frames[_currentFrame]->_actionId - 1);
+	_lingo->processEvent(kEventExitFrame, kFrameScript, _frames[_currentFrame]->_actionId - 1);
 	// TODO Director 6 - another order
 
 	// TODO Director 6 step: send beginSprite event to any sprites whose span begin in the upcoming frame
@@ -971,7 +971,7 @@ void Score::processEvents() {
 					_lingo->processEvent(kEventMouseUp, kSpriteScript, _frames[_currentFrame]->_sprites[spriteId]->_scriptId);
 				} else {
 					// D3 doesn't have cast member or sprite scripts. Just Frame Scripts.
-					_lingo->processEvent(kEventMouseUp, kFrameScript, _frames[_currentFrame]->_sprites[spriteId]->_scriptId);
+					_lingo->processEvent(kEventMouseUp, kFrameScript, _frames[_currentFrame]->_sprites[spriteId]->_scriptId + 1);
 				}
 			}
 


Commit: fb7992568fb9a93c17eef16d9c0bfa0d55e237e0
    https://github.com/scummvm/scummvm/commit/fb7992568fb9a93c17eef16d9c0bfa0d55e237e0
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-02-17T18:51:09+01:00

Commit Message:
DIRECTOR: Beutify debug output

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


diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index a37b66f..759d40e 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -247,7 +247,7 @@ void Lingo::executeScript(ScriptType type, uint16 id) {
 		return;
 	}
 
-	debugC(2, kDebugLingoExec, "Executing script type: %d, id: %d", type, id);
+	debugC(2, kDebugLingoExec, "Executing script type: %s, id: %d", scriptType2str(type), id);
 
 	_currentScript = _scripts[type][id];
 	_pc = 0;
@@ -294,7 +294,7 @@ void Lingo::processEvent(LEvent event, ScriptType st, int entityId) {
 	if (entityId <= 0)
 		return;
 
-	debugC(1, kDebugEvents, "Lingo::processEvent(%s, %d, %d)", _eventHandlerTypes[event], st, entityId);
+	debugC(1, kDebugEvents, "Lingo::processEvent(%s, %s, %d)", _eventHandlerTypes[event], scriptType2str(st), entityId);
 
 	_currentEntityId = entityId;
 
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index d4bebdc..2544a61 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -41,6 +41,24 @@
 
 namespace Director {
 
+const char *scriptTypes[] = {
+	"MovieScript",
+	"SpriteScript",
+	"FrameScript",
+	"CastScript"
+};
+
+const char *scriptType2str(ScriptType scr) {
+	if (scr < 0)
+		return "NoneScript";
+
+	if (scr > kMaxScriptType)
+		return "<unknown>";
+
+	return scriptTypes[scr];
+}
+
+
 Score::Score(DirectorEngine *vm, Archive *archive) {
 	_vm = vm;
 	_surface = new Graphics::ManagedSurface;
diff --git a/engines/director/score.h b/engines/director/score.h
index 61d9118..6db5e33 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -52,6 +52,8 @@ enum ScriptType {
 	kMaxScriptType = 3
 };
 
+const char *scriptType2str(ScriptType scr);
+
 class Score {
 public:
 	Score(DirectorEngine *vm, Archive *);





More information about the Scummvm-git-logs mailing list