[Scummvm-git-logs] scummvm master -> 8f1d5a0c4c9a80bc318f1b04ac6dcdb3389ec26e

sev- noreply at scummvm.org
Fri Jan 13 22:56:13 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:
8f1d5a0c4c SLUDGE: Fix camera getting reset after loading saved game


Commit: 8f1d5a0c4c9a80bc318f1b04ac6dcdb3389ec26e
    https://github.com/scummvm/scummvm/commit/8f1d5a0c4c9a80bc318f1b04ac6dcdb3389ec26e
Author: Sebastian Krzyszkowiak (dos at dosowisko.net)
Date: 2023-01-13T23:56:09+01:00

Commit Message:
SLUDGE: Fix camera getting reset after loading saved game

loadHSI calls reserveBackdrop, which resets camera values.
Apply camera position and zoom in loadBackdrop after calling
loadHSI, so the stored camera state gets preserved.

Changed paths:
    engines/sludge/backdrop.cpp


diff --git a/engines/sludge/backdrop.cpp b/engines/sludge/backdrop.cpp
index 78fa14e6a5a..0479bc6f0c4 100644
--- a/engines/sludge/backdrop.cpp
+++ b/engines/sludge/backdrop.cpp
@@ -477,17 +477,22 @@ void GraphicsManager::saveBackdrop(Common::WriteStream *stream) {
 }
 
 void GraphicsManager::loadBackdrop(int ssgVersion, Common::SeekableReadStream *stream) {
-	_cameraX = stream->readUint16BE();
-	_cameraY = stream->readUint16BE();
+	int cameraX = stream->readUint16BE();
+	int cameraY = stream->readUint16BE();
+	float cameraZoom;
 	if (ssgVersion >= VERSION(2, 0)) {
-		_cameraZoom = stream->readFloatLE();
+		cameraZoom = stream->readFloatLE();
 	} else {
-		_cameraZoom = 1.0;
+		cameraZoom = 1.0;
 	}
 
 	_brightnessLevel = stream->readByte();
 
 	loadHSI(-1, stream, 0, 0, true);
+
+	_cameraX = cameraX;
+	_cameraY = cameraY;
+	_cameraZoom = cameraZoom;
 }
 
 bool GraphicsManager::getRGBIntoStack(uint x, uint y, StackHandler *sH) {




More information about the Scummvm-git-logs mailing list