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

sev- noreply at scummvm.org
Sun Oct 12 22:50:06 UTC 2025


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

Summary:
e5c394bd56 DIRECTOR: Improve debug output for RTE2 loading
0400940b8f DIRECTOR: Properly name dumped PNGs for bitmap cast members
02313b878e DIRECTOR: Pass castid to RTE2 parser
44d97e908e DIRECTOR: Improved dumped chunk filenames
8e8ade7797 DIRECTOR: Dump RTE2 into PNG files when requested
41527d364f DIRECTOR: Split RTE2 rendering to with backgroung and without it
a659887bcf DIRECTOR: Removed noisy warning about default m_new() stub for behaviors


Commit: e5c394bd562ac64b2248b56d075d39d16d81a700
    https://github.com/scummvm/scummvm/commit/e5c394bd562ac64b2248b56d075d39d16d81a700
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-10-13T00:49:49+02:00

Commit Message:
DIRECTOR: Improve debug output for RTE2 loading

Changed paths:
    engines/director/rte.cpp


diff --git a/engines/director/rte.cpp b/engines/director/rte.cpp
index 21047c914cc..3a8a3a870f7 100644
--- a/engines/director/rte.cpp
+++ b/engines/director/rte.cpp
@@ -88,13 +88,13 @@ Graphics::ManagedSurface *RTE2::createSurface(uint32 foreColor, uint32 bgColor,
 				r = stream.readByte();
 				g = stream.readByte();
 				b = stream.readByte();
-				debugC(9, kDebugLoading, "[%04x] (%d, %d): color %d %d %d", pos, x, y, r, g, b);
+				debugC(8, kDebugLoading, "[%04x] (%d, %d): color %d %d %d", pos, x, y, r, g, b);
 				continue;
 			}
 			a = ((uint32)check*0xff/((1 << _bpp) - 1));
 			if (check == 0 || check == checkMax) {
 				byte count = stream.readByte();
-				debugC(9, kDebugLoading, "[%04x] (%d, %d): %02x, count %d", pos, x, y, check, count);
+				debugC(8, kDebugLoading, "[%04x] (%d, %d): %02x, count %d", pos, x, y, check, count);
 				if (count == 0x00 && check == 0x00) {
 					// end of line, fill the remaining colour
 					a = 0;
@@ -111,7 +111,7 @@ Graphics::ManagedSurface *RTE2::createSurface(uint32 foreColor, uint32 bgColor,
 						break;
 				}
 			} else {
-				debugC(9, kDebugLoading, "[%04x] (%d, %d): %02x", pos, x, y, check);
+				debugC(8, kDebugLoading, "[%04x] (%d, %d): %02x", pos, x, y, check);
 				*(uint32 *)surface.getBasePtr(x, y) = pf.ARGBToColor(a, r, g, b);
 				x += 1;
 			}


Commit: 0400940b8f797e13855bcd1659e1749d139a88e3
    https://github.com/scummvm/scummvm/commit/0400940b8f797e13855bcd1659e1749d139a88e3
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-10-13T00:49:49+02:00

Commit Message:
DIRECTOR: Properly name dumped PNGs for bitmap cast members

Changed paths:
    engines/director/castmember/bitmap.cpp


diff --git a/engines/director/castmember/bitmap.cpp b/engines/director/castmember/bitmap.cpp
index e06cc8d51f9..74cf85b96bd 100644
--- a/engines/director/castmember/bitmap.cpp
+++ b/engines/director/castmember/bitmap.cpp
@@ -726,7 +726,7 @@ void BitmapCastMember::load() {
 
 					if (ConfMan.getBool("dump_scripts")) {
 
-						Common::String prepend = "stream";
+						Common::String prepend = _cast->getMacName();
 						Common::String filename = Common::String::format("./dumps/%s-%s-%d.png", encodePathForDump(prepend).c_str(), tag2str(tag), imgId);
 						Common::DumpFile bitmapFile;
 
@@ -809,7 +809,7 @@ void BitmapCastMember::load() {
 
 	if (ConfMan.getBool("dump_scripts")) {
 
-		Common::String prepend = "stream";
+		Common::String prepend = _cast->getMacName();
 		Common::String filename = Common::String::format("./dumps/%s-%s-%d.png", encodePathForDump(prepend).c_str(), tag2str(tag), imgId);
 		Common::DumpFile bitmapFile;
 


Commit: 02313b878e2e4e3a56d11f01ff2cd18c2629e3be
    https://github.com/scummvm/scummvm/commit/02313b878e2e4e3a56d11f01ff2cd18c2629e3be
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-10-13T00:49:49+02:00

Commit Message:
DIRECTOR: Pass castid to RTE2 parser

Changed paths:
    engines/director/cast.cpp
    engines/director/rte.cpp
    engines/director/rte.h


diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index 1a6a2639cd3..46fe782429f 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -851,7 +851,7 @@ void Cast::loadCast() {
 	for (auto &iterator : rte2) {
 		r = _castArchive->getResource(MKTAG('R','T','E','2'), iterator);
 		debugC(3, kDebugText, "RTE2: id %d", iterator - _castIDoffset);
-		_loadedRTE2s.setVal(iterator, new RTE2(this, *r));
+		_loadedRTE2s.setVal(iterator, new RTE2(this, *r, iterator));
 		delete r;
 	}
 
diff --git a/engines/director/rte.cpp b/engines/director/rte.cpp
index 3a8a3a870f7..246d4502b88 100644
--- a/engines/director/rte.cpp
+++ b/engines/director/rte.cpp
@@ -50,7 +50,7 @@ RTE1::RTE1(Cast *cast, Common::SeekableReadStreamEndian &stream) : _cast(cast) {
 		stream.read(&data[0], stream.size());
 }
 
-RTE2::RTE2(Cast *cast, Common::SeekableReadStreamEndian &stream) : _cast(cast) {
+RTE2::RTE2(Cast *cast, Common::SeekableReadStreamEndian &stream, uint16 id) : _cast(cast), _id(id) {
 	if (debugChannelSet(9, kDebugLoading)) {
 		debugC(9, kDebugLoading, "RTE2:");
 		stream.hexdump(stream.size());
diff --git a/engines/director/rte.h b/engines/director/rte.h
index 0c193b6f114..1523004055b 100644
--- a/engines/director/rte.h
+++ b/engines/director/rte.h
@@ -55,12 +55,13 @@ public:
 
 class RTE2 {
 public:
-	RTE2(Cast *cast, Common::SeekableReadStreamEndian &stream);
+	RTE2(Cast *cast, Common::SeekableReadStreamEndian &stream, uint16 id);
 	~RTE2();
 
 	Graphics::ManagedSurface *createSurface(uint32 foreColor, uint32 bgColor, const Graphics::PixelFormat &pf) const;
 
 	Cast *_cast;
+	uint16 _id;
 	uint16 _width;
 	uint16 _height;
 	uint32 _bpp;


Commit: 44d97e908ec88bef8ca93f696d6e06b3a7109060
    https://github.com/scummvm/scummvm/commit/44d97e908ec88bef8ca93f696d6e06b3a7109060
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-10-13T00:49:49+02:00

Commit Message:
DIRECTOR: Improved dumped chunk filenames

Changed paths:
    engines/director/archive.cpp


diff --git a/engines/director/archive.cpp b/engines/director/archive.cpp
index 9d0b84a3531..8e9931099a6 100644
--- a/engines/director/archive.cpp
+++ b/engines/director/archive.cpp
@@ -283,7 +283,7 @@ void Archive::dumpChunk(Resource &res, Common::DumpFile &out) {
 		dataSize = resStream->size();
 	}
 
-	Common::Path prepend = _pathName.empty() ? _pathName : "stream";
+	Common::Path prepend = _pathName.empty() ? Common::Path(g_director->getEXEName()) : _pathName;
 	Common::Path filename(Common::String::format("./dumps/%s-%s-%d", encodePathForDump(prepend.toString(g_director->_dirSeparator)).c_str(), tag2str(res.tag), res.index), '/');
 	resStream->read(data, len);
 


Commit: 8e8ade7797e5d5fdf53d2f821a6fed51ac926ff8
    https://github.com/scummvm/scummvm/commit/8e8ade7797e5d5fdf53d2f821a6fed51ac926ff8
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-10-13T00:49:50+02:00

Commit Message:
DIRECTOR: Dump RTE2 into PNG files when requested

Changed paths:
    engines/director/rte.cpp


diff --git a/engines/director/rte.cpp b/engines/director/rte.cpp
index 246d4502b88..f294d9dd25f 100644
--- a/engines/director/rte.cpp
+++ b/engines/director/rte.cpp
@@ -19,10 +19,13 @@
  *
  */
 
+#include "common/config-manager.h"
 #include "common/debug.h"
-#include "common/stream.h"
+#include "common/file.h"
 #include "common/memstream.h"
 
+#include "image/png.h"
+
 #include "director/director.h"
 #include "director/cast.h"
 #include "graphics/pixelformat.h"
@@ -125,6 +128,21 @@ Graphics::ManagedSurface *RTE2::createSurface(uint32 foreColor, uint32 bgColor,
 	result->blitFrom(surface, nullptr);
 
 	surface.free();
+
+	if (ConfMan.getBool("dump_scripts")) {
+
+		Common::String prepend = _cast->getMacName();
+		Common::String filename = Common::String::format("./dumps/%s-%s-%d.png", encodePathForDump(prepend).c_str(), "RTE2", _id);
+		Common::DumpFile bitmapFile;
+
+		warning("RTE2::createSurface(): Dumping RTE2 to '%s'", filename.c_str());
+
+		bitmapFile.open(Common::Path(filename), true);
+		Image::writePNG(bitmapFile, *result->surfacePtr(), nullptr);
+
+		bitmapFile.close();
+	}
+
 	return result;
 }
 


Commit: 41527d364f2d184b05c1719f6985aa034e3b1337
    https://github.com/scummvm/scummvm/commit/41527d364f2d184b05c1719f6985aa034e3b1337
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-10-13T00:49:50+02:00

Commit Message:
DIRECTOR: Split RTE2 rendering to with backgroung and without it

Since for us there is no reliable way to determine which pixel
is background and which is foreground, we render two images and
then return in accordance with the ink in the sprite channel.

This fixes messages in check.dxr in melements. That particular
movie specified white text on white background, but used
TransBackground ink.

Changed paths:
    engines/director/castmember/richtext.cpp
    engines/director/castmember/richtext.h
    engines/director/rte.cpp
    engines/director/rte.h


diff --git a/engines/director/castmember/richtext.cpp b/engines/director/castmember/richtext.cpp
index b43ff96fbfe..fe5a08ab925 100644
--- a/engines/director/castmember/richtext.cpp
+++ b/engines/director/castmember/richtext.cpp
@@ -24,6 +24,7 @@
 
 #include "director/director.h"
 #include "director/cast.h"
+#include "director/channel.h"
 #include "director/images.h"
 #include "director/movie.h"
 #include "director/picture.h"
@@ -81,6 +82,7 @@ RichTextCastMember::RichTextCastMember(Cast *cast, uint16 castId, Common::Seekab
 
 	_type = kCastRichText;
 	_picture = nullptr;
+	_pictureWithBg = nullptr;
 }
 
 RichTextCastMember::RichTextCastMember(Cast *cast, uint16 castId, RichTextCastMember &source)
@@ -98,6 +100,9 @@ RichTextCastMember::RichTextCastMember(Cast *cast, uint16 castId, RichTextCastMe
 RichTextCastMember::~RichTextCastMember() {
 	if (_picture)
 		delete _picture;
+
+	if (_pictureWithBg)
+		delete _pictureWithBg;
 }
 
 void RichTextCastMember::load() {
@@ -142,13 +147,21 @@ void RichTextCastMember::load() {
 	}
 	if (_cast->_loadedRTE2s.contains(rte2id)) {
 		_picture = new Picture();
-		const RTE2 *rte2 =  _cast->_loadedRTE2s.getVal(rte2id);
-		Graphics::ManagedSurface *surface = rte2->createSurface(_foreColor, _bgColor, _pf32);
+		const RTE2 *rte2 = _cast->_loadedRTE2s.getVal(rte2id);
+		Graphics::ManagedSurface *surface = rte2->createSurface(_foreColor, _bgColor, _pf32, false);
 		if (surface) {
 			_picture->_surface.copyFrom(surface->rawSurface());
 			surface->free();
 			delete surface;
 		}
+
+		_pictureWithBg = new Picture();
+		surface = rte2->createSurface(_foreColor, _bgColor, _pf32, true);
+		if (surface) {
+			_pictureWithBg->_surface.copyFrom(surface->rawSurface());
+			surface->free();
+			delete surface;
+		}
 	} else {
 		warning("RichTextCastMember::load(): rte2tid %i isn't loaded, no bitmap text!", rte2id);
 	}
@@ -173,14 +186,18 @@ Graphics::MacWidget *RichTextCastMember::createWidget(Common::Rect &bbox, Channe
 	Graphics::MacWidget *widget = new Graphics::MacWidget(g_director->getCurrentWindow()->getMacWindow(), bbox.left, bbox.top, bbox.width(), bbox.height(), g_director->_wm, false);
 
 	Graphics::Surface *dithered = nullptr;
+	Picture *src = _pictureWithBg;
+
+	if (channel->_sprite->_ink == kInkTypeBackgndTrans)
+		src = _picture;
 
 	if (dstBpp == 1) {
-		dithered = _picture->_surface.convertTo(g_director->_wm->_pixelformat, nullptr, 0, g_director->_wm->getPalette(), g_director->_wm->getPaletteSize());
+		dithered = src->_surface.convertTo(g_director->_wm->_pixelformat, nullptr, 0, g_director->_wm->getPalette(), g_director->_wm->getPaletteSize());
 	}
 
 	// scale for drawing a different size sprite
 	copyStretchImg(
-		dithered ? dithered : &_picture->_surface,
+		dithered ? dithered : &src->_surface,
 		widget->getSurface()->surfacePtr(),
 		_initialRect,
 		bbox,
@@ -195,8 +212,6 @@ Graphics::MacWidget *RichTextCastMember::createWidget(Common::Rect &bbox, Channe
 	return widget;
 }
 
-
-
 bool RichTextCastMember::hasField(int field) {
 	switch (field) {
 	case kTheText:
diff --git a/engines/director/castmember/richtext.h b/engines/director/castmember/richtext.h
index 0f0d24d8cb2..e3edfd20b23 100644
--- a/engines/director/castmember/richtext.h
+++ b/engines/director/castmember/richtext.h
@@ -55,6 +55,7 @@ private:
 	Common::U32String _plainText;
 	Graphics::PixelFormat _pf32;
 	Picture *_picture;
+	Picture *_pictureWithBg;
 
 	// _initialRect
 	// _boundingRect
diff --git a/engines/director/rte.cpp b/engines/director/rte.cpp
index f294d9dd25f..3a9c0d538df 100644
--- a/engines/director/rte.cpp
+++ b/engines/director/rte.cpp
@@ -73,7 +73,7 @@ RTE2::RTE2(Cast *cast, Common::SeekableReadStreamEndian &stream, uint16 id) : _c
 	debugC(5, kDebugLoading, "RTE2: _width: %d, _height: %d, _bpp: %d, _rle: %d bytes", _width, _height, _bpp, rleCount);
 }
 
-Graphics::ManagedSurface *RTE2::createSurface(uint32 foreColor, uint32 bgColor, const Graphics::PixelFormat &pf) const {
+Graphics::ManagedSurface *RTE2::createSurface(uint32 foreColor, uint32 bgColor, const Graphics::PixelFormat &pf, bool renderBg) const {
 	if (_rle.empty())
 		return nullptr;
 	Common::MemoryReadStream stream(_rle.data(), _rle.size());
@@ -122,8 +122,12 @@ Graphics::ManagedSurface *RTE2::createSurface(uint32 foreColor, uint32 bgColor,
 	}
 	Graphics::ManagedSurface *result = new Graphics::ManagedSurface();
 	result->create((int16)_width, (int16)_height, pf);
-	// Fill it with the background colour
-	result->fillRect(Common::Rect(_width, _height), bgColor);
+
+	if (renderBg) {
+		// Fill it with the background colour
+		result->fillRect(Common::Rect(_width, _height), bgColor);
+	}
+
 	// Blit the alpha text map
 	result->blitFrom(surface, nullptr);
 
@@ -132,7 +136,8 @@ Graphics::ManagedSurface *RTE2::createSurface(uint32 foreColor, uint32 bgColor,
 	if (ConfMan.getBool("dump_scripts")) {
 
 		Common::String prepend = _cast->getMacName();
-		Common::String filename = Common::String::format("./dumps/%s-%s-%d.png", encodePathForDump(prepend).c_str(), "RTE2", _id);
+		Common::String filename = Common::String::format("./dumps/%s-%s%s-%d.png",
+				encodePathForDump(prepend).c_str(), "RTE2", (renderBg ? "-bg" : ""), _id);
 		Common::DumpFile bitmapFile;
 
 		warning("RTE2::createSurface(): Dumping RTE2 to '%s'", filename.c_str());
diff --git a/engines/director/rte.h b/engines/director/rte.h
index 1523004055b..d887d1dee32 100644
--- a/engines/director/rte.h
+++ b/engines/director/rte.h
@@ -58,7 +58,7 @@ public:
 	RTE2(Cast *cast, Common::SeekableReadStreamEndian &stream, uint16 id);
 	~RTE2();
 
-	Graphics::ManagedSurface *createSurface(uint32 foreColor, uint32 bgColor, const Graphics::PixelFormat &pf) const;
+	Graphics::ManagedSurface *createSurface(uint32 foreColor, uint32 bgColor, const Graphics::PixelFormat &pf, bool renderBg) const;
 
 	Cast *_cast;
 	uint16 _id;


Commit: a659887bcfece538c47860f4273d82af730fb155
    https://github.com/scummvm/scummvm/commit/a659887bcfece538c47860f4273d82af730fb155
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-10-13T00:49:50+02:00

Commit Message:
DIRECTOR: Removed noisy warning about default m_new() stub for behaviors

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


diff --git a/engines/director/lingo/lingo-object.cpp b/engines/director/lingo/lingo-object.cpp
index 5149f7d72d0..109b48f1d4f 100644
--- a/engines/director/lingo/lingo-object.cpp
+++ b/engines/director/lingo/lingo-object.cpp
@@ -474,7 +474,9 @@ void Lingo::reloadOpenXLibs() {
 
 void LM::m_new(int nargs) {
 	// This is usually overridden by a user-defined mNew
-	g_lingo->printSTUBWithArglist("m_new", nargs);
+	//
+	// However, in behaviors it is often absent, and it is
+	// in essence our default constructor.
 	g_lingo->push(g_lingo->_state->me);
 }
 




More information about the Scummvm-git-logs mailing list