[Scummvm-git-logs] scummvm master -> 2798dc9eb8470560d5e8bdc106c0f30caf09e44c
neuromancer
neuromancer at users.noreply.github.com
Sat Oct 30 20:44:03 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:
2798dc9eb8 PRIVATE: some more palette fixes when the games is paused/unpaused
Commit: 2798dc9eb8470560d5e8bdc106c0f30caf09e44c
https://github.com/scummvm/scummvm/commit/2798dc9eb8470560d5e8bdc106c0f30caf09e44c
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2021-10-30T22:43:25+02:00
Commit Message:
PRIVATE: some more palette fixes when the games is paused/unpaused
Changed paths:
engines/private/private.cpp
engines/private/private.h
diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index 3166399482..8ceb10cfa2 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -208,7 +208,7 @@ Common::Error PrivateEngine::run() {
_transparentColor = 250;
_safeColor = _pixelFormat.RGBToColor(65, 65, 65);
- screenRect = Common::Rect(0, 0, _screenW, _screenH);
+ _screenRect = Common::Rect(0, 0, _screenW, _screenH);
changeCursor("default");
_origin = Common::Point(0, 0);
_image = new Image::BitmapDecoder();
@@ -617,6 +617,11 @@ void PrivateEngine::selectPauseGame(Common::Point mousePos) {
if (_videoDecoder) {
_videoDecoder->pauseVideo(true);
}
+ _compositeSurface->fillRect(_screenRect, 0);
+ _compositeSurface->setPalette(_framePalette, 0, 256);
+ _origin = Common::Point(kOriginZero[0], kOriginZero[1]);
+ drawMask(_frameImage);
+ _origin = Common::Point(kOriginOne[0], kOriginOne[1]);
}
}
}
@@ -1314,7 +1319,7 @@ Graphics::Surface *PrivateEngine::loadMask(const Common::String &name, int x, in
debugC(1, kPrivateDebugFunction, "%s(%s,%d,%d,%d)", __FUNCTION__, name.c_str(), x, y, drawn);
Graphics::Surface *surf = new Graphics::Surface();
surf->create(_screenW, _screenH, _pixelFormat);
- surf->fillRect(screenRect, _transparentColor);
+ surf->fillRect(_screenRect, _transparentColor);
Graphics::Surface *csurf = decodeImage(name);
uint32 hdiff = 0;
@@ -1360,12 +1365,12 @@ void PrivateEngine::drawScreen() {
}
}
- // No use of _compositeScreen, we write the frame directly to the screen in the expected position
+ // No use of _compositeSurface, we write the frame directly to the screen in the expected position
g_system->copyRectToScreen(frame->getPixels(), frame->pitch, center.x, center.y, frame->w, frame->h);
} else {
+ const byte *cPalette = (const byte *) _compositeSurface->getPalette();
for (int c = 0; c < 256; c++)
- g_system->getPaletteManager()->setPalette(((const byte *) _compositeSurface->getPalette()) + 4*c, c, 1);
-
+ g_system->getPaletteManager()->setPalette(cPalette + 4*c, c, 1);
byte newPalette[3 * 256];
g_system->getPaletteManager()->grabPalette((byte *) &newPalette, 0, 256);
diff --git a/engines/private/private.h b/engines/private/private.h
index 68c2da55ee..cce5422c41 100644
--- a/engines/private/private.h
+++ b/engines/private/private.h
@@ -217,7 +217,7 @@ public:
void fillRect(uint32, Common::Rect);
bool inMask(Graphics::Surface *, Common::Point);
uint32 _transparentColor;
- Common::Rect screenRect;
+ Common::Rect _screenRect;
Common::String _framePath;
Graphics::Surface *_frameImage;
Graphics::Surface *_mframeImage;
More information about the Scummvm-git-logs
mailing list