diff --git a/engines/asylum/asylum.cpp b/engines/asylum/asylum.cpp index fc906601ca1..81a76d23016 100644 --- a/engines/asylum/asylum.cpp +++ b/engines/asylum/asylum.cpp @@ -50,12 +50,13 @@ #include "asylum/views/menu.h" #include "asylum/views/video.h" +#include "asylum/console.h" #include "asylum/respack.h" namespace Asylum { AsylumEngine::AsylumEngine(OSystem *system, const ADGameDescription *gd) : Engine(system), _gameDescription(gd), - _console(nullptr), _cursor(nullptr), _encounter(nullptr), _menu(nullptr), _resource(nullptr), _savegame(nullptr), + _cursor(nullptr), _encounter(nullptr), _menu(nullptr), _resource(nullptr), _savegame(nullptr), _scene(nullptr), _screen(nullptr), _script(nullptr), _special(nullptr), _speech(nullptr), _sound(nullptr), _text(nullptr), _video(nullptr), _handler(nullptr), _puzzles(nullptr) { @@ -112,8 +113,7 @@ Common::Error AsylumEngine::run() { initGraphics(640, 480); // Create debugger. It requires GFX to be initialized - _console = new Console(this); - setDebugger(_console); + setDebugger(new Console(this)); // Create resource manager _resource = new ResourceManager(this); @@ -392,12 +392,9 @@ void AsylumEngine::playIntro() { } void AsylumEngine::handleEvents() { - if (!_console || !_video || !_screen || !_sound || !_menu || !_cursor) + if (!_video || !_screen || !_sound || !_menu || !_cursor) error("[AsylumEngine::handleEvents] Subsystems not initialized properly!"); - // Show the debugger if required - _console->onFrame(); - AsylumEvent ev; Common::Keymapper *const keymapper = _eventMan->getKeymapper(); @@ -414,11 +411,6 @@ void AsylumEngine::handleEvents() { break; case Common::EVENT_KEYDOWN: - if ((ev.kbd.flags & Common::KBD_CTRL) && ev.kbd.keycode == Common::KEYCODE_d) { - _console->attach(); - break; - } - // Handle key events if (_handler) _handler->handleEvent(ev); diff --git a/engines/asylum/asylum.h b/engines/asylum/asylum.h index b5a5678c12a..14aabbb74df 100644 --- a/engines/asylum/asylum.h +++ b/engines/asylum/asylum.h @@ -35,7 +35,7 @@ #include "asylum/resources/data.h" -#include "asylum/console.h" +#include "asylum/detection.h" #include "asylum/eventhandler.h" #include "asylum/shared.h" @@ -209,7 +209,6 @@ private: const ADGameDescription *_gameDescription; // Misc - Console *_console; Common::RandomSource *_rnd; // Game diff --git a/engines/asylum/console.h b/engines/asylum/console.h index b4d6ff11d95..2a6097450b5 100644 --- a/engines/asylum/console.h +++ b/engines/asylum/console.h @@ -31,23 +31,6 @@ namespace Asylum { -enum kDebugLevels { - kDebugLevelMain = 1 << 0, - kDebugLevelResources = 1 << 1, - kDebugLevelSprites = 1 << 2, - kDebugLevelInput = 1 << 3, - kDebugLevelMenu = 1 << 4, - kDebugLevelScripts = 1 << 5, - kDebugLevelSound = 1 << 6, - kDebugLevelSavegame = 1 << 7, - kDebugLevelScene = 1 << 8, - kDebugLevelObjects = 1 << 9, - kDebugLevelActor = 1 << 10, - kDebugLevelEncounter = 1 << 11, - kDebugLevelVideo = 1 << 12, - kDebugLevelCommands = 1 << 13 -}; - class AsylumEngine; struct ActionArea; diff --git a/engines/asylum/detection.cpp b/engines/asylum/detection.cpp index 73e22b0e0c9..5fb70461fc3 100644 --- a/engines/asylum/detection.cpp +++ b/engines/asylum/detection.cpp @@ -22,8 +22,8 @@ #include "engines/advancedDetector.h" #include "base/plugins.h" +#include "asylum/detection.h" #include "asylum/detection_tables.h" -#include "asylum/console.h" static const DebugChannelDef debugFlagList[] = { {Asylum::kDebugLevelMain, "Main", "Generic debug level"}, diff --git a/engines/asylum/detection.h b/engines/asylum/detection.h new file mode 100644 index 00000000000..add204c40b9 --- /dev/null +++ b/engines/asylum/detection.h @@ -0,0 +1,46 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#ifndef ASYLUM_DETECTION_H +#define ASYLUM_DETECTION_H + +namespace Asylum { + +enum kDebugLevels { + kDebugLevelMain = 1 << 0, + kDebugLevelResources = 1 << 1, + kDebugLevelSprites = 1 << 2, + kDebugLevelInput = 1 << 3, + kDebugLevelMenu = 1 << 4, + kDebugLevelScripts = 1 << 5, + kDebugLevelSound = 1 << 6, + kDebugLevelSavegame = 1 << 7, + kDebugLevelScene = 1 << 8, + kDebugLevelObjects = 1 << 9, + kDebugLevelActor = 1 << 10, + kDebugLevelEncounter = 1 << 11, + kDebugLevelVideo = 1 << 12, + kDebugLevelCommands = 1 << 13 +}; + +} // End of namespace Asylum + +#endif // ASYLUM_DETECTION_H diff --git a/engines/asylum/puzzles/puzzles.h b/engines/asylum/puzzles/puzzles.h index e360d988f88..07b6fab1cf4 100644 --- a/engines/asylum/puzzles/puzzles.h +++ b/engines/asylum/puzzles/puzzles.h @@ -24,11 +24,11 @@ #include "common/serializer.h" -#include "asylum/console.h" #include "asylum/shared.h" namespace Asylum { +class AsylumEngine; class EventHandler; class Puzzle; diff --git a/engines/asylum/resources/data.cpp b/engines/asylum/resources/data.cpp index 74736839d9c..9501a15d3ac 100644 --- a/engines/asylum/resources/data.cpp +++ b/engines/asylum/resources/data.cpp @@ -21,7 +21,7 @@ #include "common/textconsole.h" -#include "engines/asylum/console.h" +#include "engines/asylum/detection.h" #include "engines/asylum/resources/data.h"