[Scummvm-git-logs] scummvm master -> 132a07c0e8f761d5013c6981343bb3efd4e0d2a5

eriktorbjorn noreply at scummvm.org
Fri Feb 4 17:55:40 UTC 2022


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

Summary:
132a07c0e8 SCUMM: Fix graphics glitch in TurboGrafx-16 version of Loom


Commit: 132a07c0e8f761d5013c6981343bb3efd4e0d2a5
    https://github.com/scummvm/scummvm/commit/132a07c0e8f761d5013c6981343bb3efd4e0d2a5
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-02-04T18:51:40+01:00

Commit Message:
SCUMM: Fix graphics glitch in TurboGrafx-16 version of Loom

Now Bobbin's palette is changed when entering/leaving the darkened tent.
It's odd that this effect looks so different from all other versions of
the game that I've tried (VGA, EGA and FM Towns), but it seems to match
the original behavior based on YouTube videos I've watched.

Changed paths:
    engines/scumm/costume.cpp
    engines/scumm/script_v5.cpp


diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp
index dba8a188877..8f7d64f9beb 100644
--- a/engines/scumm/costume.cpp
+++ b/engines/scumm/costume.cpp
@@ -938,9 +938,21 @@ void PCEngineCostumeRenderer::setPalette(uint16 *palette) {
 	byte *rgbPtr = rgb;
 	_vm->readPCEPalette(&ptr, &rgbPtr, 15);
 
+	// Normally, palette is filled with 0xFF and can be ignored. But this
+	// can be changed through scripting, and when entering the darkened
+	// tent in Loom certain colors are set to 0. These should be black.
+	//
+	// There are several other cases where other colors are set, but in my
+	// playthrough I couldn't see any case where honoring these would make
+	// any improvements. Quite the contrary in fact, since it would
+	// introduce numerous glitches comparing to what I've seen of the
+	// original behavior.
+
 	_palette[0] = 0;
-	for (int i = 0; i < 15; ++i)
-		_palette[i + 1] = _vm->get16BitColor(rgb[i * 3 + 0], rgb[i * 3 + 1], rgb[i * 3 + 2]);
+	for (int i = 0; i < 15; ++i) {
+		int c = (palette[i + 1] != 0) ? i : 0;
+		_palette[i + 1] = _vm->get16BitColor(rgb[c * 3 + 0], rgb[c * 3 + 1], rgb[c * 3 + 2]);
+	}
 }
 #endif
 
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index 288caae62bc..caca301966b 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -519,7 +519,18 @@ void ScummEngine_v5::o5_actorOps() {
 					i = 3;
 			}
 
-			a->setPalette(i, j);
+			// Setting palette color 0 to 0 appears to be a way to
+			// reset the actor palette in the TurboGrafx-16 version
+			// of Loom. It's used in several places, but the only
+			// one where I can see any visible difference is when
+			// leaving the darkened tent.
+
+			if (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine && i == 0 && j == 0) {
+				for (int k = 0; k < 32; k++)
+					a->setPalette(k, 0xFF);
+			} else {
+				a->setPalette(i, j);
+			}
 			break;
 		case 12:		// SO_TALK_COLOR
 			a->_talkColor = getVarOrDirectByte(PARAM_1);




More information about the Scummvm-git-logs mailing list