Skip to content

Commit

Permalink
AGOS: Switch script debugging to debug flag, rather than level 4.
Browse files Browse the repository at this point in the history
This is now set by --debugflags=script rather than -d 4, though
it will still require a debug level greater than 0.
  • Loading branch information
digitall committed May 11, 2014
1 parent 0c9390f commit 55d8a46
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions engines/agos/agos.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -247,7 +248,6 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)

_backFlag = false;

_dumpScripts = false;
_dumpVgaScripts = false;
_dumpImages = false;

Expand Down Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions engines/agos/agos.h
Expand Up @@ -63,7 +63,8 @@ namespace AGOS {

enum {
kDebugOpcode = 1 << 0,
kDebugVGAOpcode = 1 << 1
kDebugVGAOpcode = 1 << 1,
kDebugScript = 1 << 2
};

uint fileReadItemID(Common::SeekableReadStream *in);
Expand Down Expand Up @@ -332,7 +333,6 @@ class AGOSEngine : public Engine {
Common::Language _language;
bool _copyProtection;
bool _pause;
bool _dumpScripts;
bool _dumpVgaScripts;
bool _dumpImages;
bool _speech;
Expand Down
5 changes: 2 additions & 3 deletions engines/agos/subroutine.cpp
Expand Up @@ -20,8 +20,7 @@
*
*/



#include "common/debug-channels.h"
#include "common/file.h"
#include "common/textconsole.h"

Expand Down Expand Up @@ -531,7 +530,7 @@ int AGOSEngine::startSubroutine(Subroutine *sub) {
_classMode1 = 0;
_classMode2 = 0;

if (_dumpScripts)
if (DebugMan.isDebugChannelEnabled(kDebugScript))
dumpSubroutine(sub);

if (++_recursionDepth > 40)
Expand Down

0 comments on commit 55d8a46

Please sign in to comment.