[Scummvm-git-logs] scummvm master -> c411bbb758beaf029828f55eac66a5a6d5d4b827
bluegr
noreply at scummvm.org
Wed Dec 29 20:53:01 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c411bbb758 BURIED: Clean up game pausing functions and use pauseEngine()
Commit: c411bbb758beaf029828f55eac66a5a6d5d4b827
https://github.com/scummvm/scummvm/commit/c411bbb758beaf029828f55eac66a5a6d5d4b827
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2021-12-29T22:52:46+02:00
Commit Message:
BURIED: Clean up game pausing functions and use pauseEngine()
Changed paths:
engines/buried/biochip_right.cpp
engines/buried/biochip_view.cpp
engines/buried/buried.cpp
diff --git a/engines/buried/biochip_right.cpp b/engines/buried/biochip_right.cpp
index 4057bd608fe..b32d4db7ac7 100644
--- a/engines/buried/biochip_right.cpp
+++ b/engines/buried/biochip_right.cpp
@@ -82,9 +82,6 @@ bool BioChipRightWindow::showBioChipMainView() {
if (_bioChipViewWindow)
return false;
- if (_curBioChip == kItemBioChipInterface)
- _vm->pauseEngineIntern(true);
-
((GameUIWindow *)_parent)->_sceneViewWindow->bioChipWindowDisplayed(true);
_vm->_sound->timerCallback();
@@ -103,9 +100,6 @@ bool BioChipRightWindow::destroyBioChipViewWindow() {
if (!_bioChipViewWindow)
return false;
- if (_curBioChip == kItemBioChipInterface)
- _vm->pauseEngineIntern(false);
-
_vm->_sound->timerCallback();
delete _bioChipViewWindow;
_bioChipViewWindow = nullptr;
diff --git a/engines/buried/biochip_view.cpp b/engines/buried/biochip_view.cpp
index 40fd303e9f1..7ce0eb154e4 100644
--- a/engines/buried/biochip_view.cpp
+++ b/engines/buried/biochip_view.cpp
@@ -517,9 +517,11 @@ private:
Graphics::Surface *_background;
Graphics::Surface *_cycleCheck;
Graphics::Surface *_caret;
+ PauseToken _pauseToken;
};
InterfaceBioChipViewWindow::InterfaceBioChipViewWindow(BuriedEngine *vm, Window *parent) : Window(vm, parent) {
+ _pauseToken = _vm->pauseEngine();
_save = Common::Rect(192, 37, 300, 74);
_pause = Common::Rect(192, 84, 300, 121);
_restore = Common::Rect(313, 37, 421, 74);
diff --git a/engines/buried/buried.cpp b/engines/buried/buried.cpp
index 069e1a9baa0..675b5cd5271 100644
--- a/engines/buried/buried.cpp
+++ b/engines/buried/buried.cpp
@@ -586,13 +586,9 @@ void BuriedEngine::pauseGame() {
if (isDemo())
return;
- pauseEngineIntern(true);
-
// TODO: Would be nice to load the translated text from IDS_APP_MESSAGE_PAUSED_TEXT (9023)
GUI::MessageDialog dialog(_("Your game is now Paused. Click OK to continue."));
- dialog.runModal();
-
- pauseEngineIntern(false);
+ runDialog(dialog);
}
void BuriedEngine::handleSaveDialog() {
@@ -602,12 +598,9 @@ void BuriedEngine::handleSaveDialog() {
if (isDemo())
return;
- pauseEngineIntern(true);
-
+ PauseToken pt = pauseEngine();
runSaveDialog();
bioChipWindow->destroyBioChipViewWindow();
-
- pauseEngineIntern(false);
}
void BuriedEngine::handleRestoreDialog() {
@@ -617,13 +610,10 @@ void BuriedEngine::handleRestoreDialog() {
if (isDemo())
return;
- pauseEngineIntern(true);
-
+ PauseToken pt = pauseEngine();
Common::Error result = runLoadDialog();
bioChipWindow->destroyBioChipViewWindow();
- pauseEngineIntern(false);
-
if (result.getCode() == Common::kUnknownError) {
// Try to get us back to the main menu at this point
frameWindow->showMainMenu();
More information about the Scummvm-git-logs
mailing list