[Scummvm-git-logs] scummvm master -> d86ef1c35be4503afc0e12237f17bf9ec280611c

AndywinXp noreply at scummvm.org
Tue Jul 2 21:57:16 UTC 2024


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:
d86ef1c35b SCUMM: GUI: Fix GUI edges glitching during SMUSH movies


Commit: d86ef1c35be4503afc0e12237f17bf9ec280611c
    https://github.com/scummvm/scummvm/commit/d86ef1c35be4503afc0e12237f17bf9ec280611c
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-07-02T23:57:11+02:00

Commit Message:
SCUMM: GUI: Fix GUI edges glitching during SMUSH movies

Whenever _screenTop is non-zero the edges of GUI elements
will glitch during SMUSH movies. This happens on the originals
as well (the ending movies for DIG and COMI), but to a less extent.

Changed paths:
    engines/scumm/gfx_gui.cpp


diff --git a/engines/scumm/gfx_gui.cpp b/engines/scumm/gfx_gui.cpp
index 8bac9901ac3..0073a37f946 100644
--- a/engines/scumm/gfx_gui.cpp
+++ b/engines/scumm/gfx_gui.cpp
@@ -90,6 +90,14 @@ Common::KeyState ScummEngine::showBannerAndPause(int bannerId, int32 waitTime, c
 
 	_messageBannerActive = true;
 
+	int oldScreenTop = _screenTop;
+
+	// There are a few instances in a non-zero _screenTop is not being reset
+	// before starting a SMUSH movie (e.g. the very last video in The Dig);
+	// let's set it to zero now and restore it at the very end...
+	if (isSmushActive())
+		_screenTop = 0;
+
 	// Fetch the translated string for the message...
 	convertMessageToString((const byte *)msg, (byte *)localizedMsg, sizeof(localizedMsg));
 	ptrToBreak = strstr(localizedMsg, "\\n");
@@ -312,6 +320,9 @@ Common::KeyState ScummEngine::showBannerAndPause(int bannerId, int32 waitTime, c
 
 	_messageBannerActive = false;
 
+	if (isSmushActive())
+		_screenTop = oldScreenTop;
+
 	return ks;
 }
 
@@ -851,6 +862,10 @@ void ScummEngine_v7::queryQuit(bool returnToLauncher) {
 			_messageBannerActive = true;
 			_comiQuitMenuIsOpen = true;
 
+			int oldScreenTop = _screenTop;
+			if (isSmushActive())
+				_screenTop = 0;
+
 			// Force the cursor to be ON...
 			int8 oldCursorState = _cursor.state;
 			_cursor.state = 1;
@@ -1037,6 +1052,9 @@ void ScummEngine_v7::queryQuit(bool returnToLauncher) {
 
 			_comiQuitMenuIsOpen = false;
 			_messageBannerActive = false;
+
+			if (isSmushActive())
+				_screenTop = oldScreenTop;
 		} else {
 			ScummEngine::queryQuit(returnToLauncher);
 		}
@@ -2375,8 +2393,13 @@ void ScummEngine::showMainMenu() {
 		runScript(VAR(VAR_PRE_SAVELOAD_SCRIPT), 0, 0, nullptr);
 
 	int oldSaveSound = _saveSound;
+	int oldScreenTop = _screenTop;
 
 	_saveSound = 1;
+
+	if (isSmushActive())
+		_screenTop = 0;
+
 	_shakeTempSavedState = _shakeEnabled;
 	setShake(0);
 
@@ -2552,6 +2575,9 @@ void ScummEngine::showMainMenu() {
 
 	_saveSound = oldSaveSound;
 
+	if (isSmushActive())
+		_screenTop = oldScreenTop;
+
 	_mainMenuIsActive = false;
 
 	if (_game.version > 6)




More information about the Scummvm-git-logs mailing list