diff options
author | Peter Kohaut | 2018-01-14 13:33:45 +0100 |
---|---|---|
committer | Peter Kohaut | 2018-01-14 13:36:55 +0100 |
commit | 1eeafb4e30f9ccc92ece32b7078841ff94b3c7fb (patch) | |
tree | f82ed30c2f7298e46d8a46ac8896d5e1f6979c62 | |
parent | d7efb2d5bba352fb43c903bcb2595e3b9b757c2f (diff) | |
download | scummvm-rg350-1eeafb4e30f9ccc92ece32b7078841ff94b3c7fb.tar.gz scummvm-rg350-1eeafb4e30f9ccc92ece32b7078841ff94b3c7fb.tar.bz2 scummvm-rg350-1eeafb4e30f9ccc92ece32b7078841ff94b3c7fb.zip |
BLADERUNNER: Support for different languages
Added support for playing the game with different languages
Added Spanish language to detection tables
-rw-r--r-- | engines/bladerunner/actor.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/ambient_sounds.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/bladerunner.cpp | 26 | ||||
-rw-r--r-- | engines/bladerunner/bladerunner.h | 5 | ||||
-rw-r--r-- | engines/bladerunner/detection.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/detection_tables.h | 14 | ||||
-rw-r--r-- | engines/bladerunner/outtake.cpp | 11 | ||||
-rw-r--r-- | engines/bladerunner/text_resource.cpp | 2 |
8 files changed, 53 insertions, 11 deletions
diff --git a/engines/bladerunner/actor.cpp b/engines/bladerunner/actor.cpp index 3877947923..3f66899d5d 100644 --- a/engines/bladerunner/actor.cpp +++ b/engines/bladerunner/actor.cpp @@ -1052,7 +1052,7 @@ int Actor::getGoal() { void Actor::speechPlay(int sentenceId, bool voiceOver) { char name[13]; - sprintf(name, "%02d-%04d.AUD", _id, sentenceId); //TODO somewhere here should be also language code + sprintf(name, "%02d-%04d%s.AUD", _id, sentenceId, _vm->_languageCode); int balance; if (voiceOver || _id == VOICEOVER_ACTOR) { diff --git a/engines/bladerunner/ambient_sounds.cpp b/engines/bladerunner/ambient_sounds.cpp index 7790b03506..a8a42537d1 100644 --- a/engines/bladerunner/ambient_sounds.cpp +++ b/engines/bladerunner/ambient_sounds.cpp @@ -107,7 +107,7 @@ void AmbientSounds::addSpeech(int actorId, int sentenceId, int timeMin, int time sort(panEndMin, panEndMax); char name[13]; - sprintf(name, "%02d-%04d.AUD", actorId, sentenceId); //TODO somewhere here should be also language code + sprintf(name, "%02d-%04d%s.AUD", actorId, sentenceId, _vm->_languageCode); addSoundByName(name, timeMin, timeMax, volumeMin, volumeMax, diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp index 0c5dabe136..653f159bb3 100644 --- a/engines/bladerunner/bladerunner.cpp +++ b/engines/bladerunner/bladerunner.cpp @@ -69,12 +69,13 @@ #include "common/system.h" #include "engines/util.h" +#include "engines/advancedDetector.h" #include "graphics/pixelformat.h" namespace BladeRunner { -BladeRunnerEngine::BladeRunnerEngine(OSystem *syst) +BladeRunnerEngine::BladeRunnerEngine(OSystem *syst, const ADGameDescription *desc) : Engine(syst), _rnd("bladerunner") { _windowIsActive = true; @@ -104,6 +105,29 @@ BladeRunnerEngine::BladeRunnerEngine(OSystem *syst) _walkSoundId = -1; _walkSoundVolume = 0; _walkSoundBalance = 0; + + switch (desc->language) { + case Common::EN_ANY: + this->_languageCode = "E"; + break; + case Common::DE_DEU: + this->_languageCode = "G"; + break; + case Common::FR_FRA: + this->_languageCode = "F"; + break; + case Common::IT_ITA: + this->_languageCode = "I"; + break; + case Common::RU_RUS: + this->_languageCode = "R"; + break; + case Common::ES_ESP: + this->_languageCode = "S"; + break; + default: + this->_languageCode = "E"; + } } BladeRunnerEngine::~BladeRunnerEngine() { diff --git a/engines/bladerunner/bladerunner.h b/engines/bladerunner/bladerunner.h index 7ed3fb4af3..3f158fbc32 100644 --- a/engines/bladerunner/bladerunner.h +++ b/engines/bladerunner/bladerunner.h @@ -37,6 +37,8 @@ namespace Common { struct Event; } +struct ADGameDescription; + namespace BladeRunner { enum AnimationModes { @@ -101,6 +103,7 @@ public: bool _gameIsRunning; bool _windowIsActive; int _playerLosesControlCounter; + char* _languageCode; ADQ *_adq; ScreenEffects *_screenEffects; @@ -176,7 +179,7 @@ private: MIXArchive _archives[kArchiveCount]; public: - BladeRunnerEngine(OSystem *syst); + BladeRunnerEngine(OSystem *syst, const ADGameDescription *desc); ~BladeRunnerEngine(); bool hasFeature(EngineFeature f) const; diff --git a/engines/bladerunner/detection.cpp b/engines/bladerunner/detection.cpp index 1e40f3d363..f2c691a346 100644 --- a/engines/bladerunner/detection.cpp +++ b/engines/bladerunner/detection.cpp @@ -54,7 +54,7 @@ public: bool BladeRunnerMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const { - *engine = new BladeRunner::BladeRunnerEngine(syst); + *engine = new BladeRunner::BladeRunnerEngine(syst, desc); return true; } diff --git a/engines/bladerunner/detection_tables.h b/engines/bladerunner/detection_tables.h index 9886f78528..52627890ea 100644 --- a/engines/bladerunner/detection_tables.h +++ b/engines/bladerunner/detection_tables.h @@ -96,6 +96,20 @@ static const ADGameDescription gameDescriptions[] = { GUIO0() }, + // BladeRunner (Spanish) + { + "bladerunner", + 0, + { + {"STARTUP.MIX", 0, "54cad53da9e4ae03a85648834ac6765d", 2312976}, + AD_LISTEND + }, + Common::ES_ESP, + Common::kPlatformWindows, + ADGF_NO_FLAGS, + GUIO0() + }, + AD_TABLE_END_MARKER }; diff --git a/engines/bladerunner/outtake.cpp b/engines/bladerunner/outtake.cpp index d60079032a..4791259e32 100644 --- a/engines/bladerunner/outtake.cpp +++ b/engines/bladerunner/outtake.cpp @@ -37,11 +37,12 @@ void OuttakePlayer::play(const Common::String &name, bool noLocalization, int co return; } - Common::String resName; - if (noLocalization) - resName = name + ".VQA"; - else - resName = name + "_E.VQA"; + Common::String resName = name; + if (!noLocalization) { + resName = resName + "_" + _vm->_languageCode; + } + + resName = resName + ".VQA"; VQAPlayer vqa_player(_vm, &_vm->_surfaceGame); diff --git a/engines/bladerunner/text_resource.cpp b/engines/bladerunner/text_resource.cpp index 03460d039f..78a73f5e71 100644 --- a/engines/bladerunner/text_resource.cpp +++ b/engines/bladerunner/text_resource.cpp @@ -47,7 +47,7 @@ bool TextResource::open(const char *name) { assert(strlen(name) <= 8); char resName[13]; - sprintf(resName, "%s.TRE", name); + sprintf(resName, "%s.TR%s", name, _vm->_languageCode); Common::ScopedPtr<Common::SeekableReadStream> s(_vm->getResourceStream(resName)); if (!s) return false; |