From 55d8a461774f24db3f6f9a428469ca11353707e5 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Sun, 11 May 2014 13:17:16 +0100 Subject: [PATCH] AGOS: Switch script debugging to debug flag, rather than level 4. This is now set by --debugflags=script rather than -d 4, though it will still require a debug level greater than 0. --- engines/agos/agos.cpp | 3 +-- engines/agos/agos.h | 4 ++-- engines/agos/subroutine.cpp | 5 ++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp index 809311219f40..cf444bc84d83 100644 --- a/engines/agos/agos.cpp +++ b/engines/agos/agos.cpp @@ -147,6 +147,7 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd) DebugMan.addDebugChannel(kDebugOpcode, "opcode", "Opcode debug level"); DebugMan.addDebugChannel(kDebugVGAOpcode, "vga_opcode", "VGA Opcode debug level"); + DebugMan.addDebugChannel(kDebugScript, "script", "Script debug level"); _vcPtr = 0; _vcGetOutOfCode = 0; @@ -247,7 +248,6 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd) _backFlag = false; - _dumpScripts = false; _dumpVgaScripts = false; _dumpImages = false; @@ -678,7 +678,6 @@ Common::Error AGOSEngine::init() { // TODO: Use special debug levels instead of the following hack. switch (gDebugLevel) { - case 4: _dumpScripts = true; break; case 5: _dumpVgaScripts = true; break; } diff --git a/engines/agos/agos.h b/engines/agos/agos.h index 3eff6a889fe8..e1d7a54a754a 100644 --- a/engines/agos/agos.h +++ b/engines/agos/agos.h @@ -63,7 +63,8 @@ namespace AGOS { enum { kDebugOpcode = 1 << 0, - kDebugVGAOpcode = 1 << 1 + kDebugVGAOpcode = 1 << 1, + kDebugScript = 1 << 2 }; uint fileReadItemID(Common::SeekableReadStream *in); @@ -332,7 +333,6 @@ class AGOSEngine : public Engine { Common::Language _language; bool _copyProtection; bool _pause; - bool _dumpScripts; bool _dumpVgaScripts; bool _dumpImages; bool _speech; diff --git a/engines/agos/subroutine.cpp b/engines/agos/subroutine.cpp index a54a6c3b49db..f7eec9caaa2c 100644 --- a/engines/agos/subroutine.cpp +++ b/engines/agos/subroutine.cpp @@ -20,8 +20,7 @@ * */ - - +#include "common/debug-channels.h" #include "common/file.h" #include "common/textconsole.h" @@ -531,7 +530,7 @@ int AGOSEngine::startSubroutine(Subroutine *sub) { _classMode1 = 0; _classMode2 = 0; - if (_dumpScripts) + if (DebugMan.isDebugChannelEnabled(kDebugScript)) dumpSubroutine(sub); if (++_recursionDepth > 40)