aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/wintermute/Base/BGame.cpp16
-rw-r--r--engines/wintermute/wintermute.cpp11
-rw-r--r--engines/wintermute/wintermute.h4
3 files changed, 9 insertions, 22 deletions
diff --git a/engines/wintermute/Base/BGame.cpp b/engines/wintermute/Base/BGame.cpp
index 9544f1552e..69a0a31288 100644
--- a/engines/wintermute/Base/BGame.cpp
+++ b/engines/wintermute/Base/BGame.cpp
@@ -568,12 +568,6 @@ void CBGame::DEBUG_DebugDisable() {
//////////////////////////////////////////////////////////////////////
void CBGame::LOG(HRESULT res, LPCSTR fmt, ...) {
-#ifndef __IPHONEOS__
- if (!_dEBUG_DebugMode) return;
-#endif
- /* time_t timeNow;
- time(&timeNow);
- struct tm *tm = localtime(&timeNow);*/
int secs = g_system->getMillis() / 1000;
int hours = secs / 3600;
secs = secs % 3600;
@@ -587,22 +581,16 @@ void CBGame::LOG(HRESULT res, LPCSTR fmt, ...) {
vsprintf(buff, fmt, va);
va_end(va);
-#ifdef __IPHONEOS__
- printf("%02d:%02d:%02d: %s\n", tm->tm_hour, tm->tm_min, tm->tm_sec, buff);
- fflush(stdout);
-#else
- if (_dEBUG_LogFile == NULL) return;
-
// redirect to an engine's own callback
if (_engineLogCallback) {
_engineLogCallback(buff, res, _engineLogCallbackData);
}
if (_debugMgr) _debugMgr->OnLog(res, buff);
- warning("%02d:%02d:%02d: %s\n", hours, mins, secs, buff);
+ debugCN(kWinterMuteDebugLog, "%02d:%02d:%02d: %s\n", hours, mins, secs, buff);
+
//fprintf((FILE *)_dEBUG_LogFile, "%02d:%02d:%02d: %s\n", hours, mins, secs, buff);
//fflush((FILE *)_dEBUG_LogFile);
-#endif
//QuickMessage(buff);
}
diff --git a/engines/wintermute/wintermute.cpp b/engines/wintermute/wintermute.cpp
index f34aa0d9f6..91a086af63 100644
--- a/engines/wintermute/wintermute.cpp
+++ b/engines/wintermute/wintermute.cpp
@@ -56,8 +56,8 @@ WinterMuteEngine::WinterMuteEngine(OSystem *syst)
//SearchMan.addSubDirectoryMatching(gameDataDir, "sound");
// Here is the right place to set up the engine specific debug channels
- DebugMan.addDebugChannel(kWinterMuteDebugExample, "example", "this is just an example for a engine specific debug channel");
- DebugMan.addDebugChannel(kWinterMuteDebugExample2, "example2", "also an example");
+ DebugMan.addDebugChannel(kWinterMuteDebugLog, "enginelog", "Covers the same output as the log-file in WME");
+ DebugMan.addDebugChannel(kWinterMuteDebugSaveGame, "savegame", "Savegames");
// Don't forget to register your random source
_rnd = new Common::RandomSource("WinterMute");
@@ -120,11 +120,10 @@ Common::Error WinterMuteEngine::run() {
// Your main even loop should be (invoked from) here.
debug("WinterMuteEngine::go: Hello, World!");
+ DebugMan.enableDebugChannel("enginelog");
// This test will show up if -d1 and --debugflags=example are specified on the commandline
- debugC(1, kWinterMuteDebugExample, "Example debug call");
-
- // This test will show up if --debugflags=example or --debugflags=example2 or both of them and -d3 are specified on the commandline
- debugC(3, kWinterMuteDebugExample | kWinterMuteDebugExample2, "Example debug call two");
+ debugC(1, kWinterMuteDebugLog, "Engine Debug-LOG enabled");
+ debugC(2, kWinterMuteDebugSaveGame , "Savegame debugging-enabled");
int ret = 1;
diff --git a/engines/wintermute/wintermute.h b/engines/wintermute/wintermute.h
index c3ade92fe4..0b607301d1 100644
--- a/engines/wintermute/wintermute.h
+++ b/engines/wintermute/wintermute.h
@@ -34,8 +34,8 @@ class CBGame;
class CSysClassRegistry;
// our engine debug channels
enum {
- kWinterMuteDebugExample = 1 << 0,
- kWinterMuteDebugExample2 = 1 << 1
+ kWinterMuteDebugLog = 1 << 0, // The debug-logs from the original engine
+ kWinterMuteDebugSaveGame = 1 << 1
// next new channel must be 1 << 2 (4)
// the current limitation is 32 debug channels (1 << 31 is the last one)
};