[Scummvm-git-logs] scummvm master -> 682330f8bd8f7bb8525a5835c9018d69279f4b53

sev- noreply at scummvm.org
Fri Jun 3 19:04:01 UTC 2022


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

Summary:
6a040e3ea2 SCUMM: Add adjustment sliders for VGA Loom (CD) and MI1 (CD)
682330f8bd SCUMM: Remove adjustment setting from MI1 SE Talkie


Commit: 6a040e3ea22a93b3c52710c41aabbf499b63a9dd
    https://github.com/scummvm/scummvm/commit/6a040e3ea22a93b3c52710c41aabbf499b63a9dd
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-06-03T21:03:58+02:00

Commit Message:
SCUMM: Add adjustment sliders for VGA Loom (CD) and MI1 (CD)

When ripping the audio tracks from CD, you may not get quite what the
game expects, e.g. my copy of Loom has less silence at the start of the
track than the CDDA.SOU file from the Steam version. And the MI1 intro
appears to be timed with the assumption that there is no silence at all
at the start of that track.

This makes it possible to compensate for that without having to edit the
audio file. It may also be of some help with fan soundtrack replacements
for MI1, though I have little experience with that.

Changed paths:
    engines/scumm/dialogs.cpp
    engines/scumm/dialogs.h
    engines/scumm/metaengine.cpp
    engines/scumm/script_v5.cpp
    engines/scumm/sound.cpp


diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index a5bd71f0b10..692533cac8a 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -699,8 +699,34 @@ void LoomTownsDifficultyDialog::handleCommand(GUI::CommandSender *sender, uint32
 	}
 }
 
+// Game options widgets
+
+// Normally this would be added as a static game settings widget, but I see no
+// way to get both the dynamic and the static one, so we have to duplicate it
+// here.
+
+GUI::CheckboxWidget *ScummOptionsContainerWidget::createEnhancementsCheckbox(GuiObject *boss, const Common::String &name) {
+	return new GUI::CheckboxWidget(boss, name, _("Enable game-specific enhancements"), _("Allow ScummVM to make small enhancements to the game, usually based on other versions of the same game."));
+}
+
+void ScummOptionsContainerWidget::updateAdjustmentSlider(GUI::SliderWidget *slider, GUI::StaticTextWidget *value) {
+	int adjustment = slider->getValue();
+	const char *sign = "";
+
+	if (adjustment < 0) {
+		adjustment = -adjustment;
+		sign = "-";
+	} else if (adjustment > 0)
+		sign = "+";
+
+	value->setLabel(Common::String::format("%s%d.%02d", sign, adjustment / 100, adjustment % 100));
+
+}
+
+// EGA Loom Overture settings
+
 LoomEgaGameOptionsWidget::LoomEgaGameOptionsWidget(GuiObject *boss, const Common::String &name, const Common::String &domain) :
-		OptionsContainerWidget(boss, name, "LoomEgaGameOptionsDialog", false, domain) {
+		ScummOptionsContainerWidget(boss, name, "LoomEgaGameOptionsDialog", domain) {
 	GUI::StaticTextWidget *text = new GUI::StaticTextWidget(widgetsBoss(), "LoomEgaGameOptionsDialog.OvertureTicksLabel", _("Overture Timing:"));
 
 	text->setAlign(Graphics::TextAlign::kTextAlignEnd);
@@ -723,11 +749,7 @@ LoomEgaGameOptionsWidget::LoomEgaGameOptionsWidget(GuiObject *boss, const Common
 
 	_overtureTicksValue->setFlags(GUI::WIDGET_CLEARBG);
 
-	// Normally this would be added as a static game settings widget, but
-	// I see no way to get both the dynamic and the static one, so we have
-	// to duplicate it here.
-
-	_enableEnhancements = new GUI::CheckboxWidget(widgetsBoss(), "LoomEgaGameOptionsDialog.EnableEnhancements", _("Enable game-specific enhancements"), _("Allow ScummVM to make small enhancements to the game, usually based on other versions of the same game."));
+	_enableEnhancementsCheckbox = createEnhancementsCheckbox(widgetsBoss(), "LoomEgaGameOptionsDialog.EnableEnhancements");
 }
 
 void LoomEgaGameOptionsWidget::load() {
@@ -739,12 +761,12 @@ void LoomEgaGameOptionsWidget::load() {
 	_overtureTicksSlider->setValue(loomOvertureTicks);
 	updateOvertureTicksValue();
 
-	_enableEnhancements->setState(ConfMan.getBool("enable_enhancements", _domain));
+	_enableEnhancementsCheckbox->setState(ConfMan.getBool("enable_enhancements", _domain));
 }
 
 bool LoomEgaGameOptionsWidget::save() {
 	ConfMan.setInt("loom_overture_ticks", _overtureTicksSlider->getValue(), _domain);
-	ConfMan.setBool("enable_enhancements", _enableEnhancements->getState(), _domain);
+	ConfMan.setBool("enable_enhancements", _enableEnhancementsCheckbox->getState(), _domain);
 	return true;
 }
 
@@ -781,4 +803,204 @@ void LoomEgaGameOptionsWidget::updateOvertureTicksValue() {
 	_overtureTicksValue->setLabel(Common::String::format("%d:%02d.%d", ticks / 600, (ticks % 600) / 10, ticks % 10));
 }
 
+// VGA Loom Playback Adjustment settings
+
+LoomVgaGameOptionsWidget::LoomVgaGameOptionsWidget(GuiObject *boss, const Common::String &name, const Common::String &domain) :
+		ScummOptionsContainerWidget(boss, name, "LoomVgaGameOptionsDialog", domain) {
+	GUI::StaticTextWidget *text = new GUI::StaticTextWidget(widgetsBoss(), "LoomVgaGameOptionsDialog.PlaybackAdjustmentLabel", _("Playback Adjust:"));
+
+	text->setAlign(Graphics::TextAlign::kTextAlignEnd);
+
+	_playbackAdjustmentSlider = new GUI::SliderWidget(widgetsBoss(), "LoomVgaGameOptionsDialog.PlaybackAdjustment", _("When playing sound from the CD audio track, adjust the start position of the sound by this much. Use this if you often hear bits of the wrong sound."), kPlaybackAdjustmentChanged);
+
+	// The first sound in the track is played from frame 22. It's not
+	// possible to move that more than about 0.3 seconds towards zero.
+	// Everything else can be moved by as much as two seconds in each
+	// direction.
+
+	_playbackAdjustmentSlider->setMinValue(-200);
+	_playbackAdjustmentSlider->setMaxValue(200);
+
+	_playbackAdjustmentValue = new GUI::StaticTextWidget(widgetsBoss(), "LoomVgaGameOptionsDialog.PlaybackAdjustmentValue", Common::U32String());
+
+	_playbackAdjustmentValue->setFlags(GUI::WIDGET_CLEARBG);
+
+	_enableEnhancementsCheckbox = createEnhancementsCheckbox(widgetsBoss(), "LoomVgaGameOptionsDialog.EnableEnhancements");
+}
+
+void LoomVgaGameOptionsWidget::load() {
+	int playbackAdjustment = 0;
+
+	if (ConfMan.hasKey("loom_playback_adjustment", _domain))
+		playbackAdjustment = ConfMan.getInt("loom_playback_adjustment", _domain);
+
+	_playbackAdjustmentSlider->setValue(playbackAdjustment);
+	updatePlaybackAdjustmentValue();
+
+	_enableEnhancementsCheckbox->setState(ConfMan.getBool("enable_enhancements", _domain));
+}
+
+bool LoomVgaGameOptionsWidget::save() {
+	ConfMan.setInt("loom_playback_adjustment", _playbackAdjustmentSlider->getValue(), _domain);
+	ConfMan.setBool("enable_enhancements", _enableEnhancementsCheckbox->getState(), _domain);
+	return true;
+}
+
+void LoomVgaGameOptionsWidget::defineLayout(GUI::ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const {
+	layouts.addDialog(layoutName, overlayedLayout)
+		.addLayout(GUI::ThemeLayout::kLayoutVertical, 12)
+			.addPadding(0, 0, 0, 0)
+			.addLayout(GUI::ThemeLayout::kLayoutHorizontal, 12)
+				.addPadding(0, 0, 12, 0)
+				.addWidget("PlaybackAdjustmentLabel", "OptionsLabel")
+				.addWidget("PlaybackAdjustment", "WideSlider")
+				.addWidget("PlaybackAdjustmentValue", "ShortOptionsLabel")
+			.closeLayout()
+			.addWidget("EnableEnhancements", "Checkbox")
+		.closeLayout()
+	.closeDialog();
+}
+
+void LoomVgaGameOptionsWidget::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {
+
+	switch (cmd) {
+	case kPlaybackAdjustmentChanged:
+		updatePlaybackAdjustmentValue();
+		break;
+	default:
+		GUI::OptionsContainerWidget::handleCommand(sender, cmd, data);
+		break;
+	}
+}
+
+void LoomVgaGameOptionsWidget::updatePlaybackAdjustmentValue() {
+	updateAdjustmentSlider(_playbackAdjustmentSlider, _playbackAdjustmentValue);
+}
+
+// MI1 (CD) Playback Adjustment settings
+
+MI1CdGameOptionsWidget::MI1CdGameOptionsWidget(GuiObject *boss, const Common::String &name, const Common::String &domain) :
+		ScummOptionsContainerWidget(boss, name, "MI1CdGameOptionsDialog", domain) {
+	Common::String extra = ConfMan.get("extra", domain);
+
+	GUI::StaticTextWidget *text = new GUI::StaticTextWidget(widgetsBoss(), "MI1CdGameOptionsDialog.IntroAdjustmentLabel", _("Intro Adjust:"));
+
+	text->setAlign(Graphics::TextAlign::kTextAlignEnd);
+
+	_introAdjustmentSlider = new GUI::SliderWidget(widgetsBoss(), "MI1CdGameOptionsDialog.IntroAdjustment", _("When playing the intro track, play from this point in it. Use this if the music gets cut off prematurely, or if you are unhappy with the way the music syncs up with the intro."), kIntroAdjustmentChanged);
+
+	_introAdjustmentSlider->setMinValue(0);
+	_introAdjustmentSlider->setMaxValue(200);
+
+	_introAdjustmentValue = new GUI::StaticTextWidget(widgetsBoss(), "MI1CdGameOptionsDialog.IntroAdjustmentValue", Common::U32String());
+
+	_introAdjustmentValue->setFlags(GUI::WIDGET_CLEARBG);
+
+	// The unofficial talkie version has a separate track for the outlook
+	// music, and does its own enhancements through script patching.
+
+	if (!extra.contains("SE Talkie")) {
+		text = new GUI::StaticTextWidget(widgetsBoss(), "MI1CdGameOptionsDialog.OutlookAdjustmentLabel", _("Outlook Adjust:"));
+
+		text->setAlign(Graphics::TextAlign::kTextAlignEnd);
+
+		_outlookAdjustmentSlider = new GUI::SliderWidget(widgetsBoss(), "MI1CdGameOptionsDialog.OutlookAdjustment", _("The outlook music is part of the intro track. Adjust the position in the track at which it starts playing. Use this if the music is cut off, or if you hear part of the previous music."), kOutlookAdjustmentChanged);
+
+		_outlookAdjustmentSlider->setMinValue(-200);
+		_outlookAdjustmentSlider->setMaxValue(200);
+
+		_outlookAdjustmentValue = new GUI::StaticTextWidget(widgetsBoss(), "MI1CdGameOptionsDialog.OutlookAdjustmentValue", Common::U32String());
+
+		_outlookAdjustmentValue->setFlags(GUI::WIDGET_CLEARBG);
+
+		_enableEnhancementsCheckbox = createEnhancementsCheckbox(widgetsBoss(), "MI1CdGameOptionsDialog.EnableEnhancements");
+	} else {
+		_outlookAdjustmentSlider = nullptr;
+		_outlookAdjustmentValue = nullptr;
+		_enableEnhancementsCheckbox = nullptr;
+	}
+}
+
+void MI1CdGameOptionsWidget::load() {
+	int introAdjustment = 0;
+	int outlookAdjustment = 0;
+
+	if (ConfMan.hasKey("mi1_intro_adjustment", _domain))
+		introAdjustment = ConfMan.getInt("mi1_intro_adjustment", _domain);
+	_introAdjustmentSlider->setValue(introAdjustment);
+	updateIntroAdjustmentValue();
+
+	if (_outlookAdjustmentSlider) {
+		if (ConfMan.hasKey("mi1_outlook_adjustment", _domain))
+			outlookAdjustment = ConfMan.getInt("mi1_outlook_adjustment", _domain);
+
+		_outlookAdjustmentSlider->setValue(outlookAdjustment);
+		updateOutlookAdjustmentValue();
+	}
+
+	if (_enableEnhancementsCheckbox)
+		_enableEnhancementsCheckbox->setState(ConfMan.getBool("enable_enhancements", _domain));
+}
+
+bool MI1CdGameOptionsWidget::save() {
+	ConfMan.setInt("mi1_intro_adjustment", _introAdjustmentSlider->getValue(), _domain);
+
+	if (_outlookAdjustmentSlider)
+		ConfMan.setInt("mi1_outlook_adjustment", _outlookAdjustmentSlider->getValue(), _domain);
+
+	if (_enableEnhancementsCheckbox)
+		ConfMan.setBool("enable_enhancements", _enableEnhancementsCheckbox->getState(), _domain);
+
+	return true;
+}
+
+void MI1CdGameOptionsWidget::defineLayout(GUI::ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const {
+	layouts.addDialog(layoutName, overlayedLayout)
+		.addLayout(GUI::ThemeLayout::kLayoutVertical, 12)
+			.addPadding(0, 0, 0, 0)
+			.addLayout(GUI::ThemeLayout::kLayoutHorizontal, 12)
+				.addPadding(0, 0, 12, 0)
+				.addWidget("IntroAdjustmentLabel", "OptionsLabel")
+				.addWidget("IntroAdjustment", "WideSlider")
+				.addWidget("IntroAdjustmentValue", "ShortOptionsLabel")
+			.closeLayout();
+
+	if (_outlookAdjustmentSlider) {
+		layouts.addLayout(GUI::ThemeLayout::kLayoutHorizontal, 12)
+			.addPadding(0, 0, 0, 0)
+			.addWidget("OutlookAdjustmentLabel", "OptionsLabel")
+			.addWidget("OutlookAdjustment", "WideSlider")
+			.addWidget("OutlookAdjustmentValue", "ShortOptionsLabel")
+		.closeLayout();
+	}
+
+	if (_enableEnhancementsCheckbox)
+		layouts.addWidget("EnableEnhancements", "Checkbox");
+
+	layouts.closeLayout().closeDialog();
+}
+
+void MI1CdGameOptionsWidget::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {
+
+	switch (cmd) {
+	case kIntroAdjustmentChanged:
+		updateIntroAdjustmentValue();
+		break;
+	case kOutlookAdjustmentChanged:
+		updateOutlookAdjustmentValue();
+		break;
+	default:
+		GUI::OptionsContainerWidget::handleCommand(sender, cmd, data);
+		break;
+	}
+}
+
+void MI1CdGameOptionsWidget::updateIntroAdjustmentValue() {
+	updateAdjustmentSlider(_introAdjustmentSlider, _introAdjustmentValue);
+}
+
+void MI1CdGameOptionsWidget::updateOutlookAdjustmentValue() {
+	updateAdjustmentSlider(_outlookAdjustmentSlider, _outlookAdjustmentValue);
+}
+
 } // End of namespace Scumm
diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h
index a6016b623ce..8edbbb870ef 100644
--- a/engines/scumm/dialogs.h
+++ b/engines/scumm/dialogs.h
@@ -209,10 +209,23 @@ private:
 	int _difficulty;
 };
 
+/**
+ * Common options widget stuff.
+ */
+class ScummOptionsContainerWidget : public GUI::OptionsContainerWidget {
+public:
+	ScummOptionsContainerWidget(GuiObject *boss, const Common::String &name, const Common::String &dialogLayout, const Common::String &domain) :
+		OptionsContainerWidget(boss, name, dialogLayout, false, domain) {
+	}
+
+	GUI::CheckboxWidget *createEnhancementsCheckbox(GuiObject *boss, const Common::String &name);
+	void updateAdjustmentSlider(GUI::SliderWidget *slider, GUI::StaticTextWidget *value);
+};
+
 /**
  * Options widget for EGA Loom.
  */
-class LoomEgaGameOptionsWidget : public GUI::OptionsContainerWidget {
+class LoomEgaGameOptionsWidget : public ScummOptionsContainerWidget {
 public:
 	LoomEgaGameOptionsWidget(GuiObject *boss, const Common::String &name, const Common::String &domain);
 	~LoomEgaGameOptionsWidget() override {};
@@ -228,13 +241,69 @@ private:
 	void defineLayout(GUI::ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const override;
 	void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
 
-	GUI::CheckboxWidget *_enableEnhancements;
+	GUI::CheckboxWidget *_enableEnhancementsCheckbox;
 	GUI::SliderWidget *_overtureTicksSlider;
 	GUI::StaticTextWidget *_overtureTicksValue;
 
 	void updateOvertureTicksValue();
 };
 
+/**
+ * Options widget for VGA Loom (DOS CD).
+ */
+class LoomVgaGameOptionsWidget : public ScummOptionsContainerWidget {
+public:
+	LoomVgaGameOptionsWidget(GuiObject *boss, const Common::String &name, const Common::String &domain);
+	~LoomVgaGameOptionsWidget() override {};
+
+	void load() override;
+	bool save() override;
+
+private:
+	enum {
+		kPlaybackAdjustmentChanged = 'PBAC'
+	};
+
+	void defineLayout(GUI::ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const override;
+	void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
+
+	GUI::CheckboxWidget *_enableEnhancementsCheckbox;
+	GUI::SliderWidget *_playbackAdjustmentSlider;
+	GUI::StaticTextWidget *_playbackAdjustmentValue;
+
+	void updatePlaybackAdjustmentValue();
+};
+
+/**
+ * Options widget for CD Monkey Island 1.
+ */
+class MI1CdGameOptionsWidget : public ScummOptionsContainerWidget {
+public:
+	MI1CdGameOptionsWidget(GuiObject *boss, const Common::String &name, const Common::String &domain);
+	~MI1CdGameOptionsWidget() override {};
+
+	void load() override;
+	bool save() override;
+
+private:
+	enum {
+		kIntroAdjustmentChanged = 'IACH',
+		kOutlookAdjustmentChanged = 'OACH'
+	};
+
+	void defineLayout(GUI::ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const override;
+	void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
+
+	GUI::CheckboxWidget *_enableEnhancementsCheckbox;
+	GUI::SliderWidget *_introAdjustmentSlider;
+	GUI::StaticTextWidget *_introAdjustmentValue;
+	GUI::SliderWidget *_outlookAdjustmentSlider;
+	GUI::StaticTextWidget *_outlookAdjustmentValue;
+
+	void updateIntroAdjustmentValue();
+	void updateOutlookAdjustmentValue();
+};
+
 } // End of namespace Scumm
 
 #endif
diff --git a/engines/scumm/metaengine.cpp b/engines/scumm/metaengine.cpp
index 998774f6161..b6e7452cab0 100644
--- a/engines/scumm/metaengine.cpp
+++ b/engines/scumm/metaengine.cpp
@@ -530,22 +530,36 @@ SaveStateDescriptor ScummMetaEngine::querySaveMetaInfos(const char *target, int
 }
 
 GUI::OptionsContainerWidget *ScummMetaEngine::buildEngineOptionsWidgetDynamic(GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const {
-	if (ConfMan.get("gameid", target) != "loom")
-		return nullptr;
+	Common::String gameid = ConfMan.get("gameid", target);
+	Common::String extra = ConfMan.get("extra", target);
 
-	// These Loom settings are only relevant for the EGA version, since
-	// that is the only one that has an overture.
+	if (gameid == "loom") {
+		Common::Platform platform = Common::parsePlatform(ConfMan.get("platform", target));
+		if (platform != Common::kPlatformUnknown && platform != Common::kPlatformDOS)
+			return nullptr;
 
-	Common::Platform platform = Common::parsePlatform(ConfMan.get("platform", target));
-	if (platform != Common::kPlatformUnknown && platform != Common::kPlatformDOS)
-		return nullptr;
+		// The VGA Loom settings are only relevant for the DOS CD
+		// version, not the Steam version (which is assumed to be well
+		// timed already).
 
-	Common::String extra = ConfMan.get("extra", target);
+		if (extra == "VGA")
+			return new Scumm::LoomVgaGameOptionsWidget(boss, name, target);
+
+		if (extra == "Steam")
+			return nullptr;
 
-	if (extra == "Steam" || extra == "VGA")
-		return nullptr;
+		// These EGA Loom settings are only relevant for the EGA
+		// version, since that is the only one that has an overture.
+
+		return new Scumm::LoomEgaGameOptionsWidget(boss, name, target);
+	} else if (gameid == "monkey") {
+		if (extra != "CD" && extra != "FM-TOWNS" && extra != "SEGA" && !extra.contains("SE Talkie"))
+			return nullptr;
+
+		return new Scumm::MI1CdGameOptionsWidget(boss, name, target);
+	}
 
-	return new Scumm::LoomEgaGameOptionsWidget(boss, name, target);
+	return nullptr;
 }
 
 #if PLUGIN_ENABLED_DYNAMIC(SCUMM)
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index fdb53f49573..265d50c171d 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -3073,11 +3073,19 @@ void ScummEngine_v5::decodeParseString() {
 						// I.e. in total 22650 frames.
 						offset = (int)(offset * 7.5 - 22500 - 2*75);
 
+						// Add the user-specified adjustment.
+						if (ConfMan.hasKey("loom_playback_adjustment")) {
+							int adjustment = ConfMan.getInt("loom_playback_adjustment");
+							offset += ((75 * adjustment) / 100);
+							if (offset < 0)
+								offset = 0;
+						}
+
 						// Slightly increase the delay (5 frames = 1/25 of a second).
 						// This noticably improves the experience in Loom CD.
 						delay = (int)(delay * 7.5 + 5);
 
-						_sound->playCDTrack(1, 0, offset, delay);
+						_sound->playCDTrack(1, 1, offset, delay);
 					}
 				} else {
 					error("ScummEngine_v5::decodeParseString: Unhandled case 8");
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index 294bf6333b9..fbbe2f2d7a2 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -519,6 +519,13 @@ void Sound::playSound(int soundID) {
 			int start = (ptr[2] * 60 + ptr[3]) * 75 + ptr[4];
 			int end = (ptr[5] * 60 + ptr[6]) * 75 + ptr[7];
 
+			// Add the user-specified adjustments.
+			if (_vm->_game.id == GID_MONKEY && track == 17) {
+				int adjustment = ConfMan.getInt(start == 0 ? "mi1_intro_adjustment" : "mi1_outlook_adjustment");
+
+				start += ((75 * adjustment) / 100);
+			}
+
 			playCDTrack(track, loops == 0xff ? -1 : loops, start, end <= start ? 0 : end - start);
 			_currentCDSound = soundID;
 		} else {


Commit: 682330f8bd8f7bb8525a5835c9018d69279f4b53
    https://github.com/scummvm/scummvm/commit/682330f8bd8f7bb8525a5835c9018d69279f4b53
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-06-03T21:03:58+02:00

Commit Message:
SCUMM: Remove adjustment setting from MI1 SE Talkie

The tracks built for the SE Talkie already have little to no silence at
the beginning, and the outlook has its own separate track instead of a
continuation of the first one.

That means the settings are of limited use here, and removing them
simplifies the code.

Changed paths:
    engines/scumm/dialogs.cpp
    engines/scumm/metaengine.cpp


diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index 692533cac8a..fe9271bdd50 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -896,29 +896,20 @@ MI1CdGameOptionsWidget::MI1CdGameOptionsWidget(GuiObject *boss, const Common::St
 
 	_introAdjustmentValue->setFlags(GUI::WIDGET_CLEARBG);
 
-	// The unofficial talkie version has a separate track for the outlook
-	// music, and does its own enhancements through script patching.
+	text = new GUI::StaticTextWidget(widgetsBoss(), "MI1CdGameOptionsDialog.OutlookAdjustmentLabel", _("Outlook Adjust:"));
 
-	if (!extra.contains("SE Talkie")) {
-		text = new GUI::StaticTextWidget(widgetsBoss(), "MI1CdGameOptionsDialog.OutlookAdjustmentLabel", _("Outlook Adjust:"));
-
-		text->setAlign(Graphics::TextAlign::kTextAlignEnd);
+	text->setAlign(Graphics::TextAlign::kTextAlignEnd);
 
-		_outlookAdjustmentSlider = new GUI::SliderWidget(widgetsBoss(), "MI1CdGameOptionsDialog.OutlookAdjustment", _("The outlook music is part of the intro track. Adjust the position in the track at which it starts playing. Use this if the music is cut off, or if you hear part of the previous music."), kOutlookAdjustmentChanged);
+	_outlookAdjustmentSlider = new GUI::SliderWidget(widgetsBoss(), "MI1CdGameOptionsDialog.OutlookAdjustment", _("The outlook music is part of the intro track. Adjust the position in the track at which it starts playing. Use this if the music is cut off, or if you hear part of the previous music."), kOutlookAdjustmentChanged);
 
-		_outlookAdjustmentSlider->setMinValue(-200);
-		_outlookAdjustmentSlider->setMaxValue(200);
+	_outlookAdjustmentSlider->setMinValue(-200);
+	_outlookAdjustmentSlider->setMaxValue(200);
 
-		_outlookAdjustmentValue = new GUI::StaticTextWidget(widgetsBoss(), "MI1CdGameOptionsDialog.OutlookAdjustmentValue", Common::U32String());
+	_outlookAdjustmentValue = new GUI::StaticTextWidget(widgetsBoss(), "MI1CdGameOptionsDialog.OutlookAdjustmentValue", Common::U32String());
 
-		_outlookAdjustmentValue->setFlags(GUI::WIDGET_CLEARBG);
+	_outlookAdjustmentValue->setFlags(GUI::WIDGET_CLEARBG);
 
-		_enableEnhancementsCheckbox = createEnhancementsCheckbox(widgetsBoss(), "MI1CdGameOptionsDialog.EnableEnhancements");
-	} else {
-		_outlookAdjustmentSlider = nullptr;
-		_outlookAdjustmentValue = nullptr;
-		_enableEnhancementsCheckbox = nullptr;
-	}
+	_enableEnhancementsCheckbox = createEnhancementsCheckbox(widgetsBoss(), "MI1CdGameOptionsDialog.EnableEnhancements");
 }
 
 void MI1CdGameOptionsWidget::load() {
@@ -930,27 +921,19 @@ void MI1CdGameOptionsWidget::load() {
 	_introAdjustmentSlider->setValue(introAdjustment);
 	updateIntroAdjustmentValue();
 
-	if (_outlookAdjustmentSlider) {
-		if (ConfMan.hasKey("mi1_outlook_adjustment", _domain))
-			outlookAdjustment = ConfMan.getInt("mi1_outlook_adjustment", _domain);
+	if (ConfMan.hasKey("mi1_outlook_adjustment", _domain))
+		outlookAdjustment = ConfMan.getInt("mi1_outlook_adjustment", _domain);
 
-		_outlookAdjustmentSlider->setValue(outlookAdjustment);
-		updateOutlookAdjustmentValue();
-	}
+	_outlookAdjustmentSlider->setValue(outlookAdjustment);
+	updateOutlookAdjustmentValue();
 
-	if (_enableEnhancementsCheckbox)
-		_enableEnhancementsCheckbox->setState(ConfMan.getBool("enable_enhancements", _domain));
+	_enableEnhancementsCheckbox->setState(ConfMan.getBool("enable_enhancements", _domain));
 }
 
 bool MI1CdGameOptionsWidget::save() {
 	ConfMan.setInt("mi1_intro_adjustment", _introAdjustmentSlider->getValue(), _domain);
-
-	if (_outlookAdjustmentSlider)
-		ConfMan.setInt("mi1_outlook_adjustment", _outlookAdjustmentSlider->getValue(), _domain);
-
-	if (_enableEnhancementsCheckbox)
-		ConfMan.setBool("enable_enhancements", _enableEnhancementsCheckbox->getState(), _domain);
-
+	ConfMan.setInt("mi1_outlook_adjustment", _outlookAdjustmentSlider->getValue(), _domain);
+	ConfMan.setBool("enable_enhancements", _enableEnhancementsCheckbox->getState(), _domain);
 	return true;
 }
 
@@ -963,21 +946,16 @@ void MI1CdGameOptionsWidget::defineLayout(GUI::ThemeEval &layouts, const Common:
 				.addWidget("IntroAdjustmentLabel", "OptionsLabel")
 				.addWidget("IntroAdjustment", "WideSlider")
 				.addWidget("IntroAdjustmentValue", "ShortOptionsLabel")
-			.closeLayout();
-
-	if (_outlookAdjustmentSlider) {
-		layouts.addLayout(GUI::ThemeLayout::kLayoutHorizontal, 12)
-			.addPadding(0, 0, 0, 0)
-			.addWidget("OutlookAdjustmentLabel", "OptionsLabel")
-			.addWidget("OutlookAdjustment", "WideSlider")
-			.addWidget("OutlookAdjustmentValue", "ShortOptionsLabel")
-		.closeLayout();
-	}
-
-	if (_enableEnhancementsCheckbox)
-		layouts.addWidget("EnableEnhancements", "Checkbox");
-
-	layouts.closeLayout().closeDialog();
+			.closeLayout()
+			.addLayout(GUI::ThemeLayout::kLayoutHorizontal, 12)
+				.addPadding(0, 0, 0, 0)
+				.addWidget("OutlookAdjustmentLabel", "OptionsLabel")
+				.addWidget("OutlookAdjustment", "WideSlider")
+				.addWidget("OutlookAdjustmentValue", "ShortOptionsLabel")
+			.closeLayout()
+			.addWidget("EnableEnhancements", "Checkbox")
+		.closeLayout()
+	.closeDialog();
 }
 
 void MI1CdGameOptionsWidget::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {
diff --git a/engines/scumm/metaengine.cpp b/engines/scumm/metaengine.cpp
index b6e7452cab0..f646957ceb8 100644
--- a/engines/scumm/metaengine.cpp
+++ b/engines/scumm/metaengine.cpp
@@ -553,7 +553,7 @@ GUI::OptionsContainerWidget *ScummMetaEngine::buildEngineOptionsWidgetDynamic(GU
 
 		return new Scumm::LoomEgaGameOptionsWidget(boss, name, target);
 	} else if (gameid == "monkey") {
-		if (extra != "CD" && extra != "FM-TOWNS" && extra != "SEGA" && !extra.contains("SE Talkie"))
+		if (extra != "CD" && extra != "FM-TOWNS" && extra != "SEGA")
 			return nullptr;
 
 		return new Scumm::MI1CdGameOptionsWidget(boss, name, target);




More information about the Scummvm-git-logs mailing list