diff options
author | Max Horn | 2002-12-16 22:46:17 +0000 |
---|---|---|
committer | Max Horn | 2002-12-16 22:46:17 +0000 |
commit | e6e8468a31d04d0e5136623e5f7463c1579e0981 (patch) | |
tree | 7e2a4d746d0bd0717127ffbaaa8180bd859c9b0a /scumm/debugger.cpp | |
parent | 99a8e393169182992e4fd0758c6064fbb731beec (diff) | |
download | scummvm-rg350-e6e8468a31d04d0e5136623e5f7463c1579e0981.tar.gz scummvm-rg350-e6e8468a31d04d0e5136623e5f7463c1579e0981.tar.bz2 scummvm-rg350-e6e8468a31d04d0e5136623e5f7463c1579e0981.zip |
indentation fixes; added a constructor (after all the debugger is a global var which is not allocated by new, hence we can't relay on memory being zeroed). And no I am not actually gonna use force against Endy, I just was frustrated :-)
svn-id: r6005
Diffstat (limited to 'scumm/debugger.cpp')
-rw-r--r-- | scumm/debugger.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp index 6c5b0d2e96..bbb927b616 100644 --- a/scumm/debugger.cpp +++ b/scumm/debugger.cpp @@ -17,6 +17,15 @@ #define Debug_Printf printf #endif +ScummDebugger::ScummDebugger() +{ + _s = 0; + _frame_countdown = 0; + _dvar_count = 0; + _dcmd_count = 0; + _detach_now = false; +} + // Initialisation Functions void ScummDebugger::attach(Scumm *s) { @@ -77,7 +86,7 @@ void ScummDebugger::on_frame() { _s->_sound->pauseSounds(old_soundsPaused); // Resume previous sound state if (_detach_now) // Detach if we're finished with the debugger - detach(); + detach(); } } @@ -95,7 +104,8 @@ bool ScummDebugger::debuggerInputCallback(ConsoleDialog *console, const char *in // Now the fun stuff: // Command/Variable registration functions -void ScummDebugger::DVar_Register(char *varname, void *pointer, int type, int optional) { +void ScummDebugger::DVar_Register(const char *varname, void *pointer, int type, int optional) { + assert(_dvar_count < (int)sizeof(_dvars)); strcpy(_dvars[_dvar_count].name, varname); _dvars[_dvar_count].type = type; _dvars[_dvar_count].variable = pointer; @@ -104,7 +114,8 @@ void ScummDebugger::DVar_Register(char *varname, void *pointer, int type, int op _dvar_count++; } -void ScummDebugger::DCmd_Register(char *cmdname, DebugProc pointer) { +void ScummDebugger::DCmd_Register(const char *cmdname, DebugProc pointer) { + assert(_dcmd_count < (int)sizeof(_dcmds)); strcpy(_dcmds[_dcmd_count].name, cmdname); _dcmds[_dcmd_count].function = pointer; |