[Scummvm-cvs-logs] SF.net SVN: scummvm: [32858] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Tue Jul 1 01:39:56 CEST 2008


Revision: 32858
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32858&view=rev
Author:   lordhoto
Date:     2008-06-30 16:39:56 -0700 (Mon, 30 Jun 2008)

Log Message:
-----------
Added support for Spanish fan translation of kyra3 (See fr #1994040 "KYRA3: Add support for Spanish fan translation").

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/detection.cpp
    scummvm/trunk/engines/kyra/kyra_hof.cpp
    scummvm/trunk/engines/kyra/kyra_mr.cpp
    scummvm/trunk/engines/kyra/kyra_v1.cpp
    scummvm/trunk/engines/kyra/kyra_v1.h
    scummvm/trunk/engines/kyra/kyra_v2.cpp
    scummvm/trunk/engines/kyra/kyra_v2.h

Modified: scummvm/trunk/engines/kyra/detection.cpp
===================================================================
--- scummvm/trunk/engines/kyra/detection.cpp	2008-06-30 23:06:38 UTC (rev 32857)
+++ scummvm/trunk/engines/kyra/detection.cpp	2008-06-30 23:39:56 UTC (rev 32858)
@@ -41,7 +41,8 @@
 
 namespace {
 
-#define FLAGS(x, y, z, a, b, c, id) { Common::UNK_LANG, Common::kPlatformUnknown, x, y, z, a, b, c, id }
+#define FLAGS(x, y, z, a, b, c, id) { Common::UNK_LANG, Common::UNK_LANG, Common::UNK_LANG, Common::kPlatformUnknown, x, y, z, a, b, c, id }
+#define FLAGS_FAN(fanLang, repLang, x, y, z, a, b, c, id) { Common::UNK_LANG, fanLang, repLang, Common::kPlatformUnknown, x, y, z, a, b, c, id }
 
 #define KYRA1_FLOPPY_FLAGS FLAGS(false, false, false, false, false, false, Kyra::GI_KYRA1)
 #define KYRA1_FLOPPY_CMP_FLAGS FLAGS(false, false, false, false, false, true, Kyra::GI_KYRA1)
@@ -61,6 +62,7 @@
 
 #define KYRA3_CD_FLAGS FLAGS(false, false, true, false, true, true, Kyra::GI_KYRA3)
 #define KYRA3_CD_INS_FLAGS FLAGS(false, false, true, false, true, true, Kyra::GI_KYRA3)
+#define KYRA3_CD_FAN_FLAGS(x, y) FLAGS_FAN(x, y, false, false, true, false, true, true, Kyra::GI_KYRA3)
 
 const KYRAGameDescription adGameDescs[] = {
 	{
@@ -605,6 +607,53 @@
 		KYRA3_CD_FLAGS
 	},
 
+	// Spanish fan translation, see fr#1994040 "KYRA3: Add support for Spanish fan translation"
+	{
+		{
+			"kyra3",
+			0,
+			{
+				{ "ONETIME.PAK", 0, "9aaca21d2a205ca02ec53132f2911794", -1 },
+				{ "AUD.PAK", 0, 0, -1 },
+				{ 0, 0, 0, 0 }
+			},
+			Common::ES_ESP,
+			Common::kPlatformPC,
+			Common::ADGF_DROPLANGUAGE
+		},
+		KYRA3_CD_FAN_FLAGS(Common::ES_ESP, Common::EN_ANY)
+	},
+	{
+		{
+			"kyra3",
+			0,
+			{
+				{ "ONETIME.PAK", 0, "9aaca21d2a205ca02ec53132f2911794", -1 },
+				{ "AUD.PAK", 0, 0, -1 },
+				{ 0, 0, 0, 0 }
+			},
+			Common::DE_DEU,
+			Common::kPlatformPC,
+			Common::ADGF_DROPLANGUAGE
+		},
+		KYRA3_CD_FAN_FLAGS(Common::ES_ESP, Common::EN_ANY)
+	},
+	{
+		{
+			"kyra3",
+			0,
+			{
+				{ "ONETIME.PAK", 0, "9aaca21d2a205ca02ec53132f2911794", -1 },
+				{ "AUD.PAK", 0, 0, -1 },
+				{ 0, 0, 0, 0 }
+			},
+			Common::FR_FRA,
+			Common::kPlatformPC,
+			Common::ADGF_DROPLANGUAGE
+		},
+		KYRA3_CD_FAN_FLAGS(Common::ES_ESP, Common::EN_ANY)
+	},
+
 	{ AD_TABLE_END_MARKER, FLAGS(0, 0, 0, 0, 0, 0, 0) }
 };
 

Modified: scummvm/trunk/engines/kyra/kyra_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_hof.cpp	2008-06-30 23:06:38 UTC (rev 32857)
+++ scummvm/trunk/engines/kyra/kyra_hof.cpp	2008-06-30 23:39:56 UTC (rev 32858)
@@ -2024,6 +2024,9 @@
 		break;
 	}
 
+	if (_flags.lang == _flags.replacedLang && _flags.fanLang != Common::UNK_LANG)
+		_flags.lang = _flags.fanLang;
+
 	ConfMan.set("language", Common::getLanguageCode(_flags.lang));
 
 	KyraEngine_v1::writeSettings();

Modified: scummvm/trunk/engines/kyra/kyra_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_mr.cpp	2008-06-30 23:06:38 UTC (rev 32857)
+++ scummvm/trunk/engines/kyra/kyra_mr.cpp	2008-06-30 23:39:56 UTC (rev 32858)
@@ -1543,6 +1543,9 @@
 		break;
 	}
 
+	if (_flags.lang == _flags.replacedLang && _flags.fanLang != Common::UNK_LANG)
+		_flags.lang = _flags.fanLang;
+
 	ConfMan.set("language", Common::getLanguageCode(_flags.lang));
 
 	ConfMan.setBool("studio_audience", _configStudio);

Modified: scummvm/trunk/engines/kyra/kyra_v1.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v1.cpp	2008-06-30 23:06:38 UTC (rev 32857)
+++ scummvm/trunk/engines/kyra/kyra_v1.cpp	2008-06-30 23:39:56 UTC (rev 32858)
@@ -173,36 +173,6 @@
 			_gameToLoad = -1;
 	}
 
-	_lang = 0;
-	Common::Language lang = Common::parseLanguage(ConfMan.get("language"));
-
-	if (_flags.gameID == GI_KYRA2 || _flags.gameID == GI_KYRA3) {
-		switch (lang) {
-		case Common::EN_ANY:
-		case Common::EN_USA:
-		case Common::EN_GRB:
-			_lang = 0;
-			break;
-
-		case Common::FR_FRA:
-			_lang = 1;
-			break;
-
-		case Common::DE_DEU:
-			_lang = 2;
-			break;
-
-		case Common::JA_JPN:
-			_lang = 3;
-			break;
-
-		default:
-			warning("unsupported language, switching back to English");
-			_lang = 0;
-			break;
-		}
-	}
-
 	return 0;
 }
 
@@ -277,6 +247,8 @@
 void KyraEngine_v1::registerDefaultSettings() {
 	if (_flags.gameID != GI_KYRA3)
 		ConfMan.registerDefault("cdaudio", (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98));
+	if (_flags.fanLang != Common::UNK_LANG)
+		ConfMan.registerDefault("subtitles", true);
 }
 
 void KyraEngine_v1::readSettings() {

Modified: scummvm/trunk/engines/kyra/kyra_v1.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v1.h	2008-06-30 23:06:38 UTC (rev 32857)
+++ scummvm/trunk/engines/kyra/kyra_v1.h	2008-06-30 23:39:56 UTC (rev 32858)
@@ -44,6 +44,11 @@
 
 struct GameFlags {
 	Common::Language lang;
+
+	// language overwrites of fan translations (only needed for multilingual games)
+	Common::Language fanLang;
+	Common::Language replacedLang;
+
 	Common::Platform platform;
 
 	bool isDemo					: 1;
@@ -212,7 +217,6 @@
 
 	// detection
 	GameFlags _flags;
-	int _lang;
 
 	// opcode
 	virtual void setupOpcodeTable() = 0;

Modified: scummvm/trunk/engines/kyra/kyra_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.cpp	2008-06-30 23:06:38 UTC (rev 32857)
+++ scummvm/trunk/engines/kyra/kyra_v2.cpp	2008-06-30 23:39:56 UTC (rev 32858)
@@ -23,6 +23,8 @@
  *
  */
 
+#include "common/config-manager.h"
+
 #include "kyra/kyra_v2.h"
 #include "kyra/screen_v2.h"
 #include "kyra/debugger.h"
@@ -70,6 +72,36 @@
 	memset(&_mainCharacter.inventory, -1, sizeof(_mainCharacter.inventory));
 
 	_pauseStart = 0;
+
+	_lang = 0;
+	Common::Language lang = Common::parseLanguage(ConfMan.get("language"));
+	if (lang == _flags.fanLang && _flags.replacedLang != Common::UNK_LANG)
+		lang = _flags.replacedLang;
+
+	switch (lang) {
+	case Common::EN_ANY:
+	case Common::EN_USA:
+	case Common::EN_GRB:
+		_lang = 0;
+		break;
+
+	case Common::FR_FRA:
+		_lang = 1;
+		break;
+
+	case Common::DE_DEU:
+		_lang = 2;
+		break;
+
+	case Common::JA_JPN:
+		_lang = 3;
+		break;
+
+	default:
+		warning("unsupported language, switching back to English");
+		_lang = 0;
+		break;
+	}
 }
 
 KyraEngine_v2::~KyraEngine_v2() {

Modified: scummvm/trunk/engines/kyra/kyra_v2.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.h	2008-06-30 23:06:38 UTC (rev 32857)
+++ scummvm/trunk/engines/kyra/kyra_v2.h	2008-06-30 23:39:56 UTC (rev 32858)
@@ -94,6 +94,9 @@
 	virtual void update() = 0;
 	virtual void updateWithText() = 0;
 
+	// detection
+	int _lang;
+
 	// MainMenu
 	MainMenu *_menu;
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list