TITANIC: Refactor to use Engine debugger

This commit is contained in:
Paul Gilbert 2020-02-09 08:45:38 -08:00 committed by Filippos Karapetis
parent 17dc909e2c
commit 7f90c4e961
4 changed files with 2 additions and 14 deletions

View File

@ -141,9 +141,6 @@ bool Events::checkForNextFrameCounter() {
// Handle any idle updates
eventTarget()->onIdle();
// Give time to the debugger
_vm->_debugger->onFrame();
// Display the frame
_vm->_screen->update();

View File

@ -345,12 +345,7 @@ void CMainGameWindow::mouseWheel(const Point &mousePos, bool wheelUp) {
}
void CMainGameWindow::keyDown(Common::KeyState keyState) {
if (keyState.keycode == Common::KEYCODE_d && (keyState.flags & Common::KBD_CTRL)) {
// Attach to the debugger
_vm->_debugger->attach();
_vm->_debugger->onFrame();
} else if (keyState.keycode == Common::KEYCODE_c && (keyState.flags & Common::KBD_CTRL)) {
if (keyState.keycode == Common::KEYCODE_c && (keyState.flags & Common::KBD_CTRL)) {
// Cheat action
if (_project && g_vm->canLoadGameStateCurrently()) {
CViewItem *newView = _project->parseView("Cheat Room.Node 1.Cheat Rooms View");

View File

@ -60,7 +60,6 @@ TitanicEngine::TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDe
: _gameDescription(gameDesc), Engine(syst), _randomSource("Titanic") {
g_vm = this;
g_language = getLanguage();
_debugger = nullptr;
_events = nullptr;
_filesManager = nullptr;
_window = nullptr;
@ -93,7 +92,7 @@ bool TitanicEngine::initialize() {
return false;
}
_debugger = new Debugger(this);
setDebugger(new Debugger(this));
CSaveableObject::initClassList();
CEnterExitFirstClassState::init();
@ -127,7 +126,6 @@ bool TitanicEngine::initialize() {
}
void TitanicEngine::deinitialize() {
delete _debugger;
delete _events;
delete _window;
delete _screenManager;

View File

@ -73,7 +73,6 @@ class CFilesManager;
class CMainGameWindow;
class CString;
class CTrueTalkManager;
class Debugger;
class Events;
class OSScreenManager;
class CScriptHandler;
@ -109,7 +108,6 @@ protected:
Common::Error run() override;
bool hasFeature(EngineFeature f) const override;
public:
Debugger *_debugger;
Events *_events;
CFilesManager *_filesManager;
CMovieManager _movieManager;