[Scummvm-git-logs] scummvm master -> 9d5b70d1d49aeaeea8983a3cc7db9c1a61bbbe1f

AndywinXp noreply at scummvm.org
Fri Aug 23 15:31:53 UTC 2024


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:
9d5b70d1d4 SWORD1: Add internal support for language switching


Commit: 9d5b70d1d49aeaeea8983a3cc7db9c1a61bbbe1f
    https://github.com/scummvm/scummvm/commit/9d5b70d1d49aeaeea8983a3cc7db9c1a61bbbe1f
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-08-23T17:31:48+02:00

Commit Message:
SWORD1: Add internal support for language switching

For now this is controllable only by setting e.g.:
subtitles_language_override=it
in the relevant [sword1] entry within scummvm.ini.

Changed paths:
    engines/sword1/sword1.cpp


diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp
index eddfc521c47..76b3eb77d23 100644
--- a/engines/sword1/sword1.cpp
+++ b/engines/sword1/sword1.cpp
@@ -124,7 +124,20 @@ Common::Error SwordEngine::init() {
 	_systemVars.fastMode = false;
 	_systemVars.parallaxOn = true;
 
-	switch (_systemVars.realLanguage) {
+	Common::Language langOverride = Common::UNK_LANG;
+
+	if (ConfMan.hasKey("subtitles_language_override", _targetName)) {
+		langOverride = Common::parseLanguage(ConfMan.get("subtitles_language_override"));
+
+		// Versions with extended language support have seven languages instead of five...
+		bool hasExtendedLangSupport = (_systemVars.realLanguage == Common::PT_BRA || _systemVars.realLanguage == Common::CS_CZE);
+
+		// ...but let's avoid setting one of the extra languages in a five-languages edition
+		if (!hasExtendedLangSupport && (langOverride == Common::PT_BRA || langOverride == Common::CS_CZE))
+			langOverride = Common::UNK_LANG;
+	}
+
+	switch (langOverride != Common::UNK_LANG ? langOverride : _systemVars.realLanguage) {
 	case Common::DE_DEU:
 		_systemVars.language = BS1_GERMAN;
 		break;




More information about the Scummvm-git-logs mailing list