[Scummvm-git-logs] scummvm master -> 076927c90f3f82eb2cbe2b7d45589a1091edb8ee

sev- noreply at scummvm.org
Wed Oct 25 16:22:21 UTC 2023


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

Summary:
b4dd5bbace DIRECTOR: Fix b_getLast behaviour when list is empty
c973bc7db0 DIRECTOR: Update darkeye to use 32-bit colour
1f684aaa7d DIRECTOR: Add quirk to inject save files into SearchMan
eb6774fa4f DIRECTOR: Fix missing palette data in cast debugger
190406c8d1 DIRECTOR: Add debug timing for draw calls
076927c90f DIRECTOR: Fix rendering performance regression


Commit: b4dd5bbace1c68ec9196f348a9334f63285c7be4
    https://github.com/scummvm/scummvm/commit/b4dd5bbace1c68ec9196f348a9334f63285c7be4
Author: Scott Percival (code at moral.net.au)
Date: 2023-10-25T18:22:15+02:00

Commit Message:
DIRECTOR: Fix b_getLast behaviour when list is empty

Fixes turning around near the front door in The Dark Eye.

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 d2b18a85f6c..b90739503e5 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -837,10 +837,18 @@ void LB::b_getLast(int nargs) {
 	Datum list = g_lingo->pop();
 	switch (list.type) {
 	case ARRAY:
-		g_lingo->push(list.u.farr->arr.back());
+		if (list.u.farr->arr.empty()) {
+			g_lingo->pushVoid();
+		} else {
+			g_lingo->push(list.u.farr->arr.back());
+		}
 		break;
 	case PARRAY:
-		g_lingo->push(list.u.parr->arr.back().v);
+		if (list.u.farr->arr.empty()) {
+			g_lingo->pushVoid();
+		} else {
+			g_lingo->push(list.u.parr->arr.back().v);
+		}
 		break;
 	default:
 		TYPECHECK(list, ARRAY);


Commit: c973bc7db04705496787eba26ef74e7d229c002f
    https://github.com/scummvm/scummvm/commit/c973bc7db04705496787eba26ef74e7d229c002f
Author: Scott Percival (code at moral.net.au)
Date: 2023-10-25T18:22:15+02:00

Commit Message:
DIRECTOR: Update darkeye to use 32-bit colour

Changed paths:
    engines/director/detection_tables.h
    engines/director/lingo/xlibs/spacemgr.cpp


diff --git a/engines/director/detection_tables.h b/engines/director/detection_tables.h
index 6ae218c5e99..dc30659e0a0 100644
--- a/engines/director/detection_tables.h
+++ b/engines/director/detection_tables.h
@@ -3672,8 +3672,8 @@ static const DirectorGameDescription gameDescriptions[] = {
 	// Mac version has 68k, PowerPC, and a fat binary (default) as options in the installer
 	// Mac installer is a Stuffit installer
 	// Windows version in SETUP/DATA.Z
-	MACGAME1("darkeye", "", "The Dark Eye (Universal)", "67f572196550aedb1f9523d782022be0", 486078, 404),
-	WINGAME1t("darkeye", "", "DARKEYE.EXE", "67ba8428573dba0c8e12e7f02e4ef1bc", 742326, 404),
+	MACGAME1tf("darkeye", "", "The Dark Eye (Universal)", "67f572196550aedb1f9523d782022be0", 486078, 404, GF_32BPP),
+	WINGAME1tf("darkeye", "", "DARKEYE.EXE", "67ba8428573dba0c8e12e7f02e4ef1bc", 742326, 404, GF_32BPP),
 
 	// From the Police Quest Collection
 	WINGAME1t("darylfgates", "", "INTERVEW.EXE", "8262bbad22daa2cdd9cf13ebba1b84ea", 1059729, 400),
diff --git a/engines/director/lingo/xlibs/spacemgr.cpp b/engines/director/lingo/xlibs/spacemgr.cpp
index 2e4782dd982..9133b1caf6d 100644
--- a/engines/director/lingo/xlibs/spacemgr.cpp
+++ b/engines/director/lingo/xlibs/spacemgr.cpp
@@ -23,6 +23,7 @@
  *
  * USED IN:
  * DEVO Presents: Adventures of the Smart Patrol
+ * The Dark Eye
  *
  **************************************************/
 


Commit: 1f684aaa7d1eb3828d5838f9d978cfa5b3944c83
    https://github.com/scummvm/scummvm/commit/1f684aaa7d1eb3828d5838f9d978cfa5b3944c83
Author: Scott Percival (code at moral.net.au)
Date: 2023-10-25T18:22:15+02:00

Commit Message:
DIRECTOR: Add quirk to inject save files into SearchMan

All file input/output via FileIO is written to the save game storage,
irrespective of destination path. Occasionally, some games will use the
Director file APIs (namely b_getNthFileNameInFolder) to check that a
file exists before trying to open it. This quirk allows you to specify a
path where save game files would be stored, and inserts file stubs
into CachedArchive with the filenames from the save game storage.

Fixes save game detection in The Dark Eye.

Changed paths:
    engines/director/game-quirks.cpp


diff --git a/engines/director/game-quirks.cpp b/engines/director/game-quirks.cpp
index e1963e41d8d..965faac7012 100644
--- a/engines/director/game-quirks.cpp
+++ b/engines/director/game-quirks.cpp
@@ -22,6 +22,7 @@
 #include "common/compression/vise.h"
 #include "common/macresman.h"
 #include "common/memstream.h"
+#include "common/savefile.h"
 #include "director/director.h"
 
 namespace Director {
@@ -82,6 +83,16 @@ struct CachedFile {
 	{ nullptr, Common::kPlatformUnknown, nullptr, nullptr, 0 }
 };
 
+struct SaveFilePath {
+	const char *target;
+	Common::Platform platform;
+	const char *path;
+} const saveFilePaths[] = {
+	{ "darkeye", Common::kPlatformWindows, "SAVEDDKY/" },
+	{ nullptr, Common::kPlatformUnknown, nullptr },
+};
+
+
 static void quirkLimit15FPS() {
 	g_director->_fpsLimit = 15;
 }
@@ -205,6 +216,24 @@ void DirectorEngine::gameQuirks(const char *target, Common::Platform platform) {
 			}
 	}
 
+	for (auto f = saveFilePaths; f->target != nullptr; f++) {
+		if (f->platform == Common::kPlatformUnknown || f->platform == platform)
+			if (!strcmp(f->target, target)) {
+				// Inject files from the save game storage into the path
+				Common::SaveFileManager *saves = g_system->getSavefileManager();
+				// As save games are name-mangled by FileIO, demangle them here
+				Common::String prefix = g_director->getTargetName() + '-' + '*';
+				for (auto &it : saves->listSavefiles(prefix.c_str())) {
+					Common::String demangled = f->path + it.substr(prefix.size() - 1);
+					if (demangled.hasSuffixIgnoreCase(".txt")) {
+						demangled = demangled.substr(0, demangled.size() - 4);
+					}
+					list.push_back(CachedArchive::InputEntry(demangled, nullptr, 0));
+				}
+			}
+
+	}
+
 	if (!list.empty()) {
 		CachedArchive *archive = new CachedArchive(list);
 


Commit: eb6774fa4faf623388de6460ef118033cfbe273e
    https://github.com/scummvm/scummvm/commit/eb6774fa4faf623388de6460ef118033cfbe273e
Author: Scott Percival (code at moral.net.au)
Date: 2023-10-25T18:22:15+02:00

Commit Message:
DIRECTOR: Fix missing palette data in cast debugger

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


diff --git a/engines/director/castmember/palette.cpp b/engines/director/castmember/palette.cpp
index a12553b3ca5..2ec31d0392e 100644
--- a/engines/director/castmember/palette.cpp
+++ b/engines/director/castmember/palette.cpp
@@ -61,7 +61,6 @@ void PaletteCastMember::load() {
 		warning("STUB: PaletteCastMember::load(): Palettes not yet supported for version %d", _cast->_version);
 	}
 	if (paletteId) {
-		//_palette = g_director->getPalette(paletteId);
 
 		uint32 tag = MKTAG('C', 'L', 'U', 'T');
 		Archive *arch = _cast->getArchive();
@@ -71,6 +70,7 @@ void PaletteCastMember::load() {
 			PaletteV4 palData = _cast->loadPalette(*pal, paletteId);
 			CastMemberID cid(_castId, _cast->_castLibID);
 			g_director->addPalette(cid, palData.palette, palData.length);
+			_palette = g_director->getPalette(cid);
 			delete pal;
 		} else {
 			warning("PaletteCastMember::load(): no CLUT palette %d for cast index %d found", paletteId, _castId);


Commit: 190406c8d1eab6d36d26257419c510db12912d2b
    https://github.com/scummvm/scummvm/commit/190406c8d1eab6d36d26257419c510db12912d2b
Author: Scott Percival (code at moral.net.au)
Date: 2023-10-25T18:22:15+02:00

Commit Message:
DIRECTOR: Add debug timing for draw calls

Changed paths:
    engines/director/score.cpp
    engines/director/window.cpp


diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index b8e41af8266..4429238a453 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -1553,7 +1553,7 @@ Frame *Score::getFrameData(int frameNum){
 
 	// Backup variables
 	int tempFrameNumber = _curFrameNumber;
-	
+
 	bool isFrameRead = loadFrame(frameNum, false);
 	Frame *tempFrame = _currentFrame;
 
@@ -1575,7 +1575,7 @@ void Score::setSpriteCasts() {
 	for (uint16 j = 0; j < _currentFrame->_sprites.size(); j++) {
 		_currentFrame->_sprites[j]->setCast(_currentFrame->_sprites[j]->_castId);
 
-		debugC(5, kDebugImages, "Score::setSpriteCasts(): Frame: 0 Channel: %d castId: %s type: %d (%s)",
+		debugC(8, kDebugLoading, "Score::setSpriteCasts(): Frame: 0 Channel: %d castId: %s type: %d (%s)",
 			 j, _currentFrame->_sprites[j]->_castId.asString().c_str(), _currentFrame->_sprites[j]->_spriteType,
 			spriteType2str(_currentFrame->_sprites[j]->_spriteType));
 	}
diff --git a/engines/director/window.cpp b/engines/director/window.cpp
index ff812a3b772..d5e7e5e2841 100644
--- a/engines/director/window.cpp
+++ b/engines/director/window.cpp
@@ -19,6 +19,7 @@
  *
  */
 
+#include "common/debug.h"
 #include "common/file.h"
 #include "common/system.h"
 #include "common/macresman.h"
@@ -147,6 +148,9 @@ bool Window::render(bool forceRedraw, Graphics::ManagedSurface *blitTo) {
 
 	Channel *hiliteChannel = _currentMovie->getScore()->getChannelById(_currentMovie->_currentHiliteChannelId);
 
+	uint32 renderStartTime = g_system->getMillis();
+	debugC(7, kDebugImages, "Window::render(): Updating %d rects", _dirtyRects.size());
+
 	for (auto &i : _dirtyRects) {
 		const Common::Rect &r = i;
 		_dirtyChannels = _currentMovie->getScore()->getSpriteIntersections(r);
@@ -208,6 +212,7 @@ bool Window::render(bool forceRedraw, Graphics::ManagedSurface *blitTo) {
 
 	_dirtyRects.clear();
 	_contentIsDirty = true;
+	debugC(7, kDebugImages, "Window::render(): Draw finished in %d ms",  g_system->getMillis() - renderStartTime);
 
 	return true;
 }
@@ -279,6 +284,13 @@ void Window::inkBlitFrom(Channel *channel, Common::Rect destRect, Graphics::Mana
 	pd.destRect = destRect;
 	pd.dst = blitTo;
 
+	uint32 renderStartTime = 0;
+	if (debugChannelSet(8, kDebugImages)) {
+		CastType castType = channel->_sprite->_cast ? channel->_sprite->_cast->_type : kCastTypeNull;
+		debugC(8, kDebugImages, "Window::inkBlitFrom(): updating %dx%d @ %d,%d, type: %s, ink: %d", destRect.width(), destRect.height(), destRect.left, destRect.top, castType2str(castType), channel->_sprite->_ink);
+		renderStartTime = g_system->getMillis();
+	}
+
 	if (pd.ms) {
 		pd.inkBlitShape(srcRect);
 	} else if (pd.srf) {
@@ -286,11 +298,15 @@ void Window::inkBlitFrom(Channel *channel, Common::Rect destRect, Graphics::Mana
 	} else {
 		if (debugChannelSet(kDebugImages, 4)) {
 			CastType castType = channel->_sprite->_cast ? channel->_sprite->_cast->_type : kCastTypeNull;
-			warning("Window::inkBlitFrom: No source surface: spriteType: %d (%s), castType: %d (%s), castId: %s",
+			warning("Window::inkBlitFrom(): No source surface: spriteType: %d (%s), castType: %d (%s), castId: %s",
 				channel->_sprite->_spriteType, spriteType2str(channel->_sprite->_spriteType), castType, castType2str(castType),
 				channel->_sprite->_castId.asString().c_str());
 		}
 	}
+
+	if (debugChannelSet(8, kDebugImages)) {
+		debugC(8, kDebugImages, "Window::inkBlitFrom(): Draw finished in %d ms",  g_system->getMillis() - renderStartTime);
+	}
 }
 
 Common::Point Window::getMousePos() {


Commit: 076927c90f3f82eb2cbe2b7d45589a1091edb8ee
    https://github.com/scummvm/scummvm/commit/076927c90f3f82eb2cbe2b7d45589a1091edb8ee
Author: Scott Percival (code at moral.net.au)
Date: 2023-10-25T18:22:15+02:00

Commit Message:
DIRECTOR: Fix rendering performance regression

BitmapCastMember::isModified would test to see if there had been a
palette change, and recommend a redraw. Because of a typo, the check
would always fail and require a redraw, meaning the presence of a
640x480 static image would require redrawing the entire screen.

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


diff --git a/engines/director/castmember/bitmap.cpp b/engines/director/castmember/bitmap.cpp
index 1bc8f253412..2f019ffb01d 100644
--- a/engines/director/castmember/bitmap.cpp
+++ b/engines/director/castmember/bitmap.cpp
@@ -402,7 +402,7 @@ bool BitmapCastMember::isModified() {
 		if (currentPaletteId == castPaletteId) {
 			return !_ditheredTargetClut.isNull();
 		} else {
-			return _ditheredTargetClut != currentPaletteId;
+			return !_ditheredTargetClut.isNull() && _ditheredTargetClut != currentPaletteId;
 		}
 	}
 	return false;




More information about the Scummvm-git-logs mailing list