aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2008-06-30 23:39:56 +0000
committerJohannes Schickel2008-06-30 23:39:56 +0000
commitcef7d68fc531dbaac68c2b83a340bfbb3dcf142e (patch)
tree8ca62af0b4c9f188977277f42e19b63d383eb69c
parentb07ff576233dec6e2138f19a5cf053e2ccf146df (diff)
downloadscummvm-rg350-cef7d68fc531dbaac68c2b83a340bfbb3dcf142e.tar.gz
scummvm-rg350-cef7d68fc531dbaac68c2b83a340bfbb3dcf142e.tar.bz2
scummvm-rg350-cef7d68fc531dbaac68c2b83a340bfbb3dcf142e.zip
Added support for Spanish fan translation of kyra3 (See fr #1994040 "KYRA3: Add support for Spanish fan translation").
svn-id: r32858
-rw-r--r--engines/kyra/detection.cpp51
-rw-r--r--engines/kyra/kyra_hof.cpp3
-rw-r--r--engines/kyra/kyra_mr.cpp3
-rw-r--r--engines/kyra/kyra_v1.cpp32
-rw-r--r--engines/kyra/kyra_v1.h6
-rw-r--r--engines/kyra/kyra_v2.cpp32
-rw-r--r--engines/kyra/kyra_v2.h3
7 files changed, 98 insertions, 32 deletions
diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp
index 3fb62b51bd..33d0d2c070 100644
--- a/engines/kyra/detection.cpp
+++ b/engines/kyra/detection.cpp
@@ -41,7 +41,8 @@ struct KYRAGameDescription {
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 @@ namespace {
#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 @@ const KYRAGameDescription adGameDescs[] = {
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) }
};
diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp
index 61a1570893..879efab86e 100644
--- a/engines/kyra/kyra_hof.cpp
+++ b/engines/kyra/kyra_hof.cpp
@@ -2024,6 +2024,9 @@ void KyraEngine_HoF::writeSettings() {
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();
diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp
index 8a49b8e155..b425c0929f 100644
--- a/engines/kyra/kyra_mr.cpp
+++ b/engines/kyra/kyra_mr.cpp
@@ -1543,6 +1543,9 @@ void KyraEngine_MR::writeSettings() {
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);
diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp
index 980c181c4e..d2e0f37a60 100644
--- a/engines/kyra/kyra_v1.cpp
+++ b/engines/kyra/kyra_v1.cpp
@@ -173,36 +173,6 @@ int KyraEngine_v1::init() {
_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::delayWithTicks(int ticks) {
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() {
diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h
index 4f38ceca98..09efc8cc97 100644
--- a/engines/kyra/kyra_v1.h
+++ b/engines/kyra/kyra_v1.h
@@ -44,6 +44,11 @@ namespace Kyra {
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 @@ protected:
// detection
GameFlags _flags;
- int _lang;
// opcode
virtual void setupOpcodeTable() = 0;
diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp
index 12da338843..2e704f2aa2 100644
--- a/engines/kyra/kyra_v2.cpp
+++ b/engines/kyra/kyra_v2.cpp
@@ -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 @@ KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags, const Engi
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() {
diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h
index 24f7aad614..6fdf30fff8 100644
--- a/engines/kyra/kyra_v2.h
+++ b/engines/kyra/kyra_v2.h
@@ -94,6 +94,9 @@ protected:
virtual void update() = 0;
virtual void updateWithText() = 0;
+ // detection
+ int _lang;
+
// MainMenu
MainMenu *_menu;