PRIVATE: some palette fixes when the games is paused/unpaused
This commit is contained in:
parent
a14662a5ef
commit
b9f84d4410
3 changed files with 20 additions and 9 deletions
|
@ -513,12 +513,7 @@ static void fTransition(ArgArray args) {
|
||||||
static void fResume(ArgArray args) {
|
static void fResume(ArgArray args) {
|
||||||
assert(args[0].type == NUM);
|
assert(args[0].type == NUM);
|
||||||
debugC(1, kPrivateDebugScript, "Resume(%d)", args[0].u.val); // this value is always 1
|
debugC(1, kPrivateDebugScript, "Resume(%d)", args[0].u.val); // this value is always 1
|
||||||
g_private->_nextSetting = g_private->_pausedSetting;
|
g_private->resumeGame();
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fMovie(ArgArray args) {
|
static void fMovie(ArgArray args) {
|
||||||
|
|
|
@ -264,7 +264,7 @@ Common::Error PrivateEngine::run() {
|
||||||
else if (selectSafeDigit(mousePos))
|
else if (selectSafeDigit(mousePos))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
selectPauseMovie(mousePos);
|
selectPauseGame(mousePos);
|
||||||
selectPhoneArea(mousePos);
|
selectPhoneArea(mousePos);
|
||||||
selectPoliceRadioArea(mousePos);
|
selectPoliceRadioArea(mousePos);
|
||||||
selectAMRadioArea(mousePos);
|
selectAMRadioArea(mousePos);
|
||||||
|
@ -601,11 +601,12 @@ Common::String PrivateEngine::getInventoryCursor() {
|
||||||
return "k7";
|
return "k7";
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrivateEngine::selectPauseMovie(Common::Point mousePos) {
|
void PrivateEngine::selectPauseGame(Common::Point mousePos) {
|
||||||
if (_mode == 1 && !_policeBustEnabled) {
|
if (_mode == 1 && !_policeBustEnabled) {
|
||||||
uint32 tol = 15;
|
uint32 tol = 15;
|
||||||
Common::Rect window(_origin.x - tol, _origin.y - tol, _screenW - _origin.x + tol, _screenH - _origin.y + tol);
|
Common::Rect window(_origin.x - tol, _origin.y - tol, _screenW - _origin.x + tol, _screenH - _origin.y + tol);
|
||||||
if (!window.contains(mousePos)) {
|
if (!window.contains(mousePos)) {
|
||||||
|
// Pause game and return to desktop
|
||||||
if (_pausedSetting.empty()) {
|
if (_pausedSetting.empty()) {
|
||||||
if (!_nextSetting.empty())
|
if (!_nextSetting.empty())
|
||||||
_pausedSetting = _nextSetting;
|
_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) {
|
void PrivateEngine::selectExit(Common::Point mousePos) {
|
||||||
mousePos = mousePos - _origin;
|
mousePos = mousePos - _origin;
|
||||||
if (mousePos.x < 0 || mousePos.y < 0)
|
if (mousePos.x < 0 || mousePos.y < 0)
|
||||||
|
|
|
@ -168,11 +168,12 @@ public:
|
||||||
void initFuncs();
|
void initFuncs();
|
||||||
|
|
||||||
// User input
|
// User input
|
||||||
void selectPauseMovie(Common::Point);
|
void selectPauseGame(Common::Point);
|
||||||
void selectMask(Common::Point);
|
void selectMask(Common::Point);
|
||||||
void selectExit(Common::Point);
|
void selectExit(Common::Point);
|
||||||
void selectLoadGame(Common::Point);
|
void selectLoadGame(Common::Point);
|
||||||
void selectSaveGame(Common::Point);
|
void selectSaveGame(Common::Point);
|
||||||
|
void resumeGame();
|
||||||
|
|
||||||
// Cursors
|
// Cursors
|
||||||
bool cursorPauseMovie(Common::Point);
|
bool cursorPauseMovie(Common::Point);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue