[Scummvm-git-logs] scummvm master -> 7c9a13793b6289cf170e00dbe42915048d15467b

bluegr noreply at scummvm.org
Sat Dec 5 15:57:24 UTC 2026


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

Summary:
990af78c3d NANCY: NANCY19: Pick the responses of a conversation after its RunOnce
922be8bf62 NANCY: NANCY19: Let the scripts change the frames of an animation
1794d0e383 NANCY: NANCY19: Show the same response of a conversation only once
7c9a13793b NANCY: NANCY20: Let the scripts read the frames of an animation


Commit: 990af78c3db4e7b3ee9c368b3c50df6b29b0e450
    https://github.com/scummvm/scummvm/commit/990af78c3db4e7b3ee9c368b3c50df6b29b0e450
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-05T17:56:52+02:00

Commit Message:
NANCY: NANCY19: Pick the responses of a conversation after its RunOnce

The responses a conversation offers are picked once its RunOnce
function has run, as that can set the flags they depend on. Before,
a question that had just been asked could be asked again, like the
ones about Kit's picture in Nancy19 scene 1136.

Changed paths:
    engines/nancy/script/convo.cpp
    engines/nancy/script/convo.h


diff --git a/engines/nancy/script/convo.cpp b/engines/nancy/script/convo.cpp
index d2d8ba05002..367f83842d0 100644
--- a/engines/nancy/script/convo.cpp
+++ b/engines/nancy/script/convo.cpp
@@ -231,7 +231,9 @@ bool ConvoRecord::isResponseOnOffer(const ConvoResponse &response) {
 	return isOnOffer;
 }
 
-void ConvoRecord::runOnce() {
+// Done the first time the record runs, after its RunOnce function, which can
+// set the flags that decide the responses: Nancy19 scene 1136
+void ConvoRecord::begin() {
 	lua_State *L = getLua();
 	SceneContext &context = getContext();
 
@@ -307,6 +309,11 @@ void ConvoRecord::onEngineAction(const UI::NDUI::Action &action) {
 }
 
 void ConvoRecord::run(double sceneTime, double elapsedTime) {
+	if (!_hasBegun) {
+		_hasBegun = true;
+		begin();
+	}
+
 	if (isDone()) {
 		// There was a conversation in the scene already
 		return;
diff --git a/engines/nancy/script/convo.h b/engines/nancy/script/convo.h
index eb9c69b502a..fa021e9be6f 100644
--- a/engines/nancy/script/convo.h
+++ b/engines/nancy/script/convo.h
@@ -75,7 +75,6 @@ public:
 
 protected:
 	void readTable(int tableIndex) override;
-	void runOnce() override;
 	void run(double sceneTime, double elapsedTime) override;
 	void onZChanged() override;
 
@@ -90,6 +89,7 @@ private:
 		kPlayResponse
 	};
 
+	void begin();
 	bool isVideoDone() const;
 
 	void playSound(const Common::String &name, uint16 channel);
@@ -104,6 +104,7 @@ private:
 
 	XSheet _xsheet;
 
+	bool _hasBegun = false;
 	State _state = kStartLine;
 	uint _curSound = 0;
 	SoundDescription _sound;


Commit: 922be8bf62506b5563c28b75f962b16558638de5
    https://github.com/scummvm/scummvm/commit/922be8bf62506b5563c28b75f962b16558638de5
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-05T17:56:55+02:00

Commit Message:
NANCY: NANCY19: Let the scripts change the frames of an animation

The scripts can give an animation other frames while it plays. The
sheep of the pasture in Nancy19 scene 3199 take the frames of the
direction they walk in that way. Before, they kept facing upwards,
whichever way they went. The same goes for the rats of Dossier1's
scenes 1300 and 1400, which turn around as they run.

Changed paths:
    engines/nancy/script/records.cpp
    engines/nancy/script/records.h


diff --git a/engines/nancy/script/records.cpp b/engines/nancy/script/records.cpp
index 5b20c06e611..a3ed4c6ba60 100644
--- a/engines/nancy/script/records.cpp
+++ b/engines/nancy/script/records.cpp
@@ -2259,24 +2259,9 @@ void AnimOverlayRecord::readTable(int tableIndex) {
 		luaL_error(L, "AnimOverlays must have a sources field");
 	}
 
-	luaL_checktype(L, -1, LUA_TTABLE);
-	for (int i = 1; ; ++i) {
-		lua_rawgeti(L, -1, i);
-		if (lua_isnil(L, -1)) {
-			lua_pop(L, 1);
-			break;
-		}
-
-		_sources.push_back(checkRect(L, -1));
-		lua_pop(L, 1);
-	}
-
+	readSources(-1);
 	lua_pop(L, 1);
 
-	if (_sources.empty()) {
-		luaL_error(L, "Field sources must be a table with Rects in it");
-	}
-
 	Common::String imageName;
 	if (!readField(L, tableIndex, "ovl", imageName)) {
 		luaL_error(L, "AnimOverlays must have a ovl field");
@@ -2297,6 +2282,29 @@ void AnimOverlayRecord::readTable(int tableIndex) {
 	_graphic.registerGraphics();
 }
 
+void AnimOverlayRecord::readSources(int index) {
+	lua_State *L = getLua();
+
+	luaL_checktype(L, index, LUA_TTABLE);
+	index = absoluteIndex(L, index);
+
+	_sources.clear();
+	for (int i = 1; ; ++i) {
+		lua_rawgeti(L, index, i);
+		if (lua_isnil(L, -1)) {
+			lua_pop(L, 1);
+			break;
+		}
+
+		_sources.push_back(checkRect(L, -1));
+		lua_pop(L, 1);
+	}
+
+	if (_sources.empty()) {
+		luaL_error(L, "Field sources must be a table with Rects in it");
+	}
+}
+
 void AnimOverlayRecord::setFrame(int frame) {
 	_frame = CLIP<int>(frame, 1, _sources.size());
 	applyFrame();
@@ -2478,6 +2486,21 @@ bool AnimOverlayRecord::setField(const Common::String &key) {
 			_modColor = modColor;
 			applyFrame();
 		}
+	} else if (key == "sources") {
+		// Other frames, which go on from where the old ones were: the sheep of
+		// Nancy19 scene 3199 turn by taking the frames of their new direction
+		readSources(3);
+		const int numSources = _sources.size();
+		if (_firstFrame > 0) {
+			_firstFrame = MIN(_firstFrame, numSources);
+		}
+
+		if (_lastFrame > 0) {
+			_lastFrame = CLIP(_lastFrame, getFirstFrame(), numSources);
+		}
+
+		setFrame(CLIP(_frame, getFirstFrame(), getLastFrame()));
+		updateProgress();
 	} else if (key == "pauseOnLastFrame") {
 		_pausesOnLastFrame = lua_toboolean(L, 3) != 0;
 	} else if (key == "visible") {
diff --git a/engines/nancy/script/records.h b/engines/nancy/script/records.h
index e07a37ce5c1..1c61d7404f9 100644
--- a/engines/nancy/script/records.h
+++ b/engines/nancy/script/records.h
@@ -428,6 +428,7 @@ private:
 	int getFirstFrame() const { return _firstFrame > 0 ? _firstFrame : 1; }
 	int getLastFrame() const { return _lastFrame > 0 ? _lastFrame : (int)_sources.size(); }
 	int getNumSteps() const;
+	void readSources(int index);
 	void setFrame(int frame);
 	void applyFrame();
 	void beginLoop();


Commit: 1794d0e383825906403be8a1d5546639bde44127
    https://github.com/scummvm/scummvm/commit/1794d0e383825906403be8a1d5546639bde44127
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-05T17:56:59+02:00

Commit Message:
NANCY: NANCY19: Show the same response of a conversation only once

A conversation can be given the same response twice, and the
original only shows the first one, as it names the buttons of the
responses after their sounds. Before, both were shown, like the
question about the sketch to Kit in Nancy19 scene 1100.

Changed paths:
    engines/nancy/script/convo.cpp
    engines/nancy/script/convo.h


diff --git a/engines/nancy/script/convo.cpp b/engines/nancy/script/convo.cpp
index 367f83842d0..a191d780dad 100644
--- a/engines/nancy/script/convo.cpp
+++ b/engines/nancy/script/convo.cpp
@@ -231,6 +231,19 @@ bool ConvoRecord::isResponseOnOffer(const ConvoResponse &response) {
 	return isOnOffer;
 }
 
+// The buttons of the responses are named after their sounds, and the text only
+// goes to the first one of a name, so the same line shows once. Kit's questions
+// in Nancy19 scene 1100 offer the sketch twice.
+bool ConvoRecord::isSoundOffered(const Common::String &soundName) const {
+	for (const ConvoResponse *response : _offeredResponses) {
+		if (response->soundName.equalsIgnoreCase(soundName)) {
+			return true;
+		}
+	}
+
+	return false;
+}
+
 // Done the first time the record runs, after its RunOnce function, which can
 // set the flags that decide the responses: Nancy19 scene 1136
 void ConvoRecord::begin() {
@@ -258,7 +271,7 @@ void ConvoRecord::begin() {
 	}
 
 	for (ConvoResponse *response : _responses) {
-		if (isResponseOnOffer(*response)) {
+		if (isResponseOnOffer(*response) && !isSoundOffered(response->soundName)) {
 			_offeredResponses.push_back(response);
 		}
 	}
diff --git a/engines/nancy/script/convo.h b/engines/nancy/script/convo.h
index fa021e9be6f..e4d8257afed 100644
--- a/engines/nancy/script/convo.h
+++ b/engines/nancy/script/convo.h
@@ -90,6 +90,7 @@ private:
 	};
 
 	void begin();
+	bool isSoundOffered(const Common::String &soundName) const;
 	bool isVideoDone() const;
 
 	void playSound(const Common::String &name, uint16 channel);


Commit: 7c9a13793b6289cf170e00dbe42915048d15467b
    https://github.com/scummvm/scummvm/commit/7c9a13793b6289cf170e00dbe42915048d15467b
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-12-05T17:57:04+02:00

Commit Message:
NANCY: NANCY20: Let the scripts read the frames of an animation

The scripts can read the frames of an animation, to change them. The
coconut toss of Nancy20 turns its frames around that way, to play
them backwards.

Changed paths:
    engines/nancy/script/records.cpp


diff --git a/engines/nancy/script/records.cpp b/engines/nancy/script/records.cpp
index a3ed4c6ba60..59e135224dc 100644
--- a/engines/nancy/script/records.cpp
+++ b/engines/nancy/script/records.cpp
@@ -2439,6 +2439,13 @@ bool AnimOverlayRecord::getField(const Common::String &key) {
 
 	if (key == "onScreen") {
 		pushRect(L, _dest);
+	} else if (key == "sources") {
+		// A copy of the frames: Nancy20's coconut toss turns them around
+		lua_createtable(L, _sources.size(), 0);
+		for (uint i = 0; i < _sources.size(); ++i) {
+			pushRect(L, _sources[i]);
+			lua_rawseti(L, -2, i + 1);
+		}
 	} else if (key == "Play") {
 		lua_pushcfunction(L, animOverlayPlay);
 	} else if (key == "Pause") {




More information about the Scummvm-git-logs mailing list