aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/archetype/archetype.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2019-11-02 19:34:29 -0700
committerPaul Gilbert2019-11-11 18:20:29 -0800
commita3c646133f9c173b23ff775e03563e337be1cdaf (patch)
tree67d87f786f60c07f0197f7b42c200d446044b710 /engines/glk/archetype/archetype.cpp
parentd51d3d40861446f849564bb6af07ab35cb2c3e77 (diff)
downloadscummvm-rg350-a3c646133f9c173b23ff775e03563e337be1cdaf.tar.gz
scummvm-rg350-a3c646133f9c173b23ff775e03563e337be1cdaf.tar.bz2
scummvm-rg350-a3c646133f9c173b23ff775e03563e337be1cdaf.zip
GLK: ARCHETYPE: Switch from original's Debug enum to debug channels
Diffstat (limited to 'engines/glk/archetype/archetype.cpp')
-rw-r--r--engines/glk/archetype/archetype.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/engines/glk/archetype/archetype.cpp b/engines/glk/archetype/archetype.cpp
index 416cf6cc25..78ba906d3c 100644
--- a/engines/glk/archetype/archetype.cpp
+++ b/engines/glk/archetype/archetype.cpp
@@ -21,6 +21,7 @@
*/
#include "common/config-manager.h"
+#include "common/debug-channels.h"
#include "glk/archetype/archetype.h"
#include "glk/archetype/crypt.h"
#include "glk/archetype/expression.h"
@@ -41,6 +42,11 @@ Archetype *g_vm;
Archetype::Archetype(OSystem *syst, const GlkGameDescription &gameDesc) : GlkAPI(syst, gameDesc),
_saveSlot(-1) {
g_vm = this;
+
+ DebugMan.addDebugChannel(DEBUG_BYTES, "bytes", "Memory usage");
+ DebugMan.addDebugChannel(DEBUG_MSGS, "messages", "Messages debugging");
+ DebugMan.addDebugChannel(DEBUG_EXPR, "expressions", "Expressions debugging");
+ DebugMan.addDebugChannel(DEBUG_STMT, "statements", "Statements debugging");
}
void Archetype::runGame() {
@@ -268,12 +274,12 @@ bool Archetype::send_message(int transport, int message_sent, int recipient,
void *p;
ContextType c;
- if (message_sent == 0) {
+ if (message_sent == -1) {
cleanup(result);
return false;
}
- if ((Debug & DEBUG_MSGS) > 0) {
+ if (DebugMan.isDebugChannelEnabled(DEBUG_MSGS)) {
r._kind = IDENT;
r._data._ident.ident_kind = OBJECT_ID;
r._data._ident.ident_int = context.self;
@@ -673,7 +679,7 @@ void Archetype::eval_expr(ExprTree the_expr, ResultType &result, ContextType &co
cleanup(r1);
cleanup(r2);
- if ((Debug & DEBUG_EXPR) > 0) {
+ if (DebugMan.isDebugChannelEnabled(DEBUG_EXPR)) {
wrapout(" -- ", false);
display_expr(the_expr);
wrapout(" ==> ", false);
@@ -723,7 +729,7 @@ void Archetype::exec_stmt(StatementPtr the_stmt, ResultType &result, ContextType
undefine(r2);
cleanup(result);
- verbose = (Debug & DEBUG_STMT) > 0;
+ verbose = DebugMan.isDebugChannelEnabled(DEBUG_STMT);
if (verbose)
wrapout(" == ", false);