[Scummvm-git-logs] scummvm master -> b9f84d4410ed90f87a94404df8b9f1c9fe9b69c3
neuromancer
neuromancer at users.noreply.github.com
Sat Oct 30 16:10:56 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:
b9f84d4410 PRIVATE: some palette fixes when the games is paused/unpaused
Commit: b9f84d4410ed90f87a94404df8b9f1c9fe9b69c3
https://github.com/scummvm/scummvm/commit/b9f84d4410ed90f87a94404df8b9f1c9fe9b69c3
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2021-10-30T18:10:22+02:00
Commit Message:
PRIVATE: some palette fixes when the games is paused/unpaused
Changed paths:
engines/private/funcs.cpp
engines/private/private.cpp
engines/private/private.h
diff --git a/engines/private/funcs.cpp b/engines/private/funcs.cpp
index 54b0464627..2e67f201ed 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 ab31895c52..3166399482 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 6de65bb585..68c2da55ee 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);
More information about the Scummvm-git-logs
mailing list