diff options
Diffstat (limited to 'engines/sword2/sword2.cpp')
-rw-r--r-- | engines/sword2/sword2.cpp | 54 |
1 files changed, 12 insertions, 42 deletions
diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index b3b688771a..1d56306f58 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -295,8 +295,6 @@ Sword2Engine::Sword2Engine(OSystem *syst) : Engine(syst) { _renderSkip = false; #endif - _gamePaused = false; - _gameCycle = 0; _gameSpeed = 1; @@ -516,10 +514,18 @@ Common::Error Sword2Engine::run() { } else if (ke->kbd.hasFlags(0) || ke->kbd.hasFlags(Common::KBD_SHIFT)) { switch (ke->kbd.keycode) { case Common::KEYCODE_p: - if (_gamePaused) + if (isPaused()) { + _screen->dimPalette(false); pauseEngine(false); - else + } else { pauseEngine(true); +#ifdef SWORD2_DEBUG + if (!_stepOneCycle) + _screen->dimPalette(true); +#else + _screen->dimPalette(true); +#endif + } break; #if 0 // Disabled because of strange rumors about the @@ -551,7 +557,7 @@ Common::Error Sword2Engine::run() { } // skip GameCycle if we're paused - if (!_gamePaused) { + if (!isPaused()) { _gameCycle++; gameCycle(); } @@ -798,49 +804,13 @@ void Sword2Engine::sleepUntil(uint32 time) { } } -void Sword2Engine::pauseEngine(bool pause) { - if (pause == _gamePaused) - return; - - // We don't need to hide the cursor for outside pausing. Not as long - // as it replaces the cursor with the GUI cursor, at least. - - _mouse->pauseEngine(pause); - pauseEngineIntern(pause); - - if (pause) { -#ifdef SWORD2_DEBUG - // Don't dim it if we're single-stepping through frames - // dim the palette during the pause - - if (!_stepOneCycle) - _screen->dimPalette(true); -#else - _screen->dimPalette(true); -#endif - } else { - _screen->dimPalette(false); - - // If mouse is about or we're in a chooser menu - if (!_mouse->getMouseStatus() || _mouse->isChoosing()) - _mouse->setMouse(NORMAL_MOUSE_ID); - } -} - void Sword2Engine::pauseEngineIntern(bool pause) { - if (pause == _gamePaused) - return; + Engine::pauseEngineIntern(pause); if (pause) { - _sound->pauseAllSound(); - _logic->pauseMovie(true); _screen->pauseScreen(true); - _gamePaused = true; } else { - _logic->pauseMovie(false); _screen->pauseScreen(false); - _sound->unpauseAllSound(); - _gamePaused = false; } } |