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

bluegr noreply at scummvm.org
Tue May 12 09:45:27 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:
d73fb532dd NANCY: Only register pieces in onebuild/multibuild puzzles after init


Commit: d73fb532dd6a49632fd3c219b76298364ed7d22f
    https://github.com/scummvm/scummvm/commit/d73fb532dd6a49632fd3c219b76298364ed7d22f
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-05-12T12:45:01+03:00

Commit Message:
NANCY: Only register pieces in onebuild/multibuild puzzles after init

This ensures that the pieces won't be drawn before they're initialized,
e.g. during loading, where registerGraphics() is called from onPause(),
inside RenderActionRecord, before the pieces have been initialized

Fix #16788

Changed paths:
    engines/nancy/action/puzzle/multibuildpuzzle.cpp
    engines/nancy/action/puzzle/multibuildpuzzle.h
    engines/nancy/action/puzzle/onebuildpuzzle.cpp
    engines/nancy/action/puzzle/onebuildpuzzle.h


diff --git a/engines/nancy/action/puzzle/multibuildpuzzle.cpp b/engines/nancy/action/puzzle/multibuildpuzzle.cpp
index 9bba84fd8e0..df0163b85f9 100644
--- a/engines/nancy/action/puzzle/multibuildpuzzle.cpp
+++ b/engines/nancy/action/puzzle/multibuildpuzzle.cpp
@@ -91,9 +91,14 @@ void MultiBuildPuzzle::init() {
 			slot.setZ(_z);  // Below all active pieces (_z+1 and up)
 		}
 	}
+
+	_isInitialized = true;
 }
 
 void MultiBuildPuzzle::registerGraphics() {
+	if (!_isInitialized)
+		return;
+
 	if (_hasCloseupImage) {
 		for (uint i = 0; i < _shelfSlots.size(); ++i)
 			_shelfSlots[i].registerGraphics();
diff --git a/engines/nancy/action/puzzle/multibuildpuzzle.h b/engines/nancy/action/puzzle/multibuildpuzzle.h
index 918c0e6c5d5..93b1f3534de 100644
--- a/engines/nancy/action/puzzle/multibuildpuzzle.h
+++ b/engines/nancy/action/puzzle/multibuildpuzzle.h
@@ -132,6 +132,10 @@ protected:
 	int16 _pickedUpWidth = 0;
 	int16 _pickedUpHeight = 0;
 
+	// Initialization flag, used to ensure that the puzzle pieces have been initialized
+	// before drawing them on screen
+	bool _isInitialized = false;
+
 	// --- Internal methods ---
 
 	void checkIfSolved();	// FUN_0046da47
diff --git a/engines/nancy/action/puzzle/onebuildpuzzle.cpp b/engines/nancy/action/puzzle/onebuildpuzzle.cpp
index 63517c8b928..161f4109a8b 100644
--- a/engines/nancy/action/puzzle/onebuildpuzzle.cpp
+++ b/engines/nancy/action/puzzle/onebuildpuzzle.cpp
@@ -78,9 +78,14 @@ void OneBuildPuzzle::init() {
 		p.setTransparent(true);
 		p.setZ(_z + (uint16)i + 1);
 	}
+
+	_isInitialized = true;
 }
 
 void OneBuildPuzzle::registerGraphics() {
+	if (!_isInitialized)
+		return;
+
 	for (uint i = 0; i < _pieces.size(); ++i)
 		_pieces[i].registerGraphics();
 }
diff --git a/engines/nancy/action/puzzle/onebuildpuzzle.h b/engines/nancy/action/puzzle/onebuildpuzzle.h
index c4b1f2d5e97..5e7db6f8c0b 100644
--- a/engines/nancy/action/puzzle/onebuildpuzzle.h
+++ b/engines/nancy/action/puzzle/onebuildpuzzle.h
@@ -140,6 +140,10 @@ protected:
 	// Currently playing sound (scratch copy updated each time a sound is played)
 	SoundDescription _currentSound;
 
+	// Initialization flag, used to ensure that the puzzle pieces have been initialized
+	// before drawing them on screen
+	bool _isInitialized = false;
+
 	// --- Internal methods ---
 
 	void playPickupSound();	// FUN_0047239c




More information about the Scummvm-git-logs mailing list