aboutsummaryrefslogtreecommitdiff
path: root/engines/director
diff options
context:
space:
mode:
authorEugene Sandulenko2016-08-19 19:04:07 +0200
committerEugene Sandulenko2016-08-19 19:04:07 +0200
commit97be9aa6dc204843f4a896f7e12f6cabc4322b44 (patch)
tree31cd1cf2b42d830869ac00642137e6e985d9c843 /engines/director
parent7896f2b6c2a93bd2c8d888b5a57432b818f3b873 (diff)
downloadscummvm-rg350-97be9aa6dc204843f4a896f7e12f6cabc4322b44.tar.gz
scummvm-rg350-97be9aa6dc204843f4a896f7e12f6cabc4322b44.tar.bz2
scummvm-rg350-97be9aa6dc204843f4a896f7e12f6cabc4322b44.zip
DIRECTOR: Lingo: Improved debug output
Diffstat (limited to 'engines/director')
-rw-r--r--engines/director/lingo/lingo-builtins.cpp2
-rw-r--r--engines/director/lingo/lingo-code.cpp15
-rw-r--r--engines/director/lingo/lingo-codegen.cpp2
-rw-r--r--engines/director/lingo/lingo.cpp12
4 files changed, 16 insertions, 15 deletions
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 798ab0824b..6738d4b707 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -545,7 +545,7 @@ void Lingo::b_alert(int nargs) {
d.toString();
- warning("STUB: b_alert");
+ warning("STUB: b_alert(%s)", d.u.s->c_str());
delete d.u.s;
}
diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index 95bb7f35ab..8712f0990c 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -702,24 +702,25 @@ void Lingo::c_ifcode() {
int end = READ_UINT32(&(*g_lingo->_currentScript)[savepc + 2]);
int skipEnd = READ_UINT32(&(*g_lingo->_currentScript)[savepc + 3]);
- debug(8, "executing cond (have to %s end)", skipEnd ? "skip" : "execute");
+ debugC(8, kDebugLingoExec, "executing cond (have to %s end)", skipEnd ? "skip" : "execute");
g_lingo->execute(savepc + 4); /* condition */
d = g_lingo->pop();
if (d.toInt()) {
- debug(8, "executing then");
+ debugC(8, kDebugLingoExec, "executing then");
g_lingo->execute(then);
} else if (elsep) { /* else part? */
- debug(8, "executing else");
+ debugC(8, kDebugLingoExec, "executing else");
g_lingo->execute(elsep);
}
if (!g_lingo->_returning && !skipEnd) {
g_lingo->_pc = end; /* next stmt */
- debug(8, "executing end");
- } else
- debug(8, "Skipped end");
+ debugC(8, kDebugLingoExec, "executing end");
+ } else {
+ debugC(8, kDebugLingoExec, "Skipped end");
+ }
}
void Lingo::c_whencode() {
@@ -809,7 +810,7 @@ void Lingo::call(Common::String &name, int nargs) {
if (!g_lingo->_handlers.contains(name)) {
Symbol *s = g_lingo->lookupVar(name.c_str(), false);
if (s && s->type == OBJECT) {
- debug(3, "Dereferencing object reference: %s to %s", name.c_str(), s->u.s->c_str());
+ debugC(3, kDebugLingoExec, "Dereferencing object reference: %s to %s", name.c_str(), s->u.s->c_str());
name = *s->u.s;
}
}
diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp
index 6584a92855..32ddea47ac 100644
--- a/engines/director/lingo/lingo-codegen.cpp
+++ b/engines/director/lingo/lingo-codegen.cpp
@@ -281,7 +281,7 @@ int Lingo::codeFunc(Common::String *s, int numpar) {
if (s->equalsIgnoreCase("me")) {
if (!g_lingo->_currentFactory.empty()) {
g_lingo->codeString(g_lingo->_currentFactory.c_str());
- debug(2, "Repaced 'me' with %s", g_lingo->_currentFactory.c_str());
+ debugC(2, kDebugLingoCompile, "Replaced 'me' with %s", g_lingo->_currentFactory.c_str());
} else {
warning("'me' out of factory method");
g_lingo->codeString(s->c_str());
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index 06e4e53886..d37da42670 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -121,17 +121,17 @@ const char *Lingo::findNextDefinition(const char *s) {
return NULL;
if (!strncmp(res, "macro ", 6)) {
- warning("See macro");
+ debugC(3, kDebugLingoCompile, "See macro");
return res;
}
if (!strncmp(res, "factory ", 8)) {
- warning("See factory");
+ debugC(3, kDebugLingoCompile, "See factory");
return res;
}
if (!strncmp(res, "method ", 7)) {
- warning("See method");
+ debugC(3, kDebugLingoCompile, "See method");
return res;
}
@@ -241,7 +241,7 @@ void Lingo::processEvent(LEvent event, int entityId) {
if (!_eventHandlerTypes.contains(event))
error("processEvent: Unknown event %d for entity %d", event, entityId);
- debug(2, "processEvent(%s) for %d", _eventHandlerTypes[event], entityId);
+ debug(2, "STUB: processEvent(%s) for %d", _eventHandlerTypes[event], entityId);
}
int Lingo::alignTypes(Datum &d1, Datum &d2) {
@@ -412,7 +412,7 @@ void Lingo::runTests() {
stream->read(script, size);
- warning("Compiling file %s of size %d, id: %d", fileList[i].c_str(), size, counter);
+ debugC(2, kDebugLingoCompile, "Compiling file %s of size %d, id: %d", fileList[i].c_str(), size, counter);
_hadError = false;
addCode(script, kMovieScript, counter);
@@ -420,7 +420,7 @@ void Lingo::runTests() {
if (!_hadError)
executeScript(kMovieScript, counter);
else
- warning("Skipping execution");
+ debugC(2, kDebugLingoCompile, "Skipping execution");
free(script);