diff options
author | Eugene Sandulenko | 2010-06-15 10:30:26 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2010-06-15 10:30:26 +0000 |
commit | 295edafdc4b266a7283ba494e685dfb22f132c6a (patch) | |
tree | 7305d108c0215b0b58fa028bca965c7962b31214 | |
parent | 409fe0bd561e75b7312e4143b5e9c3803322430e (diff) | |
download | scummvm-rg350-295edafdc4b266a7283ba494e685dfb22f132c6a.tar.gz scummvm-rg350-295edafdc4b266a7283ba494e685dfb22f132c6a.tar.bz2 scummvm-rg350-295edafdc4b266a7283ba494e685dfb22f132c6a.zip |
AGI: improve script-related debug output.
svn-id: r49740
-rw-r--r-- | engines/agi/op_cmd.cpp | 27 | ||||
-rw-r--r-- | engines/agi/sprite.cpp | 2 |
2 files changed, 15 insertions, 14 deletions
diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp index d7e3ba416c..f31e1d156d 100644 --- a/engines/agi/op_cmd.cpp +++ b/engines/agi/op_cmd.cpp @@ -209,47 +209,38 @@ cmd(object_on_anything) { } cmd(object_on_land) { - debugC(4, kDebugLevelScripts, "p0 = %d", p0); vt.flags |= ON_LAND; } cmd(object_on_water) { - debugC(4, kDebugLevelScripts, "p0 = %d", p0); vt.flags |= ON_WATER; } cmd(observe_horizon) { - debugC(4, kDebugLevelScripts, "p0 = %d", p0); vt.flags &= ~IGNORE_HORIZON; } cmd(ignore_horizon) { - debugC(4, kDebugLevelScripts, "p0 = %d", p0); vt.flags |= IGNORE_HORIZON; } cmd(observe_objs) { - debugC(4, kDebugLevelScripts, "p0 = %d", p0); vt.flags &= ~IGNORE_OBJECTS; } cmd(ignore_objs) { - debugC(4, kDebugLevelScripts, "p0 = %d", p0); vt.flags |= IGNORE_OBJECTS; } cmd(observe_blocks) { - debugC(4, kDebugLevelScripts, "p0 = %d", p0); vt.flags &= ~IGNORE_BLOCKS; } cmd(ignore_blocks) { - debugC(4, kDebugLevelScripts, "p0 = %d", p0); vt.flags |= IGNORE_BLOCKS; } cmd(set_horizon) { - debugC(4, kDebugLevelScripts, "p0 = %d", p0); game.horizon = p0; } @@ -328,7 +319,6 @@ cmd(set_cel_f) { } cmd(set_view) { - debugC(4, kDebugLevelScripts, "o%d, %d", p0, p1); g_agi->setView(&vt, p1); } @@ -423,12 +413,10 @@ cmd(word_to_string) { } cmd(open_dialogue) { - debugC(4, kDebugLevelScripts, "p0 = %d", p0); game.hasWindow = true; } cmd(close_dialogue) { - debugC(4, kDebugLevelScripts, "p0 = %d", p0); game.hasWindow = false; } @@ -1438,7 +1426,6 @@ cmd(display) { } cmd(display_f) { - debugC(4, kDebugLevelScripts, "p0 = %d", p0); g_agi->printText(curLogic->texts[_v[p2] - 1], _v[p1], 0, _v[p0], 40, game.colorFg, game.colorBg); } @@ -1781,6 +1768,9 @@ int AgiEngine::runLogic(int n) { int num = 0; ScriptPos sp; + debugC(2, kDebugLevelScripts, "================="); + debugC(2, kDebugLevelScripts, "runLogic(%d)", n); + sp.script = n; sp.curIP = 0; _game.execStack.push_back(sp); @@ -1816,6 +1806,11 @@ int AgiEngine::runLogic(int n) { _game.execStack.back().curIP = ip; + char st[101]; + int sz = MIN(_game.execStack.size(), 100u); + memset(st, '.', sz); + st[sz] = 0; + switch (op = *(code + ip++)) { case 0xff: // if (open/close) testIfCode(n); @@ -1833,6 +1828,9 @@ int AgiEngine::runLogic(int n) { } break; case 0x00: // return + debugC(2, kDebugLevelScripts, "%sreturn() // Logic %d", st, n); + debugC(2, kDebugLevelScripts, "================="); + _game.execStack.pop_back(); return 1; default: @@ -1840,7 +1838,8 @@ int AgiEngine::runLogic(int n) { memmove(p, code + ip, num); memset(p + num, 0, CMD_BSIZE - num); - debugC(2, kDebugLevelScripts, "%s(%d %d %d)", logicNamesCmd[op].name, p[0], p[1], p[2]); + debugC(2, kDebugLevelScripts, "%s%s(%d %d %d)", st, logicNamesCmd[op].name, p[0], p[1], p[2]); + agiCommand[op](this, p); ip += num; } diff --git a/engines/agi/sprite.cpp b/engines/agi/sprite.cpp index 26aa100d2a..70cc279420 100644 --- a/engines/agi/sprite.cpp +++ b/engines/agi/sprite.cpp @@ -332,6 +332,8 @@ void SpritesMgr::buildList(SpriteList &l, bool (*test)(VtEntry *, AgiEngine *)) } } + debugC(5, kDebugLevelSprites, "buildList() --> entries %d", i); + // now look for the smallest y value in the array and put that // sprite in the list for (j = 0; j < i; j++) { |