[Scummvm-git-logs] scummvm master -> 84e23ee647973d341bf79926486d68cd63769b10

AndywinXp noreply at scummvm.org
Thu Apr 6 10:03:26 UTC 2023


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:
84e23ee647 SCUMM: SAMNMAX: Fix cursor being invisible after load


Commit: 84e23ee647973d341bf79926486d68cd63769b10
    https://github.com/scummvm/scummvm/commit/84e23ee647973d341bf79926486d68cd63769b10
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-04-06T12:03:20+02:00

Commit Message:
SCUMM: SAMNMAX: Fix cursor being invisible after load

This happened when creating savestates within the original menu
and then loading them from the GMM

Changed paths:
    engines/scumm/scumm.cpp


diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index fa64e29a572..8abd56b159a 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -2797,6 +2797,12 @@ void ScummEngine::scummLoop_handleSaveLoad() {
 
 			if (success && (_saveTemporaryState || _game.version == 8) && VAR_GAME_LOADED != 0xFF)
 				VAR(VAR_GAME_LOADED) = (_game.version == 8) ? 1 : GAME_PROPER_LOAD;
+
+			// If we are here, it means that we are loading a game from the ScummVM menu;
+			// let's call the exit save/load script (only used in v6) to restore the cursor
+			// properly.
+			if (VAR_SAVELOAD_SCRIPT2 != 0xFF && _currentRoom != 0)
+				runScript(VAR(VAR_SAVELOAD_SCRIPT2), 0, 0, nullptr);
 		}
 
 		if (!success) {
@@ -3008,6 +3014,15 @@ void ScummEngine_v5::scummLoop_handleSaveLoad() {
 }
 
 void ScummEngine_v6::scummLoop_handleSaveLoad() {
+	// When launching a savegame from the launcher it may happen (if the game was
+	// saved within the original GUI) that the cursor can remain invisible until
+	// an event changes it. The original save dialog calls the exit save/load script
+	// to reinstate the cursor correctly, so we do that manually for this edge case.
+	if (_loadFromLauncher && VAR_SAVELOAD_SCRIPT2 != 0xFF && _currentRoom != 0) {
+		_loadFromLauncher = false;
+		runScript(VAR(VAR_SAVELOAD_SCRIPT2), 0, 0, nullptr);
+	}
+
 	ScummEngine::scummLoop_handleSaveLoad();
 
 	if (_videoModeChanged) {




More information about the Scummvm-git-logs mailing list