parent
2941d595bd
commit
d6872dba6b
4 changed files with 27 additions and 42 deletions
|
@ -32,8 +32,6 @@
|
||||||
/* FIXME - BIG HACK for MidiEmu */
|
/* FIXME - BIG HACK for MidiEmu */
|
||||||
Engine *g_engine = 0;
|
Engine *g_engine = 0;
|
||||||
|
|
||||||
uint16 g_debugLevel = 0;
|
|
||||||
|
|
||||||
Engine::Engine(OSystem *syst)
|
Engine::Engine(OSystem *syst)
|
||||||
: _system(syst), _gameDataPath(ConfMan.get("path")) {
|
: _system(syst), _gameDataPath(ConfMan.get("path")) {
|
||||||
g_engine = this;
|
g_engine = this;
|
||||||
|
@ -44,8 +42,6 @@ Engine::Engine(OSystem *syst)
|
||||||
// Add default file directory
|
// Add default file directory
|
||||||
File::addDefaultDirectory(_gameDataPath);
|
File::addDefaultDirectory(_gameDataPath);
|
||||||
|
|
||||||
g_debugLevel = ConfMan.getInt("debuglevel");
|
|
||||||
|
|
||||||
_saveFileMan = _system->getSavefileManager();
|
_saveFileMan = _system->getSavefileManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,16 +158,7 @@ void CDECL warning(const char *s, ...) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDECL debug(int level, const char *s, ...) {
|
static void debugHelper(const char *buf) {
|
||||||
char buf[STRINGBUFLEN];
|
|
||||||
va_list va;
|
|
||||||
|
|
||||||
if (level > g_debugLevel)
|
|
||||||
return;
|
|
||||||
|
|
||||||
va_start(va, s);
|
|
||||||
vsprintf(buf, s, va);
|
|
||||||
va_end(va);
|
|
||||||
#ifndef _WIN32_WCE
|
#ifndef _WIN32_WCE
|
||||||
printf("%s\n", buf);
|
printf("%s\n", buf);
|
||||||
#endif
|
#endif
|
||||||
|
@ -190,6 +177,20 @@ void CDECL debug(int level, const char *s, ...) {
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CDECL debug(int level, const char *s, ...) {
|
||||||
|
char buf[STRINGBUFLEN];
|
||||||
|
va_list va;
|
||||||
|
|
||||||
|
if (level > ConfMan.getInt("debuglevel"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
va_start(va, s);
|
||||||
|
vsprintf(buf, s, va);
|
||||||
|
va_end(va);
|
||||||
|
|
||||||
|
debugHelper(buf);
|
||||||
|
}
|
||||||
|
|
||||||
void CDECL debug(const char *s, ...) {
|
void CDECL debug(const char *s, ...) {
|
||||||
char buf[STRINGBUFLEN];
|
char buf[STRINGBUFLEN];
|
||||||
va_list va;
|
va_list va;
|
||||||
|
@ -197,20 +198,8 @@ void CDECL debug(const char *s, ...) {
|
||||||
va_start(va, s);
|
va_start(va, s);
|
||||||
vsprintf(buf, s, va);
|
vsprintf(buf, s, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
printf("%s\n", buf);
|
|
||||||
|
|
||||||
#if defined( USE_WINDBG )
|
debugHelper(buf);
|
||||||
strcat(buf, "\n");
|
|
||||||
#if defined( _WIN32_WCE )
|
|
||||||
TCHAR buf_unicode[1024];
|
|
||||||
MultiByteToWideChar(CP_ACP, 0, buf, strlen(buf) + 1, buf_unicode, sizeof(buf_unicode));
|
|
||||||
OutputDebugString(buf_unicode);
|
|
||||||
#else
|
|
||||||
OutputDebugString(buf);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
fflush(stdout);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkHeap() {
|
void checkHeap() {
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
*/
|
*/
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
|
||||||
|
#include "common/config-manager.h"
|
||||||
#include "common/file.h"
|
#include "common/file.h"
|
||||||
#include "common/str.h"
|
#include "common/str.h"
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
|
@ -35,8 +36,6 @@
|
||||||
|
|
||||||
#include "common/debugger.cpp"
|
#include "common/debugger.cpp"
|
||||||
|
|
||||||
extern uint16 g_debugLevel;
|
|
||||||
|
|
||||||
namespace Scumm {
|
namespace Scumm {
|
||||||
|
|
||||||
void CDECL debugC(int channel, const char *s, ...) {
|
void CDECL debugC(int channel, const char *s, ...) {
|
||||||
|
@ -45,7 +44,7 @@ void CDECL debugC(int channel, const char *s, ...) {
|
||||||
|
|
||||||
// FIXME: Still spew all debug at -d9, for crashes in startup etc.
|
// FIXME: Still spew all debug at -d9, for crashes in startup etc.
|
||||||
// Add setting from commandline ( / abstract channel interface)
|
// Add setting from commandline ( / abstract channel interface)
|
||||||
if (!(g_scumm->_debugFlags & channel) && (g_debugLevel < 9))
|
if (!(g_scumm->_debugFlags & channel) && (ConfMan.getInt("debuglevel") < 9))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
va_start(va, s);
|
va_start(va, s);
|
||||||
|
@ -593,10 +592,10 @@ bool ScummDebugger::Cmd_DebugLevel(int argc, const char **argv) {
|
||||||
if (_vm->_debugMode == false)
|
if (_vm->_debugMode == false)
|
||||||
DebugPrintf("Debugging is not enabled at this time\n");
|
DebugPrintf("Debugging is not enabled at this time\n");
|
||||||
else
|
else
|
||||||
DebugPrintf("Debugging is currently set at level %d\n", g_debugLevel);
|
DebugPrintf("Debugging is currently set at level %d\n", ConfMan.getInt("debuglevel"));
|
||||||
} else { // set level
|
} else { // set level
|
||||||
int level = atoi(argv[1]);
|
int level = atoi(argv[1]);
|
||||||
g_debugLevel = level;
|
ConfMan.set("debuglevel", level, Common::ConfigManager::kTransientDomain);
|
||||||
if (level > 0) {
|
if (level > 0) {
|
||||||
_vm->_debugMode = true;
|
_vm->_debugMode = true;
|
||||||
DebugPrintf("Debug level set to level %d\n", level);
|
DebugPrintf("Debug level set to level %d\n", level);
|
||||||
|
|
|
@ -20,12 +20,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
#include "common/config-manager.h"
|
||||||
#include "common/debugger.cpp"
|
#include "common/debugger.cpp"
|
||||||
#include "simon/debugger.h"
|
#include "simon/debugger.h"
|
||||||
#include "simon/simon.h"
|
#include "simon/simon.h"
|
||||||
|
|
||||||
extern uint16 g_debugLevel;
|
|
||||||
|
|
||||||
namespace Simon {
|
namespace Simon {
|
||||||
|
|
||||||
Debugger::Debugger(SimonEngine *vm)
|
Debugger::Debugger(SimonEngine *vm)
|
||||||
|
@ -88,10 +87,10 @@ bool Debugger::Cmd_DebugLevel(int argc, const char **argv) {
|
||||||
if (_vm->_debugMode == false)
|
if (_vm->_debugMode == false)
|
||||||
DebugPrintf("Debugging is not enabled at this time\n");
|
DebugPrintf("Debugging is not enabled at this time\n");
|
||||||
else
|
else
|
||||||
DebugPrintf("Debugging is currently set at level %d\n", g_debugLevel);
|
DebugPrintf("Debugging is currently set at level %d\n", ConfMan.getInt("debuglevel"));
|
||||||
} else { // set level
|
} else { // set level
|
||||||
int level = atoi(argv[1]);
|
int level = atoi(argv[1]);
|
||||||
g_debugLevel = level;
|
ConfMan.set("debuglevel", level, Common::ConfigManager::kTransientDomain);
|
||||||
if (level > 0 && level < 10) {
|
if (level > 0 && level < 10) {
|
||||||
_vm->_debugMode = true;
|
_vm->_debugMode = true;
|
||||||
DebugPrintf("Debug level set to level %d\n", level);
|
DebugPrintf("Debug level set to level %d\n", level);
|
||||||
|
|
|
@ -45,8 +45,6 @@
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern uint16 g_debugLevel;
|
|
||||||
|
|
||||||
struct SimonGameSettings {
|
struct SimonGameSettings {
|
||||||
const char *name;
|
const char *name;
|
||||||
const char *description;
|
const char *description;
|
||||||
|
@ -4004,13 +4002,13 @@ int SimonEngine::go() {
|
||||||
_continous_vgascript = false;
|
_continous_vgascript = false;
|
||||||
_draw_images_debug=false;
|
_draw_images_debug=false;
|
||||||
|
|
||||||
if (g_debugLevel == 2)
|
if (ConfMan.getInt("debuglevel") == 2)
|
||||||
_continous_mainscript = true;
|
_continous_mainscript = true;
|
||||||
if (g_debugLevel == 3)
|
if (ConfMan.getInt("debuglevel") == 3)
|
||||||
_continous_vgascript = true;
|
_continous_vgascript = true;
|
||||||
if (g_debugLevel == 4)
|
if (ConfMan.getInt("debuglevel") == 4)
|
||||||
_start_mainscript = true;
|
_start_mainscript = true;
|
||||||
if (g_debugLevel == 5)
|
if (ConfMan.getInt("debuglevel") == 5)
|
||||||
_start_vgascript = true;
|
_start_vgascript = true;
|
||||||
|
|
||||||
if (_game & GF_TALKIE) {
|
if (_game & GF_TALKIE) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue