From fb7992568fb9a93c17eef16d9c0bfa0d55e237e0 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 17 Feb 2017 18:51:09 +0100 Subject: DIRECTOR: Beutify debug output --- engines/director/lingo/lingo.cpp | 4 ++-- engines/director/score.cpp | 18 ++++++++++++++++++ engines/director/score.h | 2 ++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp index a37b66f360..759d40e819 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 d4bebdc0fc..2544a612c0 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 ""; + + 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 61d911800e..6db5e33988 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 *); -- cgit v1.2.3