[Scummvm-git-logs] scummvm master -> 1e2e478b24413deca1699a240d635d6d659ac5f0

bluegr noreply at scummvm.org
Thu May 7 02:16:09 UTC 2026


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
f2351c793a NANCY: Fix issues with sounds and subtitles in quizpuzzle
1e2e478b24 DEVTOOLS: Fix an incorrect dialog check in Nancy 8 and regen nancy.dat


Commit: f2351c793a5a5265ede3ced6d05e8bcee05a87f7
    https://github.com/scummvm/scummvm/commit/f2351c793a5a5265ede3ced6d05e8bcee05a87f7
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-05-07T05:15:50+03:00

Commit Message:
NANCY: Fix issues with sounds and subtitles in quizpuzzle

- Add subtitles for success/fail sounds in quizpuzzle
- Fix subsequent sound playing in Nancy8

Fix #16724 and #16769

Changed paths:
    engines/nancy/action/puzzle/quizpuzzle.cpp
    engines/nancy/action/puzzle/quizpuzzle.h


diff --git a/engines/nancy/action/puzzle/quizpuzzle.cpp b/engines/nancy/action/puzzle/quizpuzzle.cpp
index 3ca412e4fe1..2970475944c 100644
--- a/engines/nancy/action/puzzle/quizpuzzle.cpp
+++ b/engines/nancy/action/puzzle/quizpuzzle.cpp
@@ -51,6 +51,30 @@ void QuizPuzzle::init() {
 	RenderObject::init();
 }
 
+Common::String QuizPuzzle::readSubtitle(Common::SeekableReadStream &stream) {
+	const CVTX *autotext = (const CVTX *)g_nancy->getEngineData("AUTOTEXT");
+	assert(autotext);
+
+	Common::String result;
+	char textBuf[30];
+
+	stream.read(textBuf, 30);
+	textBuf[29] = '\0';
+	result = textBuf;
+
+	if (!result.empty() && autotext->texts.contains(result))
+		result = autotext->texts[result];
+
+	return result;
+}
+
+void QuizPuzzle::showSubtitle(const Common::String &text) {
+	if (!text.empty()) {
+		NancySceneState.getTextbox().clear();
+		NancySceneState.getTextbox().addTextLine(text);
+	}
+}
+
 // ---- Nancy 8 data format ----
 // Offset  Size  Field
 // 0x000   2     fontID
@@ -85,15 +109,17 @@ void QuizPuzzle::readDataOld(Common::SeekableReadStream &stream) {
 		_answerFlags[i] = stream.readSint16LE();
 	}
 
+	char textBuf[30];
+
 	_correctSound.readNormal(stream);
-	stream.skip(30); // correct subtitle
+	_correctText = readSubtitle(stream);
 
 	_wrongSound.readNormal(stream);
-	stream.skip(30); // wrong subtitle
+	_wrongText = readSubtitle(stream);
 
 	_solveScene.readData(stream);
 	_doneSound.readNormal(stream);
-	stream.skip(30); // done subtitle
+	_doneText = readSubtitle(stream);
 
 	_cancelScene.readData(stream);
 }
@@ -125,6 +151,9 @@ void QuizPuzzle::readDataOld(Common::SeekableReadStream &stream) {
 // +0xB0  2   wrong sound volume
 // +0xB2  30  wrong subtitle (skip)
 void QuizPuzzle::readDataNew(Common::SeekableReadStream &stream) {
+	const CVTX *autotext = (const CVTX *)g_nancy->getEngineData("AUTOTEXT");
+	assert(autotext);
+
 	_fontID            = stream.readUint16LE();
 	_cursorBlinkInterval = stream.readUint16LE();
 	_cursorChar        = stream.readByte();
@@ -136,7 +165,7 @@ void QuizPuzzle::readDataNew(Common::SeekableReadStream &stream) {
 
 	_solveScene.readData(stream);
 	_doneSound.readNormal(stream);
-	stream.skip(30); // done subtitle
+	_doneText = readSubtitle(stream);
 
 	_cancelScene.readData(stream);
 	stream.skip(16); // unknown
@@ -169,13 +198,13 @@ void QuizPuzzle::readDataNew(Common::SeekableReadStream &stream) {
 		soundNameBuf[32] = '\0';
 		_boxCorrectSoundName[i] = soundNameBuf;
 		_boxCorrectSoundVolume[i] = stream.readUint16LE();
-		stream.skip(30); // correct subtitle
+		_boxCorrectText[i] = readSubtitle(stream);
 
 		stream.read(soundNameBuf, 33);
 		soundNameBuf[32] = '\0';
 		_boxWrongSoundName[i] = soundNameBuf;
 		_boxWrongSoundVolume[i] = stream.readUint16LE();
-		stream.skip(30); // wrong subtitle
+		_boxWrongText[i] = readSubtitle(stream);
 
 		// Precompute max answer length for auto-check mode
 		_boxMaxLen[i] = 0;
@@ -258,7 +287,9 @@ void QuizPuzzle::executeOld() {
 			_solved = checkAllSolved();
 			_internalState = _solved ? kStartDone : kTyping;
 		} else {
+			g_nancy->_sound->loadSound(_correctSound);
 			g_nancy->_sound->playSound(_correctSound);
+			showSubtitle(_correctText);
 			_internalState = kWaitCorrect;
 		}
 		_nextBlinkTime = 0;
@@ -283,7 +314,9 @@ void QuizPuzzle::executeOld() {
 		if (_wrongSound.name == "NO SOUND") {
 			_internalState = kTyping;
 		} else {
+			g_nancy->_sound->loadSound(_wrongSound);
 			g_nancy->_sound->playSound(_wrongSound);
+			showSubtitle(_wrongText);
 			_internalState = kWaitWrong;
 		}
 		break;
@@ -301,7 +334,9 @@ void QuizPuzzle::executeOld() {
 		if (_doneSound.name == "NO SOUND") {
 			_internalState = kFinish;
 		} else {
+			g_nancy->_sound->loadSound(_doneSound);
 			g_nancy->_sound->playSound(_doneSound);
+			showSubtitle(_doneText);
 			_internalState = kWaitDone;
 		}
 		break;
@@ -410,6 +445,7 @@ void QuizPuzzle::executeNew() {
 		} else {
 			g_nancy->_sound->loadSound(_activeBoxSound);
 			g_nancy->_sound->playSound(_activeBoxSound);
+			showSubtitle(_boxCorrectText[_currentBox]);
 			advanceToNextBox();
 			_internalState = kWaitCorrect;
 		}
@@ -443,6 +479,7 @@ void QuizPuzzle::executeNew() {
 		} else {
 			g_nancy->_sound->loadSound(_activeBoxSound);
 			g_nancy->_sound->playSound(_activeBoxSound);
+			showSubtitle(_boxWrongText[_currentBox]);
 			_internalState = kWaitWrong;
 		}
 		break;
@@ -460,7 +497,9 @@ void QuizPuzzle::executeNew() {
 		if (_doneSound.name == "NO SOUND") {
 			_internalState = kFinish;
 		} else {
+			g_nancy->_sound->loadSound(_doneSound);
 			g_nancy->_sound->playSound(_doneSound);
+			showSubtitle(_doneText);
 			_internalState = kWaitDone;
 		}
 		break;
diff --git a/engines/nancy/action/puzzle/quizpuzzle.h b/engines/nancy/action/puzzle/quizpuzzle.h
index 1277fa766ef..662157d492e 100644
--- a/engines/nancy/action/puzzle/quizpuzzle.h
+++ b/engines/nancy/action/puzzle/quizpuzzle.h
@@ -61,6 +61,9 @@ private:
 	bool checkAllSolved() const;
 	bool checkAnswerForCurrentBox(); // checks, marks correct, sets event flag
 
+	Common::String readSubtitle(Common::SeekableReadStream &stream);
+	void showSubtitle(const Common::String &text);
+
 	// ---- Data (Nancy 8) ----
 	uint16 _fontID = 0;
 	uint16 _cursorBlinkInterval = 500;
@@ -75,8 +78,12 @@ private:
 	int16 _answerFlags[kMaxBoxes] = { -1, -1, -1, -1, -1, -1, -1, -1 };
 
 	SoundDescription _correctSound;  // Nancy 8: global correct sound
+	Common::String _correctText;
 	SoundDescription _wrongSound;    // Nancy 8: global wrong sound
+	Common::String _wrongText;
+
 	SoundDescription _doneSound;     // done sound (both Nancy 8 and Nancy 9)
+	Common::String _doneText;
 
 	SceneChangeWithFlag _solveScene;   // scene to go to when all boxes are solved
 	SceneChangeWithFlag _cancelScene;  // scene to go to on cancel
@@ -93,8 +100,11 @@ private:
 	// Per-box sounds for Nancy 9 (name + volume; channel from global above)
 	Common::String _boxCorrectSoundName[kMaxBoxes];
 	uint16 _boxCorrectSoundVolume[kMaxBoxes] = {};
+	Common::String _boxCorrectText[kMaxBoxes];
+
 	Common::String _boxWrongSoundName[kMaxBoxes];
 	uint16 _boxWrongSoundVolume[kMaxBoxes] = {};
+	Common::String _boxWrongText[kMaxBoxes];
 
 	// Per-box max answer length (computed from answer strings, used in auto-check mode)
 	uint16 _boxMaxLen[kMaxBoxes] = {};


Commit: 1e2e478b24413deca1699a240d635d6d659ac5f0
    https://github.com/scummvm/scummvm/commit/1e2e478b24413deca1699a240d635d6d659ac5f0
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-05-07T05:15:52+03:00

Commit Message:
DEVTOOLS: Fix an incorrect dialog check in Nancy 8 and regen nancy.dat

Fix #16711

Changed paths:
    devtools/create_nancy/nancy8_data.h
    dists/engine-data/nancy.dat


diff --git a/devtools/create_nancy/nancy8_data.h b/devtools/create_nancy/nancy8_data.h
index 59c0c6d4d96..8c4ed19d974 100644
--- a/devtools/create_nancy/nancy8_data.h
+++ b/devtools/create_nancy/nancy8_data.h
@@ -331,9 +331,9 @@ const Common::Array<Common::Array<ConditionalDialogue>> _nancy8ConditionalDialog
 	{	0, 1951, "NAS51",
 		{ { kEv, 125, true }, { kEv, 127, false } } },
 	{	0, 1952, "NAS52",
-		{ { kEv, 245, false }, { kEv, 127, true }, { kEv, 124, true } } },
+		{ { kEv, 245, false }, { kEv, 127, true }, { kEv, 124, false } } },
 	{	0, 1952, "NAS52",
-		{ { kEv, 125, true }, { kEv, 127, true }, { kEv, 124, true } } },
+		{ { kEv, 125, true }, { kEv, 127, true }, { kEv, 124, false } } },
 	{	0, 1953, "NAS53",
 		{ { kEv, 245, false }, { kEv, 120, true }, { kEv, 123, false } } },
 	{	0, 1953, "NAS53",
diff --git a/dists/engine-data/nancy.dat b/dists/engine-data/nancy.dat
index 47b757558ef..c7a0d53098e 100644
Binary files a/dists/engine-data/nancy.dat and b/dists/engine-data/nancy.dat differ




More information about the Scummvm-git-logs mailing list