LURE: Refactor to use Engine debugger

This commit is contained in:
Paul Gilbert 2020-02-08 22:09:23 -08:00 committed by Filippos Karapetis
parent afa27aa7c5
commit 83d7030d84
5 changed files with 1 additions and 27 deletions

View File

@ -129,7 +129,6 @@ void FightsManager::fightLoop() {
} }
Screen::getReference().update(); Screen::getReference().update();
game.debugger().onFrame();
g_system->delayMillis(10); g_system->delayMillis(10);
} }
@ -200,14 +199,6 @@ void FightsManager::checkEvents() {
engine.quitGame(); engine.quitGame();
return; return;
case Common::KEYCODE_d:
if (events.event().kbd.hasFlags(Common::KBD_CTRL)) {
// Activate the debugger
game.debugger().attach();
return;
}
break;
default: default:
// Scan through the mapping list for a move for the keypress // Scan through the mapping list for a move for the keypress
const KeyMapping *keyPtr = &keyList[0]; const KeyMapping *keyPtr = &keyList[0];

View File

@ -47,7 +47,7 @@ Game &Game::getReference() {
Game::Game() { Game::Game() {
int_game = this; int_game = this;
_debugger = new Debugger(); g_engine->setDebugger(new Debugger());
_fastTextFlag = false; _fastTextFlag = false;
_preloadFlag = false; _preloadFlag = false;
_debugFlag = gDebugLevel >= ERROR_BASIC; _debugFlag = gDebugLevel >= ERROR_BASIC;
@ -56,7 +56,6 @@ Game::Game() {
} }
Game::~Game() { Game::~Game() {
delete _debugger;
} }
void Game::tick() { void Game::tick() {
@ -190,13 +189,6 @@ void Game::execute() {
if (events.type() == Common::EVENT_KEYDOWN) { if (events.type() == Common::EVENT_KEYDOWN) {
uint16 roomNum = room.roomNumber(); uint16 roomNum = room.roomNumber();
if ((events.event().kbd.hasFlags(Common::KBD_CTRL)) &&
(events.event().kbd.keycode == Common::KEYCODE_d)) {
// Activate the debugger
_debugger->attach();
break;
}
// Handle special keys // Handle special keys
bool handled = true; bool handled = true;
switch (events.event().kbd.keycode) { switch (events.event().kbd.keycode) {
@ -276,8 +268,6 @@ void Game::execute() {
system.updateScreen(); system.updateScreen();
system.delayMillis(10); system.delayMillis(10);
_debugger->onFrame();
} }
room.leaveRoom(); room.leaveRoom();

View File

@ -43,7 +43,6 @@ enum GameState {GS_ERROR = 1, GS_TICK = 2, GS_TOCK = 4, GS_PROT = 8, GS_RESTART
class Game { class Game {
private: private:
Debugger *_debugger;
bool _fastTextFlag, _soundFlag; bool _fastTextFlag, _soundFlag;
uint8 _state; uint8 _state;
uint16 _tellCommands[MAX_TELL_COMMANDS * 3 + 1]; uint16 _tellCommands[MAX_TELL_COMMANDS * 3 + 1];
@ -82,7 +81,6 @@ public:
bool &debugFlag() { return _debugFlag; } bool &debugFlag() { return _debugFlag; }
bool fastTextFlag() { return _fastTextFlag; } bool fastTextFlag() { return _fastTextFlag; }
bool soundFlag() { return _soundFlag; } bool soundFlag() { return _soundFlag; }
Debugger &debugger() { return *_debugger; }
// Menu item support methods // Menu item support methods
void doDebugMenu(); void doDebugMenu();

View File

@ -248,10 +248,6 @@ bool LureEngine::loadGame(uint8 slotNumber) {
return true; return true;
} }
GUI::Debugger *LureEngine::getDebugger() {
return !Game::isCreated() ? NULL : &Game::getReference().debugger();
}
void LureEngine::syncSoundSettings() { void LureEngine::syncSoundSettings() {
Engine::syncSoundSettings(); Engine::syncSoundSettings();

View File

@ -116,7 +116,6 @@ public:
LureLanguage getLureLanguage() const; LureLanguage getLureLanguage() const;
Common::Language getLanguage() const; Common::Language getLanguage() const;
Common::Platform getPlatform() const; Common::Platform getPlatform() const;
GUI::Debugger *getDebugger() override;
bool isEGA() const { return (getFeatures() & GF_EGA) != 0; } bool isEGA() const { return (getFeatures() & GF_EGA) != 0; }
Common::Error loadGameState(int slot) override { Common::Error loadGameState(int slot) override {