[Scummvm-git-logs] scummvm master -> f6bac7b6c61964811b2ebe98cf39191094ed6045
digitall
547637+digitall at users.noreply.github.com
Tue Jun 1 21:22:51 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:
f6bac7b6c6 AGOS: Fix restoreBlock() regression
Commit: f6bac7b6c61964811b2ebe98cf39191094ed6045
https://github.com/scummvm/scummvm/commit/f6bac7b6c61964811b2ebe98cf39191094ed6045
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2021-06-01T22:22:47+01:00
Commit Message:
AGOS: Fix restoreBlock() regression
The whole restoreBlock() function looked strange. It said it took x, y,
w and h, but it seems pretty clear that what it expects is left, top,
right and bottom.
Except in one case, where the order of the parameters had been swapped.
The most visible result of all this was that The Feeble Files crashed
when you pressed the "Off" button in the Oracle interface.
I've changed the names of the parameters, and that one strange call, and
changed how the function calculates the dirty rect. Hopefully that
should be correct.
Changed paths:
engines/agos/agos.h
engines/agos/window.cpp
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index e70b65762e..8dd5d93360 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -1212,7 +1212,7 @@ protected:
void colorBlock(WindowBlock *window, uint16 x, uint16 y, uint16 w, uint16 h);
void restoreWindow(WindowBlock *window);
- void restoreBlock(uint16 x, uint16 y, uint16 w, uint16 h);
+ void restoreBlock(uint16 left, uint16 top, uint16 right, uint16 bottom);
byte *getBackBuf();
byte *getBackGround();
diff --git a/engines/agos/window.cpp b/engines/agos/window.cpp
index 91a5ef99f8..db519e4495 100644
--- a/engines/agos/window.cpp
+++ b/engines/agos/window.cpp
@@ -201,7 +201,7 @@ void AGOSEngine::restoreWindow(WindowBlock *window) {
_videoLockOut |= 0x8000;
if (getGameType() == GType_FF || getGameType() == GType_PP) {
- restoreBlock(window->y + window->height, window->x + window->width, window->y, window->x);
+ restoreBlock(window->x, window->y, window->x + window->width, window->y + window->height);
} else if (getGameType() == GType_SIMON2) {
if (_restoreWindow6 && _windowArray[2] == window) {
window = _windowArray[6];
@@ -232,7 +232,7 @@ void AGOSEngine::restoreWindow(WindowBlock *window) {
_videoLockOut &= ~0x8000;
}
-void AGOSEngine::restoreBlock(uint16 x, uint16 y, uint16 w, uint16 h) {
+void AGOSEngine::restoreBlock(uint16 left, uint16 top, uint16 right, uint16 bottom) {
byte *dst, *src;
uint i;
@@ -240,18 +240,18 @@ void AGOSEngine::restoreBlock(uint16 x, uint16 y, uint16 w, uint16 h) {
dst = (byte *)screen->getPixels();
src = getBackGround();
- dst += y * screen->pitch;
- src += y * _backGroundBuf->pitch;
+ dst += top * screen->pitch;
+ src += top * _backGroundBuf->pitch;
uint8 paletteMod = 0;
- Common::Rect dirtyRect(x, y, x + w, h);
- if (getGameType() == GType_ELVIRA1 && !(getFeatures() & GF_DEMO) && y >= 133)
+ Common::Rect dirtyRect(left, top, right, bottom);
+ if (getGameType() == GType_ELVIRA1 && !(getFeatures() & GF_DEMO) && top >= 133)
paletteMod = 16;
- while (y < h) {
- for (i = x; i < w; i++)
+ while (top < bottom) {
+ for (i = left; i < right; i++)
dst[i] = src[i] + paletteMod;
- y++;
+ top++;
dst += screen->pitch;
src += _backGroundBuf->pitch;
}
More information about the Scummvm-git-logs
mailing list