From 1d4c82885ddcc0442671c863eef643aef2dc7dda Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 17 Jul 2010 18:38:42 +0000 Subject: DEBUGGER: Simplify how our console debugger works / is used * Remove _isAttached member var and isAttached method * Engines now always call the onFrame method; whether it does something is decided by the debugger class resp. its subclasses * Make detach() protected instead of private, so that subclasses can invoke it * Remove _detach_now member var (call detach() instead). * Rename _frame_countdown to _frameCountdown and properly document it. * Add more doxygen comments * Cleanup svn-id: r50963 --- engines/scumm/debugger.cpp | 12 ++++-------- engines/scumm/scumm.cpp | 3 +-- 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'engines/scumm') diff --git a/engines/scumm/debugger.cpp b/engines/scumm/debugger.cpp index ea29e25a1f..b5a4070f0b 100644 --- a/engines/scumm/debugger.cpp +++ b/engines/scumm/debugger.cpp @@ -62,8 +62,6 @@ ScummDebugger::ScummDebugger(ScummEngine *s) _vm = s; // Register variables - DVar_Register("debug_countdown", &_frame_countdown, DVAR_INT, 0); - DVar_Register("scumm_speed", &_vm->_fastMode, DVAR_BYTE, 0); DVar_Register("scumm_room", &_vm->_currentRoom, DVAR_BYTE, 0); DVar_Register("scumm_roomresource", &_vm->_roomResource, DVAR_INT, 0); @@ -128,7 +126,7 @@ void ScummDebugger::postEnter() { bool ScummDebugger::Cmd_Restart(int argc, const char **argv) { _vm->restart(); - _detach_now = true; + detach(); return false; } @@ -202,7 +200,7 @@ bool ScummDebugger::Cmd_LoadGame(int argc, const char **argv) { _vm->requestLoad(slot); - _detach_now = true; + detach(); return false; } @@ -867,7 +865,7 @@ bool ScummDebugger::Cmd_Passcode(int argc, const char **argv) { } _vm->_bootParam = 0; - _detach_now = true; + detach(); } else { DebugPrintf("Current Passcode is %d \nUse 'passcode '\n",_vm->_scummVars[411]); @@ -878,9 +876,7 @@ bool ScummDebugger::Cmd_Passcode(int argc, const char **argv) { bool ScummDebugger::Cmd_ResetCursors(int argc, const char **argv) { _vm->resetCursors(); - - _detach_now = true; - + detach(); return false; } diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 7c3b8a4a1d..b44184f5cb 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1840,8 +1840,7 @@ Common::Error ScummEngine::go() { while (!shouldQuit()) { - if (_debugger->isAttached()) - _debugger->onFrame(); + _debugger->onFrame(); // Randomize the PRNG by calling it at regular intervals. This ensures // that it will be in a different state each time you run the program. -- cgit v1.2.3