NEVERHOOD: Refactor to use Engine debugger

This commit is contained in:
Paul Gilbert 2020-02-08 22:19:11 -08:00 committed by Filippos Karapetis
parent 3a66feb5d9
commit 7a2dc70d20
2 changed files with 3 additions and 11 deletions

View File

@ -47,7 +47,8 @@
namespace Neverhood {
NeverhoodEngine::NeverhoodEngine(OSystem *syst, const NeverhoodGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc), _console(nullptr) {
NeverhoodEngine::NeverhoodEngine(OSystem *syst, const NeverhoodGameDescription *gameDesc) :
Engine(syst), _gameDescription(gameDesc) {
// Setup mixer
if (!_mixer->isReady()) {
warning("Sound initialization failed.");
@ -84,7 +85,7 @@ Common::Error NeverhoodEngine::run() {
_gameVars = new GameVars();
_screen = new Screen(this);
_res = new ResourceMan();
_console = new Console(this);
setDebugger(new Console(this));
if (isDemo()) {
_res->addArchive("a.blb");
@ -135,7 +136,6 @@ Common::Error NeverhoodEngine::run() {
delete _soundMan;
delete _audioResourceMan;
delete _console;
delete _res;
delete _screen;
@ -153,11 +153,6 @@ void NeverhoodEngine::mainLoop() {
while (eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_KEYDOWN:
if (event.kbd.hasFlags(Common::KBD_CTRL) && event.kbd.keycode == Common::KEYCODE_d) {
// Open debugger console
_console->attach();
continue;
}
_gameModule->handleKeyDown(event.kbd.keycode);
_gameModule->handleAsciiKey(event.kbd.ascii);
break;
@ -190,7 +185,6 @@ void NeverhoodEngine::mainLoop() {
_gameModule->checkRequests();
_gameModule->handleUpdate();
_gameModule->draw();
_console->onFrame();
_screen->update();
if (_updateSound)
_soundMan->update();

View File

@ -89,8 +89,6 @@ public:
ResourceMan *_res;
GameModule *_gameModule;
StaticData *_staticData;
Console *_console;
GUI::Debugger *getDebugger() override { return _console; }
SoundMan *_soundMan;
AudioResourceMan *_audioResourceMan;