diff options
Diffstat (limited to 'engines/mortevielle/mortevielle.cpp')
-rw-r--r-- | engines/mortevielle/mortevielle.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp index 2b95bcea0e..3875d8d458 100644 --- a/engines/mortevielle/mortevielle.cpp +++ b/engines/mortevielle/mortevielle.cpp @@ -74,6 +74,7 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g Engine(system), _gameDescription(gameDesc), _randomSource("mortevielle"), _soundManager(_mixer) { g_vm = this; + _debugger.setParent(this); _lastGameFrame = 0; _mouseClick = false; _inMainGameLoop = false; @@ -345,6 +346,8 @@ bool MortevielleEngine::keyPressed() { _lastGameFrame = g_system->getMillis(); _screenSurface.updateScreen(); + + _debugger.onFrame(); } // Delay briefly to keep CPU usage down @@ -409,8 +412,13 @@ void MortevielleEngine::addKeypress(Common::Event &evt) { // Character to add char ch = evt.kbd.ascii; - // Handle alphabetic keys - if ((evt.kbd.keycode >= Common::KEYCODE_a) && (evt.kbd.keycode <= Common::KEYCODE_z)) { + // Check for debugger + if ((evt.kbd.keycode == Common::KEYCODE_d) && (evt.kbd.flags & Common::KBD_CTRL)) { + // Attach to the debugger + _debugger.attach(); + _debugger.onFrame(); + } else if ((evt.kbd.keycode >= Common::KEYCODE_a) && (evt.kbd.keycode <= Common::KEYCODE_z)) { + // Handle alphabetic keys if (evt.kbd.hasFlags(Common::KBD_CTRL)) ch = evt.kbd.keycode - Common::KEYCODE_a + 1; else @@ -523,6 +531,8 @@ void MortevielleEngine::delay(int amount) { if (g_system->getMillis() > (_lastGameFrame + GAME_FRAME_DELAY)) { _lastGameFrame = g_system->getMillis(); _screenSurface.updateScreen(); + + _debugger.onFrame(); } g_system->delayMillis(10); @@ -647,7 +657,7 @@ void MortevielleEngine::handleAction() { _inMainGameLoop = true; do { - _menu.mdn(); + _menu.updateMenu(); prepareRoom(); _mouse.moveMouse(funct, inkey); CHECK_QUIT; @@ -982,7 +992,7 @@ int MortevielleEngine::getPresenceStatsGreenRoom() { else if ((hour >= 0) && (hour < 8)) retVal = 70; - _menu.mdn(); + _menu.updateMenu(); return retVal; } @@ -2258,11 +2268,8 @@ Common::String MortevielleEngine::getString(int num) { } void MortevielleEngine::copcha() { - int i = kAcha; - do { + for (int i = kAcha; i < kAcha + 390; i++) _tabdon[i] = _tabdon[i + 390]; - ++i; - } while (i != kAcha + 390); } /** |