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

eriktorbjorn noreply at scummvm.org
Wed Mar 23 14:23:23 UTC 2022


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

Summary:
4d468fb005 SCUMM: Update the game's "extra" setting, if necessary
6ac9154403 SCUMM: Add options for game-specific tweaks, and enable it for MI1
cf02446865 SCUMM: Make MI1 Smirk cigar smoke optional
1e91650154 SCUMM: Make MI1 additional Lemonhead dialog optional
88206f2ff4 SCUMM: Make MI1 clock tower restored behavior optional
f4b1919da9 SCUMM: Make MI1 Smirk background noises optional
20f9997300 SCUMM: Make MI2 Guybrush dialog when getting Rapp's map optional
4f8653e4f9 SCUMM: Make playing missing Mac MI2 music optional.
52549c1678 SCUMM: Make correcting position of green tank in Sam & Max optional
2a796cedd7 SCUMM: Make fixing VGA Loom "Choas" typo optional
f496f75eb9 SCUMM: Make fixing Mandible's distaff animation in VGA Loom optional
afb807599b SCUMM: Make palette effects in Mac b/w Loom / Last Crusade optional
cb561f462e SCUMM: Read the "enable_enhancements" setting only once
b66e84d57a SCUMM: Change "Use correct font spacing" to a game-specific enhancement


Commit: 4d468fb00504ddf3bb91418bf36ab57901799c99
    https://github.com/scummvm/scummvm/commit/4d468fb00504ddf3bb91418bf36ab57901799c99
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-03-23T15:23:10+01:00

Commit Message:
SCUMM: Update the game's "extra" setting, if necessary

This would have been done at detection, but if the game entry is really
old it may still be empty. We sometimes need it to tell versions apart.

Changed paths:
    engines/scumm/metaengine.cpp


diff --git a/engines/scumm/metaengine.cpp b/engines/scumm/metaengine.cpp
index 653571f909f..998774f6161 100644
--- a/engines/scumm/metaengine.cpp
+++ b/engines/scumm/metaengine.cpp
@@ -336,6 +336,12 @@ Common::Error ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) {
 	// file transparently.
 	Common::updateGameGUIOptions(res.game.guioptions, getGameGUIOptionsDescriptionLanguage(res.language));
 
+	// If the game was added really long ago, it may be missing its "extra"
+	// field. When adding game-specific options, it may be our only way of
+	// telling certain versions apart, so make sure it's updated.
+	if (res.game.variant && res.game.variant[0] && !ConfMan.hasKey("extra"))
+		ConfMan.setAndFlush("extra", res.game.variant);
+
 	// Check for a user override of the platform. We allow the user to override
 	// the platform, to make it possible to add games which are not yet in
 	// our MD5 database but require a specific platform setting.
@@ -527,10 +533,8 @@ GUI::OptionsContainerWidget *ScummMetaEngine::buildEngineOptionsWidgetDynamic(GU
 	if (ConfMan.get("gameid", target) != "loom")
 		return nullptr;
 
-	// These Loom settings are only relevant for the EGA version, so
-	// exclude non-DOS versions. If the game was added a long time ago,
-	// the platform may still be listed as unknown, and there may be no
-	// "extra" field to query.
+	// These Loom settings are only relevant for the EGA version, since
+	// that is the only one that has an overture.
 
 	Common::Platform platform = Common::parsePlatform(ConfMan.get("platform", target));
 	if (platform != Common::kPlatformUnknown && platform != Common::kPlatformDOS)
@@ -541,7 +545,6 @@ GUI::OptionsContainerWidget *ScummMetaEngine::buildEngineOptionsWidgetDynamic(GU
 	if (extra == "Steam" || extra == "VGA")
 		return nullptr;
 
-	// So we still can't be quite sure it's the EGA version. Oh well...
 	return new Scumm::LoomEgaGameOptionsWidget(boss, name, target);
 }
 


Commit: 6ac9154403193932ad7fbbfaa8c2efc50eebd074
    https://github.com/scummvm/scummvm/commit/6ac9154403193932ad7fbbfaa8c2efc50eebd074
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-03-23T15:23:10+01:00

Commit Message:
SCUMM: Add options for game-specific tweaks, and enable it for MI1

Changed paths:
    engines/scumm/detection.cpp


diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index e9fe4e227f9..31e056b3a62 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -213,6 +213,13 @@ static const ExtraGuiOption smoothScrolling = {
 	true
 };
 
+static const ExtraGuiOption enableEnhancements {
+	_s("Enable game-specific enhancements"),
+	_s("Allow ScummVM to make small enhancements to the game, usually based on other versions of the same game."),
+	"enable_enhancements",
+	true
+};
+
 const ExtraGuiOptions ScummMetaEngineDetection::getExtraGuiOptions(const Common::String &target) const {
 	ExtraGuiOptions options;
 	// Query the GUI options
@@ -222,6 +229,10 @@ const ExtraGuiOptions ScummMetaEngineDetection::getExtraGuiOptions(const Common:
 	const Common::String guiOptions = parseGameGUIOptions(guiOptionsString);
 	const Common::Platform platform = Common::parsePlatform(ConfMan.get("platform", target));
 
+	if (target.empty() || gameid == "monkey") {
+		options.push_back(enableEnhancements);
+	}
+
 	if (target.empty() || gameid == "comi") {
 		options.push_back(comiObjectLabelsOption);
 	}


Commit: cf0244686533a7abe30b438ae129f99f8503d537
    https://github.com/scummvm/scummvm/commit/cf0244686533a7abe30b438ae129f99f8503d537
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-03-23T15:23:10+01:00

Commit Message:
SCUMM: Make MI1 Smirk cigar smoke optional

Changed paths:
    engines/scumm/script_v5.cpp


diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index 0a3657085bb..2bbb87757b1 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -457,7 +457,7 @@ void ScummEngine_v5::o5_actorOps() {
 			// But in the VGA CD version, only costume 0 is used
 			// and the close-up is missing the cigar smoke.
 
-			if (_game.id == GID_MONKEY && _currentRoom == 76 && act == 12 && i == 0) {
+			if (_game.id == GID_MONKEY && _currentRoom == 76 && act == 12 && i == 0 && ConfMan.getBool("enable_enhancements")) {
 				i = 76;
 			}
 
@@ -1650,7 +1650,7 @@ void ScummEngine_v5::o5_putActor() {
 	// other coordinates. The difference is never more than a single pixel,
 	// so there's not much reason to correct those.
 
-	if (_game.id == GID_MONKEY && _currentRoom == 76 && act == 12) {
+	if (_game.id == GID_MONKEY && _currentRoom == 76 && act == 12 && ConfMan.getBool("enable_enhancements")) {
 		if (x == 176 && y == 80) {
 			x = 174;
 			y = 86;
@@ -1922,7 +1922,7 @@ void ScummEngine_v5::o5_roomOps() {
 			// we want the original color 3 for the cigar smoke. It
 			// should be ok since there is no GUI in this scene.
 
-			if (_game.id == GID_MONKEY && _currentRoom == 76 && d == 3)
+			if (_game.id == GID_MONKEY && _currentRoom == 76 && d == 3 && ConfMan.getBool("enable_enhancements"))
 				break;
 
 			setPalColor(d, a, b, c);	/* index, r, g, b */


Commit: 1e91650154b3a5ee774c9bc8d7c1c4ae7cf272f9
    https://github.com/scummvm/scummvm/commit/1e91650154b3a5ee774c9bc8d7c1c4ae7cf272f9
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-03-23T15:23:10+01:00

Commit Message:
SCUMM: Make MI1 additional Lemonhead dialog optional

Changed paths:
    engines/scumm/resource.cpp


diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp
index d6161ea94f2..0b5557ae86a 100644
--- a/engines/scumm/resource.cpp
+++ b/engines/scumm/resource.cpp
@@ -1738,7 +1738,7 @@ void ScummEngine::applyWorkaroundIfNeeded(ResType type, int idx) {
 	// overwritten. This probably affects all CD versions, so we just have
 	// to add further patches as they are reported.
 
-	if (_game.id == GID_MONKEY && type == rtRoom && idx == 25) {
+	if (_game.id == GID_MONKEY && type == rtRoom && idx == 25 && ConfMan.getBool("enable_enhancements")) {
 		tryPatchMI1CannibalScript(getResourceAddress(type, idx), size);
 	} else
 


Commit: 88206f2ff43f31764970757d11c6b3dda39466af
    https://github.com/scummvm/scummvm/commit/88206f2ff43f31764970757d11c6b3dda39466af
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-03-23T15:23:10+01:00

Commit Message:
SCUMM: Make MI1 clock tower restored behavior optional

Changed paths:
    engines/scumm/script_v5.cpp


diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index 2bbb87757b1..acc5c2edb32 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -670,7 +670,7 @@ void ScummEngine_v5::o5_add() {
 	// We restore the old behavior by adding 0, not 1, to the second
 	// variable when examining the clock tower.
 
-	if (_game.id == GID_MONKEY && vm.slot[_currentScript].number == 210 && _currentRoom == 35 && _resultVarNumber == 248 && a == 1) {
+	if (_game.id == GID_MONKEY && vm.slot[_currentScript].number == 210 && _currentRoom == 35 && _resultVarNumber == 248 && a == 1 && ConfMan.getBool("enable_enhancements")) {
 		a = 0;
 	}
 


Commit: f4b1919da98f6082dd09246b76ceed8f455aed6c
    https://github.com/scummvm/scummvm/commit/f4b1919da98f6082dd09246b76ceed8f455aed6c
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-03-23T15:23:10+01:00

Commit Message:
SCUMM: Make MI1 Smirk background noises optional

Changed paths:
    engines/scumm/script_v5.cpp


diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index acc5c2edb32..e0f6628156f 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -2341,7 +2341,7 @@ void ScummEngine_v5::o5_stopSound() {
 	// 10001 regardless of which room it is. We figure out which one by
 	// looking at which rooms we're moving between.
 
-	if (_game.id == GID_MONKEY && (_game.features & GF_AUDIOTRACKS) && sound == 126 && vm.slot[_currentScript].number == 10001 && VAR(VAR_ROOM) == 43 && VAR(VAR_NEW_ROOM) == 76) {
+	if (_game.id == GID_MONKEY && (_game.features & GF_AUDIOTRACKS) && sound == 126 && vm.slot[_currentScript].number == 10001 && VAR(VAR_ROOM) == 43 && VAR(VAR_NEW_ROOM) == 76 && ConfMan.getBool("enable_enhancements")) {
 		return;
 	}
 


Commit: 20f9997300e451a9a31e8b3d8acacc212bee8e47
    https://github.com/scummvm/scummvm/commit/20f9997300e451a9a31e8b3d8acacc212bee8e47
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-03-23T15:23:10+01:00

Commit Message:
SCUMM: Make MI2 Guybrush dialog when getting Rapp's map optional

Changed paths:
    engines/scumm/detection.cpp
    engines/scumm/string.cpp


diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index 31e056b3a62..aad341bca7e 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -229,7 +229,7 @@ const ExtraGuiOptions ScummMetaEngineDetection::getExtraGuiOptions(const Common:
 	const Common::String guiOptions = parseGameGUIOptions(guiOptionsString);
 	const Common::Platform platform = Common::parsePlatform(ConfMan.get("platform", target));
 
-	if (target.empty() || gameid == "monkey") {
+	if (target.empty() || gameid == "monkey" || gameid == "monkey2") {
 		options.push_back(enableEnhancements);
 	}
 
diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp
index bca2350b279..ce1c1147c63 100644
--- a/engines/scumm/string.cpp
+++ b/engines/scumm/string.cpp
@@ -67,7 +67,8 @@ void ScummEngine::printString(int m, const byte *msg) {
 		if (_game.id == GID_MONKEY2 && _roomResource == 19 &&
 			vm.slot[_currentScript].number == 203 &&
 			_actorToPrintStrFor == 255 && strcmp((const char *)msg, " ") == 0 &&
-			getOwner(200) == VAR(VAR_EGO) && VAR(VAR_HAVE_MSG)) {
+			getOwner(200) == VAR(VAR_EGO) && VAR(VAR_HAVE_MSG) &&
+			ConfMan.getBool("enable_enhancements")) {
 			return;
 		}
 


Commit: 4f8653e4f911f58997d79026f34297400bdce1a4
    https://github.com/scummvm/scummvm/commit/4f8653e4f911f58997d79026f34297400bdce1a4
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-03-23T15:23:10+01:00

Commit Message:
SCUMM: Make playing missing Mac MI2 music optional.

Changed paths:
    engines/scumm/sound.cpp


diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index 4a394ddbb5b..b777fc6d1a1 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -1493,6 +1493,14 @@ int ScummEngine::readSoundResource(ResId idx) {
 				pri = 3;
 				break;
 			case MKTAG('R','O','L',' '):
+				// Some of the Mac MI2 music only exists as Roland tracks. The
+				// original interpreter doesn't play them. I don't think there
+				// is any similarly missing FoA music.
+				if (_game.id == GID_MONKEY2 && _game.platform == Common::kPlatformMacintosh && !ConfMan.getBool("enable_enhancements")) {
+					pri = -1;
+					break;
+				}
+
 				pri = 3;
 				if (_native_mt32)
 					pri = 5;


Commit: 52549c1678332786c01ebe47aedc4e6577621bff
    https://github.com/scummvm/scummvm/commit/52549c1678332786c01ebe47aedc4e6577621bff
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-03-23T15:23:10+01:00

Commit Message:
SCUMM: Make correcting position of green tank in Sam & Max optional

Changed paths:
    engines/scumm/actor.cpp
    engines/scumm/detection.cpp


diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index faf746a2fa0..40eec8a35de 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -20,6 +20,7 @@
  */
 
 #include "common/system.h"	// for setFocusRectangle/clearFocusRectangle
+#include "common/config-manager.h"
 #include "scumm/scumm.h"
 #include "scumm/actor.h"
 #include "scumm/actor_he.h"
@@ -1609,7 +1610,7 @@ void Actor::putActor(int dstX, int dstY, int newRoom) {
 	// WORKAROUND: The green transparency of the tank in the Hall of Oddities
 	// is positioned one pixel too far to the left. This appears to be a bug
 	// in the original game as well.
-	if (_vm->_game.id == GID_SAMNMAX && newRoom == 16 && _number == 5 && dstX == 235 && dstY == 236)
+	if (_vm->_game.id == GID_SAMNMAX && newRoom == 16 && _number == 5 && dstX == 235 && dstY == 236 && ConfMan.getBool("enable_enhancements"))
 		dstX++;
 
 	_pos.x = dstX;
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index aad341bca7e..01a7bd0e82a 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -229,7 +229,7 @@ const ExtraGuiOptions ScummMetaEngineDetection::getExtraGuiOptions(const Common:
 	const Common::String guiOptions = parseGameGUIOptions(guiOptionsString);
 	const Common::Platform platform = Common::parsePlatform(ConfMan.get("platform", target));
 
-	if (target.empty() || gameid == "monkey" || gameid == "monkey2") {
+	if (target.empty() || gameid == "monkey" || gameid == "monkey2" || gameid == "samnmax") {
 		options.push_back(enableEnhancements);
 	}
 


Commit: 2a796cedd786bcd20ff580f187935576be7ac5b9
    https://github.com/scummvm/scummvm/commit/2a796cedd786bcd20ff580f187935576be7ac5b9
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-03-23T15:23:10+01:00

Commit Message:
SCUMM: Make fixing VGA Loom "Choas" typo optional

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


diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index 01a7bd0e82a..b3afd1f391a 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -229,7 +229,7 @@ const ExtraGuiOptions ScummMetaEngineDetection::getExtraGuiOptions(const Common:
 	const Common::String guiOptions = parseGameGUIOptions(guiOptionsString);
 	const Common::Platform platform = Common::parsePlatform(ConfMan.get("platform", target));
 
-	if (target.empty() || gameid == "monkey" || gameid == "monkey2" || gameid == "samnmax") {
+	if (target.empty() || gameid == "monkey" || gameid == "monkey2" || gameid == "samnmax" || (gameid == "loom" && (extra == "VGA" || extra == "Steam"))) {
 		options.push_back(enableEnhancements);
 	}
 
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index e0f6628156f..f8bdd9fcd6c 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -2977,7 +2977,7 @@ void ScummEngine_v5::decodeParseString() {
 		case 15:{	// SO_TEXTSTRING
 				const int len = resStrLen(_scriptPointer);
 
-				if (_game.id == GID_LOOM && vm.slot[_currentScript].number == 95 && strcmp((const char *)_scriptPointer, "I am Choas.") == 0) {
+				if (_game.id == GID_LOOM && vm.slot[_currentScript].number == 95 && strcmp((const char *)_scriptPointer, "I am Choas.") == 0 && ConfMan.getBool("enable_enhancements")) {
 					// WORKAROUND: This happens when Chaos introduces
 					// herself to bishop Mandible. Of all the places to put
 					// a typo...


Commit: f496f75eb9f2a9356639878959b0354337b5555f
    https://github.com/scummvm/scummvm/commit/f496f75eb9f2a9356639878959b0354337b5555f
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-03-23T15:23:10+01:00

Commit Message:
SCUMM: Make fixing Mandible's distaff animation in VGA Loom optional

Changed paths:
    engines/scumm/script_v5.cpp


diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index f8bdd9fcd6c..575746d588b 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -1396,7 +1396,7 @@ void ScummEngine_v5::o5_isLessEqual() {
 	// together that they look like one. This adjusts the timing of the
 	// second one.
 
-	if (_game.id == GID_LOOM && _game.version >= 4 && _language == Common::EN_ANY && vm.slot[_currentScript].number == 95 && var == VAR_MUSIC_TIMER && b == 1708) {
+	if (_game.id == GID_LOOM && _game.version >= 4 && _language == Common::EN_ANY && vm.slot[_currentScript].number == 95 && var == VAR_MUSIC_TIMER && b == 1708 && ConfMan.getBool("enable_enhancements")) {
 		b = 1815;
 	}
 


Commit: afb807599bf7dcb2986c8812b33a13ae3196f29c
    https://github.com/scummvm/scummvm/commit/afb807599bf7dcb2986c8812b33a13ae3196f29c
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-03-23T15:23:10+01:00

Commit Message:
SCUMM: Make palette effects in Mac b/w Loom / Last Crusade optional

Changed paths:
    engines/scumm/detection.cpp
    engines/scumm/gfx_mac.cpp


diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index b3afd1f391a..8b3e5801c02 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -229,7 +229,12 @@ const ExtraGuiOptions ScummMetaEngineDetection::getExtraGuiOptions(const Common:
 	const Common::String guiOptions = parseGameGUIOptions(guiOptionsString);
 	const Common::Platform platform = Common::parsePlatform(ConfMan.get("platform", target));
 
-	if (target.empty() || gameid == "monkey" || gameid == "monkey2" || gameid == "samnmax" || (gameid == "loom" && (extra == "VGA" || extra == "Steam"))) {
+	if (target.empty() ||
+		gameid == "monkey" ||
+		gameid == "monkey2" ||
+		gameid == "samnmax" ||
+		(gameid == "loom" && (extra == "VGA" || extra == "Steam")) ||
+		((gameid == "loom" || gameid == "indy3") && platform == Common::kPlatformMacintosh && extra != "Steam")) {
 		options.push_back(enableEnhancements);
 	}
 
diff --git a/engines/scumm/gfx_mac.cpp b/engines/scumm/gfx_mac.cpp
index 5abc3d2f525..e29f049bee5 100644
--- a/engines/scumm/gfx_mac.cpp
+++ b/engines/scumm/gfx_mac.cpp
@@ -20,6 +20,7 @@
  */
 
 #include "common/system.h"
+#include "common/config-manager.h"
 #include "graphics/macega.h"
 #include "scumm/actor.h"
 #include "scumm/charset.h"
@@ -51,9 +52,11 @@ void ScummEngine::mac_drawStripToScreen(VirtScreen *vs, int top, int x, int y, i
 	// unmodified. At least, that's what Mini vMac did when I tried it.
 
 	if (_renderMode == Common::kRenderMacintoshBW) {
+		bool enableEnhancements = ConfMan.getBool("enable_enhancements");
+
 		for (int h = 0; h < height; h++) {
 			for (int w = 0; w < width; w++) {
-				int color = _shadowPalette[pixels[w]];
+				int color = enableEnhancements ? _shadowPalette[pixels[w]] : pixels[w];
 				if (ts[2 * w] == CHARSET_MASK_TRANSPARENCY)
 					mac[2 * w] = Graphics::macEGADither[color][0];
 				if (ts[2 * w + 1] == CHARSET_MASK_TRANSPARENCY)


Commit: cb561f462edba4cdb529b32b387d1d290caf4866
    https://github.com/scummvm/scummvm/commit/cb561f462edba4cdb529b32b387d1d290caf4866
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-03-23T15:23:10+01:00

Commit Message:
SCUMM: Read the "enable_enhancements" setting only once

I can't change during gameplay, it's shorter to type, and we won't
accidentally involve the config manater in some tight loop.

Changed paths:
    engines/scumm/actor.cpp
    engines/scumm/gfx_mac.cpp
    engines/scumm/resource.cpp
    engines/scumm/script_v5.cpp
    engines/scumm/scumm.cpp
    engines/scumm/scumm.h
    engines/scumm/sound.cpp
    engines/scumm/string.cpp


diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index 40eec8a35de..d4eeae4212a 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -20,7 +20,6 @@
  */
 
 #include "common/system.h"	// for setFocusRectangle/clearFocusRectangle
-#include "common/config-manager.h"
 #include "scumm/scumm.h"
 #include "scumm/actor.h"
 #include "scumm/actor_he.h"
@@ -1610,7 +1609,7 @@ void Actor::putActor(int dstX, int dstY, int newRoom) {
 	// WORKAROUND: The green transparency of the tank in the Hall of Oddities
 	// is positioned one pixel too far to the left. This appears to be a bug
 	// in the original game as well.
-	if (_vm->_game.id == GID_SAMNMAX && newRoom == 16 && _number == 5 && dstX == 235 && dstY == 236 && ConfMan.getBool("enable_enhancements"))
+	if (_vm->_game.id == GID_SAMNMAX && newRoom == 16 && _number == 5 && dstX == 235 && dstY == 236 && _vm->_enableEnhancements)
 		dstX++;
 
 	_pos.x = dstX;
diff --git a/engines/scumm/gfx_mac.cpp b/engines/scumm/gfx_mac.cpp
index e29f049bee5..4ab0eadf4bc 100644
--- a/engines/scumm/gfx_mac.cpp
+++ b/engines/scumm/gfx_mac.cpp
@@ -20,7 +20,6 @@
  */
 
 #include "common/system.h"
-#include "common/config-manager.h"
 #include "graphics/macega.h"
 #include "scumm/actor.h"
 #include "scumm/charset.h"
@@ -52,11 +51,9 @@ void ScummEngine::mac_drawStripToScreen(VirtScreen *vs, int top, int x, int y, i
 	// unmodified. At least, that's what Mini vMac did when I tried it.
 
 	if (_renderMode == Common::kRenderMacintoshBW) {
-		bool enableEnhancements = ConfMan.getBool("enable_enhancements");
-
 		for (int h = 0; h < height; h++) {
 			for (int w = 0; w < width; w++) {
-				int color = enableEnhancements ? _shadowPalette[pixels[w]] : pixels[w];
+				int color = _enableEnhancements ? _shadowPalette[pixels[w]] : pixels[w];
 				if (ts[2 * w] == CHARSET_MASK_TRANSPARENCY)
 					mac[2 * w] = Graphics::macEGADither[color][0];
 				if (ts[2 * w + 1] == CHARSET_MASK_TRANSPARENCY)
diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp
index 0b5557ae86a..2edb08aaaed 100644
--- a/engines/scumm/resource.cpp
+++ b/engines/scumm/resource.cpp
@@ -1738,7 +1738,7 @@ void ScummEngine::applyWorkaroundIfNeeded(ResType type, int idx) {
 	// overwritten. This probably affects all CD versions, so we just have
 	// to add further patches as they are reported.
 
-	if (_game.id == GID_MONKEY && type == rtRoom && idx == 25 && ConfMan.getBool("enable_enhancements")) {
+	if (_game.id == GID_MONKEY && type == rtRoom && idx == 25 && _enableEnhancements) {
 		tryPatchMI1CannibalScript(getResourceAddress(type, idx), size);
 	} else
 
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index 575746d588b..d6e8ee24580 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -457,7 +457,7 @@ void ScummEngine_v5::o5_actorOps() {
 			// But in the VGA CD version, only costume 0 is used
 			// and the close-up is missing the cigar smoke.
 
-			if (_game.id == GID_MONKEY && _currentRoom == 76 && act == 12 && i == 0 && ConfMan.getBool("enable_enhancements")) {
+			if (_game.id == GID_MONKEY && _currentRoom == 76 && act == 12 && i == 0 && _enableEnhancements) {
 				i = 76;
 			}
 
@@ -670,7 +670,7 @@ void ScummEngine_v5::o5_add() {
 	// We restore the old behavior by adding 0, not 1, to the second
 	// variable when examining the clock tower.
 
-	if (_game.id == GID_MONKEY && vm.slot[_currentScript].number == 210 && _currentRoom == 35 && _resultVarNumber == 248 && a == 1 && ConfMan.getBool("enable_enhancements")) {
+	if (_game.id == GID_MONKEY && vm.slot[_currentScript].number == 210 && _currentRoom == 35 && _resultVarNumber == 248 && a == 1 && _enableEnhancements) {
 		a = 0;
 	}
 
@@ -1396,7 +1396,7 @@ void ScummEngine_v5::o5_isLessEqual() {
 	// together that they look like one. This adjusts the timing of the
 	// second one.
 
-	if (_game.id == GID_LOOM && _game.version >= 4 && _language == Common::EN_ANY && vm.slot[_currentScript].number == 95 && var == VAR_MUSIC_TIMER && b == 1708 && ConfMan.getBool("enable_enhancements")) {
+	if (_game.id == GID_LOOM && _game.version >= 4 && _language == Common::EN_ANY && vm.slot[_currentScript].number == 95 && var == VAR_MUSIC_TIMER && b == 1708 && _enableEnhancements) {
 		b = 1815;
 	}
 
@@ -1650,7 +1650,7 @@ void ScummEngine_v5::o5_putActor() {
 	// other coordinates. The difference is never more than a single pixel,
 	// so there's not much reason to correct those.
 
-	if (_game.id == GID_MONKEY && _currentRoom == 76 && act == 12 && ConfMan.getBool("enable_enhancements")) {
+	if (_game.id == GID_MONKEY && _currentRoom == 76 && act == 12 && _enableEnhancements) {
 		if (x == 176 && y == 80) {
 			x = 174;
 			y = 86;
@@ -1922,7 +1922,7 @@ void ScummEngine_v5::o5_roomOps() {
 			// we want the original color 3 for the cigar smoke. It
 			// should be ok since there is no GUI in this scene.
 
-			if (_game.id == GID_MONKEY && _currentRoom == 76 && d == 3 && ConfMan.getBool("enable_enhancements"))
+			if (_game.id == GID_MONKEY && _currentRoom == 76 && d == 3 && _enableEnhancements)
 				break;
 
 			setPalColor(d, a, b, c);	/* index, r, g, b */
@@ -2341,7 +2341,7 @@ void ScummEngine_v5::o5_stopSound() {
 	// 10001 regardless of which room it is. We figure out which one by
 	// looking at which rooms we're moving between.
 
-	if (_game.id == GID_MONKEY && (_game.features & GF_AUDIOTRACKS) && sound == 126 && vm.slot[_currentScript].number == 10001 && VAR(VAR_ROOM) == 43 && VAR(VAR_NEW_ROOM) == 76 && ConfMan.getBool("enable_enhancements")) {
+	if (_game.id == GID_MONKEY && (_game.features & GF_AUDIOTRACKS) && sound == 126 && vm.slot[_currentScript].number == 10001 && VAR(VAR_ROOM) == 43 && VAR(VAR_NEW_ROOM) == 76 && _enableEnhancements) {
 		return;
 	}
 
@@ -2977,7 +2977,7 @@ void ScummEngine_v5::decodeParseString() {
 		case 15:{	// SO_TEXTSTRING
 				const int len = resStrLen(_scriptPointer);
 
-				if (_game.id == GID_LOOM && vm.slot[_currentScript].number == 95 && strcmp((const char *)_scriptPointer, "I am Choas.") == 0 && ConfMan.getBool("enable_enhancements")) {
+				if (_game.id == GID_LOOM && vm.slot[_currentScript].number == 95 && _enableEnhancements && strcmp((const char *)_scriptPointer, "I am Choas.") == 0) {
 					// WORKAROUND: This happens when Chaos introduces
 					// herself to bishop Mandible. Of all the places to put
 					// a typo...
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index b26211766cb..eef5d9ecca0 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -109,7 +109,8 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 	  _currentScript(0xFF), // Let debug() work on init stage
 	  _messageDialog(nullptr), _pauseDialog(nullptr), _versionDialog(nullptr),
 	  _rnd("scumm"),
-	  _shakeTimerRate(dr.game.version <= 3 ? 236696 : 291304)
+	  _shakeTimerRate(dr.game.version <= 3 ? 236696 : 291304),
+	  _enableEnhancements(false)
 	  {
 
 	_localizer = nullptr;
@@ -1114,6 +1115,8 @@ Common::Error ScummEngine::init() {
 
 	const Common::FSNode gameDataDir(ConfMan.get("path"));
 
+	_enableEnhancements = ConfMan.getBool("enable_enhancements");
+
 	// Add default file directories.
 	if (((_game.platform == Common::kPlatformAmiga) || (_game.platform == Common::kPlatformAtariST)) && (_game.version <= 4)) {
 		// This is for the Amiga version of Indy3/Loom/Maniac/Zak
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 055d4aedd0b..74654fe5fbf 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -314,6 +314,8 @@ public:
 	/** Central resource data. */
 	ResourceManager *_res;
 
+	bool _enableEnhancements;
+
 protected:
 	VirtualMachineState vm;
 
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index b777fc6d1a1..f2c4a567920 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -1496,7 +1496,7 @@ int ScummEngine::readSoundResource(ResId idx) {
 				// Some of the Mac MI2 music only exists as Roland tracks. The
 				// original interpreter doesn't play them. I don't think there
 				// is any similarly missing FoA music.
-				if (_game.id == GID_MONKEY2 && _game.platform == Common::kPlatformMacintosh && !ConfMan.getBool("enable_enhancements")) {
+				if (_game.id == GID_MONKEY2 && _game.platform == Common::kPlatformMacintosh && !_enableEnhancements) {
 					pri = -1;
 					break;
 				}
diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp
index ce1c1147c63..84c98944ba1 100644
--- a/engines/scumm/string.cpp
+++ b/engines/scumm/string.cpp
@@ -68,7 +68,7 @@ void ScummEngine::printString(int m, const byte *msg) {
 			vm.slot[_currentScript].number == 203 &&
 			_actorToPrintStrFor == 255 && strcmp((const char *)msg, " ") == 0 &&
 			getOwner(200) == VAR(VAR_EGO) && VAR(VAR_HAVE_MSG) &&
-			ConfMan.getBool("enable_enhancements")) {
+			_enableEnhancements) {
 			return;
 		}
 


Commit: b66e84d57acb2187590ff445ae7908e6c69cd369
    https://github.com/scummvm/scummvm/commit/b66e84d57acb2187590ff445ae7908e6c69cd369
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-03-23T15:23:10+01:00

Commit Message:
SCUMM: Change "Use correct font spacing" to a game-specific enhancement

It doesn't make much sense to keep this as a separate option, when
fixing the font spacing is an enhancement specifically for the Mac
version of Indiana Jones and the Last Crusade.

Changed paths:
    engines/scumm/charset.cpp
    engines/scumm/charset.h
    engines/scumm/detection.cpp
    engines/scumm/scumm.cpp


diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index 89026ea0025..bfbe3ba94dd 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -1501,10 +1501,18 @@ void CharsetRendererPCE::setDrawCharIntern(uint16 chr) {
 }
 #endif
 
-CharsetRendererMac::CharsetRendererMac(ScummEngine *vm, const Common::String &fontFile, bool correctFontSpacing)
+CharsetRendererMac::CharsetRendererMac(ScummEngine *vm, const Common::String &fontFile)
 	 : CharsetRendererCommon(vm) {
 
-	_correctFontSpacing = correctFontSpacing;
+	// The original Macintosh interpreter didn't use the correct spacing
+	// between characters for some of the text, e.g. the Grail Diary. This
+	// appears to have been because of rounding errors, and was apparently
+	// fixed in Loom. Enabling this allows ScummVM to draw the text more
+	// correctly, at the cost of not matching the original quite as well.
+	// (At the time of writing, there are still cases, at least in Loom,
+	// where text isn't correctly positioned.)
+
+	_correctFontSpacing = _vm->_game.id == GID_LOOM || _vm->_enableEnhancements;
 	_pad = false;
 	_glyphSurface = nullptr;
 
diff --git a/engines/scumm/charset.h b/engines/scumm/charset.h
index 62b3bda56dd..d4116bc834c 100644
--- a/engines/scumm/charset.h
+++ b/engines/scumm/charset.h
@@ -293,7 +293,7 @@ protected:
 	Graphics::Surface *_glyphSurface;
 
 public:
-	CharsetRendererMac(ScummEngine *vm, const Common::String &fontFile, bool correctFontSpacing);
+	CharsetRendererMac(ScummEngine *vm, const Common::String &fontFile);
 	~CharsetRendererMac() override;
 
 	void setCurID(int32 id) override;
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index 8b3e5801c02..8ebf2287598 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -199,13 +199,6 @@ static const ExtraGuiOption macV3LowQualityMusic = {
 	false
 };
 
-static const ExtraGuiOption macV3CorrectFontSpacing = {
-	_s("Use correct font spacing"),
-	_s("Draw text with correct font spacing. This arguably looks better, but doesn't match the original behavior."),
-	"mac_v3_correct_font_spacing",
-	false
-};
-
 static const ExtraGuiOption smoothScrolling = {
 	_s("Enable smooth scrolling"),
 	_s("(instead of the normal 8-pixels steps scrolling)"),
@@ -261,18 +254,6 @@ const ExtraGuiOptions ScummMetaEngineDetection::getExtraGuiOptions(const Common:
 		options.push_back(macV3LowQualityMusic);
 	}
 
-	// The original Macintosh interpreter didn't use the correct spacing
-	// between characters for some of the text, e.g. the Grail Diary. This
-	// appears to have been because of rounding errors, and was apparently
-	// fixed in Loom. Enabling this setting allows ScummVM to draw the
-	// text more correctly, at the cost of not matching the original quite
-	// as well. (At the time of writing, there are still cases, at least in
-	// Loom, where text isn't correctly positioned.)
-
-	if (target.empty() || (gameid == "indy3" && platform == Common::kPlatformMacintosh && extra != "Steam")) {
-		options.push_back(macV3CorrectFontSpacing);
-	}
-
 	return options;
 }
 
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index eef5d9ecca0..f3833b69b2a 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1710,10 +1710,9 @@ void ScummEngine::setupCharsetRenderer(const Common::String &macFontFile) {
 #endif
 		if (_game.platform == Common::kPlatformFMTowns)
 			_charset = new CharsetRendererTownsV3(this);
-		else if (_game.platform == Common::kPlatformMacintosh && !macFontFile.empty()) {
-			bool correctFontSpacing = _game.id == GID_LOOM || ConfMan.getBool("mac_v3_correct_font_spacing");
-			_charset = new CharsetRendererMac(this, macFontFile, correctFontSpacing);
-		} else
+		else if (_game.platform == Common::kPlatformMacintosh && !macFontFile.empty())
+			_charset = new CharsetRendererMac(this, macFontFile);
+		else
 			_charset = new CharsetRendererV3(this);
 #ifdef ENABLE_SCUMM_7_8
 	} else if (_game.version == 8) {




More information about the Scummvm-git-logs mailing list