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

neuromancer noreply at scummvm.org
Sat Sep 20 12:43:26 UTC 2025


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

Summary:
e48d4dbeb4 PRIVATE: make sure subtitle config is read directly from the common options


Commit: e48d4dbeb408b802ebac3a166028e8ced6db365f
    https://github.com/scummvm/scummvm/commit/e48d4dbeb408b802ebac3a166028e8ced6db365f
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2025-09-20T09:43:13-03:00

Commit Message:
PRIVATE: make sure subtitle config is read directly from the common options

Changed paths:
    engines/private/detection.cpp
    engines/private/detection.h
    engines/private/metaengine.cpp
    engines/private/private.cpp
    engines/private/private.h


diff --git a/engines/private/detection.cpp b/engines/private/detection.cpp
index 8bab26f24ac..445fe4c6367 100644
--- a/engines/private/detection.cpp
+++ b/engines/private/detection.cpp
@@ -48,7 +48,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::EN_USA,
 		Common::kPlatformWindows,
 		ADGF_NO_FLAGS,
-		GUIO3(GUIO_NOMIDI, GAMEOPTION_SUBTITLES, GAMEOPTION_SFX_SUBTITLES)
+		GUIO2(GUIO_NOMIDI, GAMEOPTION_SFX_SUBTITLES)
 	},
 	{
 		"private-eye", // Demo from the US release v1.0.0.23
@@ -58,7 +58,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::EN_USA,
 		Common::kPlatformWindows,
 		ADGF_DEMO,
-		GUIO3(GUIO_NOMIDI, GAMEOPTION_SUBTITLES, GAMEOPTION_SFX_SUBTITLES)
+		GUIO2(GUIO_NOMIDI, GAMEOPTION_SFX_SUBTITLES)
 	},
 	{
 		"private-eye",  // EU release (UK)
@@ -68,7 +68,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::EN_GRB,
 		Common::kPlatformWindows,
 		ADGF_NO_FLAGS,
-		GUIO3(GUIO_NOMIDI, GAMEOPTION_SUBTITLES, GAMEOPTION_SFX_SUBTITLES)
+		GUIO2(GUIO_NOMIDI, GAMEOPTION_SFX_SUBTITLES)
 	},
 	{
 		"private-eye", // Demo from the EU release
@@ -78,7 +78,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::EN_GRB,
 		Common::kPlatformWindows,
 		ADGF_DEMO,
-		GUIO3(GUIO_NOMIDI, GAMEOPTION_SUBTITLES, GAMEOPTION_SFX_SUBTITLES)
+		GUIO2(GUIO_NOMIDI, GAMEOPTION_SFX_SUBTITLES)
 	},
 	{
 		"private-eye", // Demo from PCGamer Disc 2.6 JULY 1996 v1.0.0.12
@@ -88,7 +88,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::EN_USA,
 		Common::kPlatformWindows,
 		ADGF_DEMO,
-		GUIO3(GUIO_NOMIDI, GAMEOPTION_SUBTITLES, GAMEOPTION_SFX_SUBTITLES)
+		GUIO2(GUIO_NOMIDI, GAMEOPTION_SFX_SUBTITLES)
 	},
 	{
 		"private-eye", // Another demo
@@ -98,7 +98,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::EN_USA,
 		Common::kPlatformWindows,
 		ADGF_DEMO,
-		GUIO3(GUIO_NOMIDI, GAMEOPTION_SUBTITLES, GAMEOPTION_SFX_SUBTITLES)
+		GUIO2(GUIO_NOMIDI, GAMEOPTION_SFX_SUBTITLES)
 	},
 	{
 		"private-eye", // EU release (ES)
@@ -108,7 +108,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::ES_ESP,
 		Common::kPlatformWindows,
 		ADGF_NO_FLAGS,
-		GUIO3(GUIO_NOMIDI, GAMEOPTION_SUBTITLES, GAMEOPTION_SFX_SUBTITLES)
+		GUIO2(GUIO_NOMIDI, GAMEOPTION_SFX_SUBTITLES)
 	},
 	{
 		"private-eye", // Demo from the EU release (ES)
@@ -118,7 +118,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::ES_ESP,
 		Common::kPlatformWindows,
 		ADGF_DEMO,
-		GUIO3(GUIO_NOMIDI, GAMEOPTION_SUBTITLES, GAMEOPTION_SFX_SUBTITLES)
+		GUIO2(GUIO_NOMIDI, GAMEOPTION_SFX_SUBTITLES)
 	},
 	{
 		"private-eye", // EU release (FR)
@@ -198,7 +198,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::EN_USA,
 		Common::kPlatformMacintosh,
 		ADGF_NO_FLAGS,
-		GUIO2(GUIO_NOMIDI, GAMEOPTION_SUBTITLES)
+		GUIO2(GUIO_NOMIDI, GAMEOPTION_SFX_SUBTITLES)
 	},
 	{
 		"private-eye", // MacOS release (US) uninstalled
@@ -226,7 +226,7 @@ static const ADGameDescription gameDescriptions[] = {
 		Common::EN_USA,
 		Common::kPlatformMacintosh,
 		ADGF_DEMO,
-		GUIO2(GUIO_NOMIDI, GAMEOPTION_SUBTITLES)
+		GUIO2(GUIO_NOMIDI, GAMEOPTION_SFX_SUBTITLES)
 	},
 	{
 		"private-eye", // MacOS demo (US) uninstalled
diff --git a/engines/private/detection.h b/engines/private/detection.h
index 1ddbc8ef4ae..3b0af3faad1 100644
--- a/engines/private/detection.h
+++ b/engines/private/detection.h
@@ -1,7 +1,6 @@
 #ifndef PRIVATE_DETECTION_H
 #define PRIVATE_DETECTION_H
 
-#define GAMEOPTION_SUBTITLES   GUIO_GAMEOPTIONS1
-#define GAMEOPTION_SFX_SUBTITLES GUIO_GAMEOPTIONS2
+#define GAMEOPTION_SFX_SUBTITLES GUIO_GAMEOPTIONS1
 
 #endif // PRIVATE_DETECTION_H
\ No newline at end of file
diff --git a/engines/private/metaengine.cpp b/engines/private/metaengine.cpp
index c009c00dff7..c12475a440c 100644
--- a/engines/private/metaengine.cpp
+++ b/engines/private/metaengine.cpp
@@ -31,22 +31,11 @@
 #include "backends/keymapper/standard-actions.h"
 
 static const ADExtraGuiOptionsMap optionsList[] = {
-	{
-		GAMEOPTION_SUBTITLES,
-		{
-			_s("Display subtitles"),
-			_s("Use subtitles."),
-			"subtitles",
-			true,
-			0,
-			0
-		}
-	},
 	{
 		GAMEOPTION_SFX_SUBTITLES,
 		{
 			_s("Display SFX subtitles"),
-			_s("Use SFX subtitles."),
+			_s("Use SFX subtitles (if subtitles are enabled)."),
 			"sfxSubtitles",
 			false,
 			0,
diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index e2fd5460173..b179d9eee68 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -52,7 +52,8 @@ extern int parse(const char *);
 PrivateEngine::PrivateEngine(OSystem *syst, const ADGameDescription *gd)
 	: Engine(syst), _gameDescription(gd), _image(nullptr), _videoDecoder(nullptr),
 	  _compositeSurface(nullptr), _transparentColor(0), _frameImage(nullptr),
-	  _framePalette(nullptr), _maxNumberClicks(0), _sirenWarning(0), _subtitles(nullptr), _sfxSubtitles(false),
+	  _framePalette(nullptr), _maxNumberClicks(0), _sirenWarning(0), 
+	  _subtitles(nullptr), _sfxSubtitles(false), _useSubtitles(false),
 	  _screenW(640), _screenH(480) {
 	_rnd = new Common::RandomSource("private");
 
@@ -201,14 +202,13 @@ Common::SeekableReadStream *PrivateEngine::loadAssets() {
 Common::Error PrivateEngine::run() {
 
 	// Only enable if subtitles are available
-	bool useSubtitles = false;
-	if (!Common::parseBool(ConfMan.get("subtitles"), useSubtitles))
+	if (!Common::parseBool(ConfMan.get("subtitles"), _useSubtitles))
 		warning("Failed to parse bool from subtitles options");
 
 	if (!Common::parseBool(ConfMan.get("sfxSubtitles"), _sfxSubtitles))
 		warning("Failed to parse bool from sfxSubtitles options");
 
-	if (useSubtitles) {
+	if (_useSubtitles) {
 		g_system->showOverlay(false);
 	} else if (_sfxSubtitles) {
 		warning("SFX subtitles are enabled, but no subtitles will be shown");
@@ -1513,6 +1513,9 @@ void PrivateEngine::adjustSubtitleSize() {
 
 void PrivateEngine::loadSubtitles(const Common::Path &path) {
 	debugC(1, kPrivateDebugFunction, "%s(%s)", __FUNCTION__, path.toString().c_str());
+	if (!_useSubtitles)
+		return;
+
 	Common::String subPathStr = path.toString() + ".srt";
 	subPathStr.toLowercase();
 	subPathStr.replace('/', '_');
diff --git a/engines/private/private.h b/engines/private/private.h
index 35385b81395..81f4e66a8e1 100644
--- a/engines/private/private.h
+++ b/engines/private/private.h
@@ -226,6 +226,7 @@ public:
 	void loadSubtitles(const Common::Path &path);
 	void adjustSubtitleSize();
 	Video::Subtitles *_subtitles;
+	bool _useSubtitles;
 	bool _sfxSubtitles;
 
 	Graphics::Surface *decodeImage(const Common::String &file, byte **palette);




More information about the Scummvm-git-logs mailing list