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

sev- noreply at scummvm.org
Mon Nov 2 12:01:35 UTC 2026


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

Summary:
e6145c7562 DIRECTOR: Restore current window after nested event dispatch
0fa57bf246 DIRECTOR: Follow the score's editable flag
32ab56e50c DIRECTOR: LINGO: Make `pass` halt the current handler
de812a77af DIRECTOR: Resolve text cast background colour against the active palette
c84f8c6d26 DIRECTOR: Let list builtins override same-named handlers from me methods
22269e285b DIRECTOR: Only tolerate surplus arguments to the list builtins
544172897a DIRECTOR: Normalise saved-movie names so they can be loaded back
7fc7984aa0 DIRECTOR: List saved files in getNthFileNameInFolder()


Commit: e6145c7562d32e77b400e9c3b7a35d39179d5caa
    https://github.com/scummvm/scummvm/commit/e6145c7562d32e77b400e9c3b7a35d39179d5caa
Author: Lariaa (30549703+Lariaa at users.noreply.github.com)
Date: 2026-11-02T13:01:25+01:00

Commit Message:
DIRECTOR: Restore current window after nested event dispatch

Movie::processEvent() and broadcastEvent() made their own window current and
left it that way. Fixes the start of "Ein Fall fuer Muetze & Co", where the
startup movie's exitFrame loads transient data movies into MIAWs: once one of
them had been dispatched to, the window the score was running in no longer was
the current one.

Hold a reference on the window while dispatching. setCurrentWindow() drops the
one the engine held, and a handler can close the window we mean to go back to --
the same use-after-free 9a895fa75db fixed in Window::processSysEvent, which
guards its own saved window the same way.

Changed paths:
    engines/director/lingo/lingo-events.cpp


diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index f58d77664a8..86045e2eaf0 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -704,8 +704,19 @@ bool Movie::processInputEvent(LEvent event, int targetId, Common::Point pos) {
 void Movie::processEvent(LEvent event, int targetId) {
 	Common::Queue<LingoEvent> queue;
 	queueEvent(queue, event, targetId);
+
+	// Hold a reference across the dispatch: setCurrentWindow() below drops the
+	// one the engine held, and the handlers we are about to run can close the
+	// window we mean to go back to.
+	Window *savedWindow = _vm->getCurrentWindow();
+	if (savedWindow)
+		savedWindow->incRefCount();
 	_vm->setCurrentWindow(this->getWindow());
 	_lingo->processEvents(queue, false);
+	if (savedWindow) {
+		_vm->setCurrentWindow(savedWindow);
+		savedWindow->decRefCount();
+	}
 }
 
 void Movie::broadcastEvent(LEvent event) {
@@ -721,8 +732,17 @@ void Movie::broadcastEvent(LEvent event) {
 	// the event exactly once, after every behavior.
 	queueEvent(queue, event, 0);
 
+	// Restore the current window after dispatching, holding a reference across
+	// it for the same reason as in processEvent() above.
+	Window *savedWindow = _vm->getCurrentWindow();
+	if (savedWindow)
+		savedWindow->incRefCount();
 	_vm->setCurrentWindow(this->getWindow());
 	_lingo->processEvents(queue, false);
+	if (savedWindow) {
+		_vm->setCurrentWindow(savedWindow);
+		savedWindow->decRefCount();
+	}
 }
 
 void Lingo::processEvents(Common::Queue<LingoEvent> &queue, bool isInputEvent) {


Commit: 0fa57bf246c971faf7917dd2c5b1c7ded6d6aad3
    https://github.com/scummvm/scummvm/commit/0fa57bf246c971faf7917dd2c5b1c7ded6d6aad3
Author: Lariaa (30549703+Lariaa at users.noreply.github.com)
Date: 2026-11-02T13:01:25+01:00

Commit Message:
DIRECTOR: Follow the score's editable flag

"Ein Fall fuer Muetze & Co" makes its login name fields editable on the same
cast member, at the same position, when the user picks "new member": frame 149
of LOG_IN.DXR differs from frame 148 in nothing but the sprite's editable bit.
Two things stood in the way, and fixing either alone changes nothing.

Director test movie created in D4-win/editable-d4.dir

Changed paths:
    engines/director/channel.cpp
    engines/director/sprite.cpp


diff --git a/engines/director/channel.cpp b/engines/director/channel.cpp
index 8f53c3dc97a..17a8ddbc704 100644
--- a/engines/director/channel.cpp
+++ b/engines/director/channel.cpp
@@ -308,6 +308,7 @@ bool Channel::isDirty(Sprite *nextSprite) {
 		isDirtyFlag |= _sprite->_castId != nextSprite->_castId ||
 			_sprite->_ink != nextSprite->_ink || _sprite->_backColor != nextSprite->_backColor ||
 			_sprite->_foreColor != nextSprite->_foreColor ||
+			_sprite->_editable != nextSprite->_editable ||
 			_sprite->_blendAmount != nextSprite->_blendAmount ||
 			(_sprite->_thickness & kTThickness) != (nextSprite->_thickness & kTThickness);
 		if (!_sprite->_moveable)
diff --git a/engines/director/sprite.cpp b/engines/director/sprite.cpp
index cd001b885a9..610337c1da9 100644
--- a/engines/director/sprite.cpp
+++ b/engines/director/sprite.cpp
@@ -681,11 +681,7 @@ void Sprite::replaceFrom(Sprite *nextSprite) {
 		return;
 	}
 
-	// If the cast member is the same, persist the editable flag
 	bool editable = nextSprite->_editable;
-	if (_castId == nextSprite->_castId) {
-		editable = _editable;
-	}
 
 	bool immediate = _immediate;
 


Commit: 32ab56e50c08fef9f7b8084ca669f560cca330eb
    https://github.com/scummvm/scummvm/commit/32ab56e50c08fef9f7b8084ca669f560cca330eb
Author: Lariaa (30549703+Lariaa at users.noreply.github.com)
Date: 2026-11-02T13:01:25+01:00

Commit Message:
DIRECTOR: LINGO: Make `pass` halt the current handler

Fixes "Ein Fall fuer Muetze & Co" name entry, whose keyDown routes valid keys
through `pass` before an unconditional puppetSound("Error") + dontPassEvent
tail that would otherwise beep and swallow every character.

Changed paths:
    engines/director/lingo/lingo-builtins.cpp


diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 9695c0484e2..6fceaf6bd6e 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -2080,6 +2080,9 @@ void LB::b_idleLoadDone(int nargs) {
 
 void LB::b_pass(int nargs) {
 	g_lingo->_passEvent = true;
+
+	// Director's `pass` stops the current handler
+	g_lingo->_abort = true;
 }
 
 void LB::b_pause(int nargs) {


Commit: de812a77afdb5626d228018044192e3f32b01330
    https://github.com/scummvm/scummvm/commit/de812a77afdb5626d228018044192e3f32b01330
Author: Lariaa (30549703+Lariaa at users.noreply.github.com)
Date: 2026-11-02T13:01:25+01:00

Commit Message:
DIRECTOR: Resolve text cast background colour against the active palette

TextCastMember resolved _bgcolor to a palette index in the constructor, against
the palette present at cast-load time. When a movie installs its own CLUT later.
Resolve it lazily in getBackColor() against the active palette; a new _bgColorSet flag preserves an
explicit Lingo colour.

Fixes color of the textboxes in "Ein Fall für Mütze und Co"

Changed paths:
    engines/director/castmember/text.cpp
    engines/director/castmember/text.h


diff --git a/engines/director/castmember/text.cpp b/engines/director/castmember/text.cpp
index f31db9ceb89..fe39167b538 100644
--- a/engines/director/castmember/text.cpp
+++ b/engines/director/castmember/text.cpp
@@ -51,6 +51,7 @@ TextCastMember::TextCastMember(Cast *cast, uint16 castId, Common::SeekableReadSt
 
 	_bgcolor = 0;
 	_fgcolor = 0xff;
+	_bgColorSet = false;
 
 	_textFlags = 0;
 	_scroll = 0;
@@ -153,7 +154,7 @@ TextCastMember::TextCastMember(Cast *cast, uint16 castId, Common::SeekableReadSt
 		_buttonType = static_cast<ButtonType>(stream.readUint16BE() - 1);
 	}
 
-	_bgcolor = g_director->_wm->findBestColor(_bgpalinfo1 & 0xff, _bgpalinfo2 & 0xff, _bgpalinfo3 & 0xff);
+	// _bgcolor is derived lazily in getBackColor(); keep only _bgpalinfo here.
 
 	_modified = true;
 }
@@ -199,6 +200,7 @@ TextCastMember::TextCastMember(Cast *cast, uint16 castId, TextCastMember &source
 	_rtext = source._rtext;
 
 	_bgcolor = source._bgcolor;
+	_bgColorSet = source._bgColorSet;
 	_fgcolor = source._fgcolor;
 }
 
@@ -206,8 +208,10 @@ void TextCastMember::setColors(uint32 *fgcolor, uint32 *bgcolor) {
 	if (fgcolor)
 		_fgcolor = *fgcolor;
 
-	if (bgcolor)
+	if (bgcolor) {
 		_bgcolor = *bgcolor;
+		_bgColorSet = true;
+	}
 
 	// if we want to keep the format unchanged, then we need to modify _ftext as well
 	Graphics::MacText *target = getWidget();
@@ -232,9 +236,16 @@ Graphics::TextAlign TextCastMember::getAlignment() {
 
 void TextCastMember::setBackColor(uint32 bgCol) {
 	_bgcolor = bgCol;
+	_bgColorSet = true;
 	_modified = true;
 }
 
+uint32 TextCastMember::getBackColor() {
+	if (!_bgColorSet)
+		_bgcolor = g_director->_wm->findBestColor(_bgpalinfo1 & 0xff, _bgpalinfo2 & 0xff, _bgpalinfo3 & 0xff);
+	return _bgcolor;
+}
+
 uint32 TextCastMember::getForeColor(int start, int end) {
 	Graphics::MacText *target = getWidget();
 	if (target) {
diff --git a/engines/director/castmember/text.h b/engines/director/castmember/text.h
index 07dfe55e9f5..8d250428cf0 100644
--- a/engines/director/castmember/text.h
+++ b/engines/director/castmember/text.h
@@ -50,7 +50,7 @@ public:
 	void updateFromWidget(Graphics::MacWidget *widget, bool spriteEditable) override;
 	Graphics::TextAlign getAlignment();
 
-	uint32 getBackColor() override { return _bgcolor; }
+	uint32 getBackColor() override;
 	void setBackColor(uint32 bgCol) override;
 	uint32 getForeColor() override { return _fgcolor; }
 	uint32 getForeColor(int start, int end);
@@ -137,6 +137,7 @@ private:
 
 	uint32 _bgcolor;
 	uint32 _fgcolor;
+	bool _bgColorSet;
 };
 
 } // End of namespace Director


Commit: c84f8c6d26aae749f1089fb41c407d5fdc408554
    https://github.com/scummvm/scummvm/commit/c84f8c6d26aae749f1089fb41c407d5fdc408554
Author: Lariaa (30549703+Lariaa at users.noreply.github.com)
Date: 2026-11-02T13:01:25+01:00

Commit Message:
DIRECTOR: Let list builtins override same-named handlers from me methods

Decide the list-builtin override before the me-object method lookup so the
builtin wins, matching Director.

In 'Ein Fall fuer Muetze & Co' the SpecialAddresses parent script calls
getLast(movieRef, 2) from its own 'new' method; resolving that to the local
getLast method instead of the builtin left the object uninitialized.

Director test created in ‎D4-win/listoverride-d4.dir

Changed paths:
    engines/director/lingo/lingo-code.cpp


diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index db6ff976d35..0ca64aae002 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -1692,6 +1692,15 @@ void LC::call(const Common::String &name, int nargs, bool allowRetVal) {
 		}
 	}
 
+	bool useListBuiltin = false;
+	if (g_lingo->_builtinListHandlers.contains(name) && nargs >= 1) {
+		Datum firstArg = g_lingo->peek(nargs - 1);
+		if (firstArg.type == ARRAY || firstArg.type == PARRAY ||
+				firstArg.type == POINT || firstArg.type == RECT) {
+			useListBuiltin = true;
+		}
+	}
+
 	// If we're calling from within a me object, and it has a function handler with a
 	// matching name, include the me object in the CFrame (so we still get property lookups).
 	// Doesn't matter that the first arg isn't the me object (which would have been caught
@@ -1700,7 +1709,7 @@ void LC::call(const Common::String &name, int nargs, bool allowRetVal) {
 	// If the method is called from outside and without the object as the first arg,
 	// it will still work using the normal getHandler lookup.
 	// However properties will return garbage (the number 3??).
-	if (g_lingo->_state->me.type == OBJECT) {
+	if (!useListBuiltin && g_lingo->_state->me.type == OBJECT) {
 		AbstractObject *target = g_lingo->_state->me.u.obj;
 		funcSym = target->getMethod(name);
 		if (funcSym.type != VOIDSYM) {
@@ -1712,16 +1721,8 @@ void LC::call(const Common::String &name, int nargs, bool allowRetVal) {
 	// Handler
 	funcSym = g_lingo->getHandler(name);
 
-	if (g_lingo->_builtinListHandlers.contains(name) && nargs >= 1) {
-		// Lingo builtin functions in the "List" category have very strange override mechanics.
-		// If the first argument is an ARRAY or PARRAY, it will use the builtin.
-		// Otherwise, it will fall back to whatever handler is defined globally.
-		Datum firstArg = g_lingo->peek(nargs - 1);
-		if (firstArg.type == ARRAY || firstArg.type == PARRAY ||
-				firstArg.type == POINT || firstArg.type == RECT) {
-			funcSym = g_lingo->_builtinListHandlers[name];
-		}
-	}
+	if (useListBuiltin)
+		funcSym = g_lingo->_builtinListHandlers[name];
 
 	if (funcSym.type == VOIDSYM) { // The built-ins could be overridden
 		// Builtin


Commit: 22269e285b7eb071ba522e837ed66966dd307bdf
    https://github.com/scummvm/scummvm/commit/22269e285b7eb071ba522e837ed66966dd307bdf
Author: Lariaa (30549703+Lariaa at users.noreply.github.com)
Date: 2026-11-02T13:01:25+01:00

Commit Message:
DIRECTOR: Only tolerate surplus arguments to the list builtins

Restrict the "silently ignore surplus trailing arguments" behaviour to the list
builtins (getLast/getAt/getOne/getPos/count). Verified against real Director
5-7: only the list builtins tolerate extra arguments; the scalar and math
builtins (abs, integer, sqrt, string) raise "One parameter expected" in every
version.

Changed paths:
    engines/director/lingo/lingo-code.cpp


diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index 0ca64aae002..812b2e9ee85 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -1804,7 +1804,7 @@ void LC::call(const Symbol &funcSym, int nargs, bool allowRetVal) {
 					nargs++;
 				}
 			}
-		} else if (funcSym.nargs > nargs || funcSym.maxArgs < nargs) {
+		} else if (funcSym.nargs > nargs) {
 			warning("Incorrect number of arguments for builtin '%s' (%d, expected %d to %d). Dropping %d stack items.",
 						funcSym.name->c_str(), nargs, funcSym.nargs, funcSym.maxArgs, nargs);
 
@@ -1816,6 +1816,31 @@ void LC::call(const Symbol &funcSym, int nargs, bool allowRetVal) {
 				g_lingo->pushVoid();
 
 			return;
+		} else if (funcSym.maxArgs < nargs) {
+			// Lingo silently ignores surplus (trailing) arguments to the LIST
+			// builtins (getLast/getAt/getOne/getPos/count), and games rely on it --
+			// Verified against real Director 5/6/7: only the list builtins tolerate extra arguments
+			// Drop the surplus only for list builtins;
+			if (funcSym.type == FBLTIN_LIST || funcSym.type == HBLTIN_LIST) {
+				debugC(1, kDebugLingoExec, "Dropping %d extra argument(s) for builtin '%s' (%d, expected %d to %d)",
+							nargs - funcSym.maxArgs, funcSym.name->c_str(), nargs, funcSym.nargs, funcSym.maxArgs);
+
+				while (nargs > funcSym.maxArgs) {
+					g_lingo->pop();
+					nargs--;
+				}
+			} else {
+				warning("Incorrect number of arguments for builtin '%s' (%d, expected %d to %d). Dropping %d stack items.",
+							funcSym.name->c_str(), nargs, funcSym.nargs, funcSym.maxArgs, nargs);
+
+				for (int i = 0; i < nargs; i++)
+					g_lingo->pop();
+
+				if (allowRetVal)
+					g_lingo->pushVoid();
+
+				return;
+			}
 		}
 	}
 


Commit: 544172897a41d285f02078596a6b34c4f5a51afd
    https://github.com/scummvm/scummvm/commit/544172897a41d285f02078596a6b34c4f5a51afd
Author: Lariaa (30549703+Lariaa at users.noreply.github.com)
Date: 2026-11-02T13:01:25+01:00

Commit Message:
DIRECTOR: Normalise saved-movie names so they can be loaded back

saveMovie() keyed the saved file under the raw filename while the movie
loader resolves names through convertPath() (which strips drive letters)
Run both the save name and the SavedArchive key through convertPath()
so they match.

'Ein Fall fuer Muetze & Co' saves player profiles to a drive-qualified path.

Changed paths:
    engines/director/archive-save.cpp


diff --git a/engines/director/archive-save.cpp b/engines/director/archive-save.cpp
index 46b0e577a69..e1dee6cd234 100644
--- a/engines/director/archive-save.cpp
+++ b/engines/director/archive-save.cpp
@@ -30,6 +30,7 @@
 #include "director/score.h"
 #include "director/window.h"
 #include "director/sprite.h"
+#include "director/util.h"
 
 #include "director/castmember/castmember.h"
 #include "director/castmember/bitmap.h"
@@ -60,7 +61,11 @@ bool RIFXArchive::writeToFile(Common::String filename, Movie *movie) {
 		filename = movie->getMacName();
 	}
 
-	Common::String saveFileName = g_director->getTargetName() + "-" + filename;
+	// Normalise the name the same way the movie loader does, so the key 
+	// the save is stored under matches the one used when the movie is later loaded by fileName.
+	// Otherwise e.g. saving "C:\SCORES.DXR" and loading it back (which resolves
+	// to "SCORES.DXR") would not find the saved file.
+	Common::String saveFileName = g_director->getTargetName() + "-" + convertPath(filename);
 	// Don't open the save file as compressed which doesn't support seeking
 	Common::OutSaveFile *saveFile = g_engine->getSaveFileManager()->openForSaving(saveFileName, false);
 
@@ -794,7 +799,8 @@ Common::SeekableReadStream *SavedArchive::createReadStreamForMember(const Common
 bool SavedArchive::_addFile(const Common::String &fileName) {
 	// Derive the original file name from the save file name
 	// Save files are named target_name-save_filename
-	Common::String origFileName = fileName.substr(_target.size() + 1);
+	// Normalise it with convertPath.
+	Common::String origFileName = convertPath(fileName.substr(_target.size() + 1));
 	if (!_files.contains(origFileName)) {
 		debugC(3, kDebugLoading, "Found save file: %s -> %s", fileName.c_str(), fileName.c_str());
 


Commit: 7fc7984aa06a824a007d7ffd0db9654551d3a1c6
    https://github.com/scummvm/scummvm/commit/7fc7984aa06a824a007d7ffd0db9654551d3a1c6
Author: Lariaa (30549703+Lariaa at users.noreply.github.com)
Date: 2026-11-02T13:01:25+01:00

Commit Message:
DIRECTOR: List saved files in getNthFileNameInFolder()

A game that checks for its own save by walking the directory never found it.
"Ein Fall fuer Muetze & Co" compares every entry of
"the pathName" against "SCORES.DXR". The check always failed, so every session
fell back to the empty EMPTSCOR.DXR template and started a new player profile.

Changed paths:
    engines/director/lingo/lingo-builtins.cpp


diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 6fceaf6bd6e..1f516ed810e 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -1694,6 +1694,17 @@ void LB::b_getNthFileNameInFolder(int nargs) {
 		}
 	}
 
+	Common::Archive *saved = SearchMan.getArchive(kSavedFilesArchive);
+	if (saved) {
+		Common::ArchiveMemberList files;
+
+		saved->listMatchingMembers(files, path.append(path.empty() ? "*" : "/*", '/'), true);
+
+		for (auto &fi : files) {
+			fileNameList.push_back(Common::lastPathComponent(fi->getName(), '/'));
+		}
+	}
+
 	// Next, mix in files from the game filesystem (if they exist)
 	if (d.exists()) {
 		Common::FSList f;
@@ -1705,12 +1716,19 @@ void LB::b_getNthFileNameInFolder(int nargs) {
 		}
 	}
 
-	if (!fileNameList.empty() && (uint)fileNum < fileNameList.size()) {
-		// Sort files alphabetically
-		Common::sort(fileNameList.begin(), fileNameList.end());
-		r = Datum(fileNameList[fileNum]);
+	// Sort files alphabetically
+	Common::sort(fileNameList.begin(), fileNameList.end());
+
+	for (uint i = 1; i < fileNameList.size();) {
+		if (fileNameList[i].equalsIgnoreCase(fileNameList[i - 1]))
+			fileNameList.remove_at(i);
+		else
+			i++;
 	}
 
+	if ((uint)fileNum < fileNameList.size())
+		r = Datum(fileNameList[fileNum]);
+
 	g_lingo->push(r);
 }
 




More information about the Scummvm-git-logs mailing list