From 00b64e01d40a6d11f098b13ffd3ceda9d544bfc7 Mon Sep 17 00:00:00 2001 From: yinsimei Date: Sat, 3 Jun 2017 19:50:02 +0200 Subject: [PATCH] SLUDGE: Add debug channel for fatal msg --- engines/sludge/newfatal.cpp | 3 ++- engines/sludge/sludge.cpp | 2 +- engines/sludge/sludge.h | 2 +- engines/sludge/sludger.cpp | 6 +++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/engines/sludge/newfatal.cpp b/engines/sludge/newfatal.cpp index 477a7f96739..94415695590 100644 --- a/engines/sludge/newfatal.cpp +++ b/engines/sludge/newfatal.cpp @@ -35,6 +35,7 @@ #include "stringy.h" #include "errors.h" #include "graphics.h" +#include "sludge.h" namespace Sludge { @@ -133,7 +134,7 @@ void setFatalInfo(const char *userFunc, const char *BIF) { if (fatalInfo) sprintf(fatalInfo, "Currently in this sub: %s\nCalling: %s", userFunc, BIF); - debug("%s", fatalInfo); + debug(kSludgeDebugFatal, "%s", fatalInfo); } void setResourceForFatal(int n) { diff --git a/engines/sludge/sludge.cpp b/engines/sludge/sludge.cpp index 86c4980b71b..b679a0994fc 100644 --- a/engines/sludge/sludge.cpp +++ b/engines/sludge/sludge.cpp @@ -40,7 +40,7 @@ SludgeEngine::SludgeEngine(OSystem *syst, const SludgeGameDescription *gameDesc) _rnd = new Common::RandomSource("sludge"); // Add debug channels - DebugMan.addDebugChannel(kSludgeDebugScript, "Script", "Script debug level"); + DebugMan.addDebugChannel(kSludgeDebugFatal, "Script", "Script debug level"); DebugMan.addDebugChannel(kSludgeDebugDataLoad, "Data Load", "Data loading debug level"); DebugMan.addDebugChannel(kSludgeDebugStackMachine, "Stack Machine", "Stack Machine debug level"); DebugMan.addDebugChannel(kSludgeDebugBuiltin, "Built-in", "Built-in debug level"); diff --git a/engines/sludge/sludge.h b/engines/sludge/sludge.h index 73105c41600..a4e96c70cf0 100644 --- a/engines/sludge/sludge.h +++ b/engines/sludge/sludge.h @@ -37,7 +37,7 @@ struct SludgeGameDescription; // debug channels enum { - kSludgeDebugScript = 1 << 0, + kSludgeDebugFatal = 1 << 0, kSludgeDebugDataLoad = 1 << 1, kSludgeDebugStackMachine = 1 << 2, kSludgeDebugBuiltin = 1 << 3, diff --git a/engines/sludge/sludger.cpp b/engines/sludge/sludger.cpp index f44cbbcbbf0..aca52728d52 100644 --- a/engines/sludge/sludger.cpp +++ b/engines/sludge/sludger.cpp @@ -172,9 +172,9 @@ Common::File *openAndVerify(char *filename, char extra1, char extra2, } char c; c = fp->readByte(); - debug("%c", c); + debug(kSludgeDebugDataLoad, "%c", c); while ((c = fp->readByte())) { - debug("%c", c); + debug(kSludgeDebugDataLoad, "%c", c); } int majVersion = fp->readByte(); @@ -519,7 +519,7 @@ bool initSludge(char *filename) { } numGlobals = fp->readUint16BE(); - debug("numGlobals : %i", numGlobals); + debug(kSludgeDebugDataLoad, "numGlobals : %i", numGlobals); globalVars = new variable[numGlobals]; if (!checkNew(globalVars))