diff --git a/engines/private/funcs.cpp b/engines/private/funcs.cpp index 54b0464627f..2e67f201ede 100644 --- a/engines/private/funcs.cpp +++ b/engines/private/funcs.cpp @@ -513,12 +513,7 @@ static void fTransition(ArgArray args) { static void fResume(ArgArray args) { assert(args[0].type == NUM); debugC(1, kPrivateDebugScript, "Resume(%d)", args[0].u.val); // this value is always 1 - g_private->_nextSetting = g_private->_pausedSetting; - g_private->_pausedSetting = ""; - g_private->_mode = 1; - g_private->_origin = Common::Point(kOriginOne[0], kOriginOne[1]); - if (g_private->_videoDecoder) - g_private->_videoDecoder->pauseVideo(false); + g_private->resumeGame(); } static void fMovie(ArgArray args) { diff --git a/engines/private/private.cpp b/engines/private/private.cpp index ab31895c528..3166399482c 100644 --- a/engines/private/private.cpp +++ b/engines/private/private.cpp @@ -264,7 +264,7 @@ Common::Error PrivateEngine::run() { else if (selectSafeDigit(mousePos)) break; - selectPauseMovie(mousePos); + selectPauseGame(mousePos); selectPhoneArea(mousePos); selectPoliceRadioArea(mousePos); selectAMRadioArea(mousePos); @@ -601,11 +601,12 @@ Common::String PrivateEngine::getInventoryCursor() { return "k7"; } -void PrivateEngine::selectPauseMovie(Common::Point mousePos) { +void PrivateEngine::selectPauseGame(Common::Point mousePos) { if (_mode == 1 && !_policeBustEnabled) { uint32 tol = 15; Common::Rect window(_origin.x - tol, _origin.y - tol, _screenW - _origin.x + tol, _screenH - _origin.y + tol); if (!window.contains(mousePos)) { + // Pause game and return to desktop if (_pausedSetting.empty()) { if (!_nextSetting.empty()) _pausedSetting = _nextSetting; @@ -621,6 +622,20 @@ void PrivateEngine::selectPauseMovie(Common::Point mousePos) { } } +void PrivateEngine::resumeGame() { + _nextSetting = _pausedSetting; + _pausedSetting = ""; + _mode = 1; + _origin = Common::Point(kOriginOne[0], kOriginOne[1]); + if (_videoDecoder) { + _videoDecoder->pauseVideo(false); + const byte *videoPalette = g_private->_videoDecoder->getPalette(); + g_system->getPaletteManager()->setPalette(videoPalette, 0, 256); + drawScreenFrame(videoPalette); + } +} + + void PrivateEngine::selectExit(Common::Point mousePos) { mousePos = mousePos - _origin; if (mousePos.x < 0 || mousePos.y < 0) diff --git a/engines/private/private.h b/engines/private/private.h index 6de65bb5859..68c2da55ee1 100644 --- a/engines/private/private.h +++ b/engines/private/private.h @@ -168,11 +168,12 @@ public: void initFuncs(); // User input - void selectPauseMovie(Common::Point); + void selectPauseGame(Common::Point); void selectMask(Common::Point); void selectExit(Common::Point); void selectLoadGame(Common::Point); void selectSaveGame(Common::Point); + void resumeGame(); // Cursors bool cursorPauseMovie(Common::Point);