[Scummvm-git-logs] scummvm master -> 3820a1c6b3bbe5a38d60a2e53b3357c59eb29dfb
sev-
noreply at scummvm.org
Wed Mar 25 15:00:18 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
3820a1c6b3 SLUDGE: Fix missing text and dynamic graphics during hardScroll
Commit: 3820a1c6b3bbe5a38d60a2e53b3357c59eb29dfb
https://github.com/scummvm/scummvm/commit/3820a1c6b3bbe5a38d60a2e53b3357c59eb29dfb
Author: Azzurra Suffia (azzurra.suffia at gmail.com)
Date: 2026-03-25T16:00:13+01:00
Commit Message:
SLUDGE: Fix missing text and dynamic graphics during hardScroll
Update hardScroll logic to correctly preserve dynamic background
elements.
- Move blankAllScreen() inside the boundary check. Previously, it
blanked the screen on every scroll, which incorrectly erased all
strings and graphics embedded to the backdrop via pasteString.
- Apply the visual shift using the current _backdropSurface rather
than _origBackdropSurface. Because _origBackdropSurface is only
updated during loadHSI, it acts as a static original and does not
contain evolving scene data.
Fix #16227
Changed paths:
engines/sludge/backdrop.cpp
diff --git a/engines/sludge/backdrop.cpp b/engines/sludge/backdrop.cpp
index 71864cf9c71..f58b157e613 100644
--- a/engines/sludge/backdrop.cpp
+++ b/engines/sludge/backdrop.cpp
@@ -289,26 +289,31 @@ void GraphicsManager::blankAllScreen() {
// This function is very useful for scrolling credits, but very little else
void GraphicsManager::hardScroll(int distance) {
- // scroll 0 distance, return
- if (!distance)
- return;
-
- // blank screen
- blankAllScreen();
-
// scroll more than backdrop height, screen stay blank
if (ABS(distance) >= (int)_sceneHeight) {
+ blankAllScreen();
return;
}
+ // scroll 0 distance, return
+ if (!distance)
+ return;
+
+ Graphics::Surface tmp;
+ tmp.copyFrom(_backdropSurface);
+
// copy part of the backdrop to it
if (distance > 0) {
- _backdropSurface.copyRectToSurface(_origBackdropSurface, 0, 0,
+ _backdropSurface.copyRectToSurface(tmp, 0, 0,
Common::Rect(0, distance, _backdropSurface.w, _backdropSurface.h));
+ _backdropSurface.fillRect(Common::Rect(0, _backdropSurface.h - distance, _backdropSurface.w, _backdropSurface.h), _currentBlankColour);
} else {
- _backdropSurface.copyRectToSurface(_origBackdropSurface, 0, -distance,
+ _backdropSurface.copyRectToSurface(tmp, 0, -distance,
Common::Rect(0, 0, _backdropSurface.w, _backdropSurface.h + distance));
+ _backdropSurface.fillRect(Common::Rect(0, 0, _backdropSurface.w, -distance), _currentBlankColour);
}
+
+ tmp.free();
}
void GraphicsManager::drawLine(uint x1, uint y1, uint x2, uint y2) {
More information about the Scummvm-git-logs
mailing list