diff options
author | Bastien Bouclet | 2018-06-24 13:00:58 +0200 |
---|---|---|
committer | Bastien Bouclet | 2018-06-29 13:31:55 +0200 |
commit | 24977b814cbff4f75a133370506256e8c7c40631 (patch) | |
tree | 031e2a85a3b794f4b2b8948b78edf88ea235dd45 | |
parent | 2660211fd79931f742ba00d72008bef0a1bc4999 (diff) | |
download | scummvm-rg350-24977b814cbff4f75a133370506256e8c7c40631.tar.gz scummvm-rg350-24977b814cbff4f75a133370506256e8c7c40631.tar.bz2 scummvm-rg350-24977b814cbff4f75a133370506256e8c7c40631.zip |
MOHAWK: RIVEN: Add detection for the 25th Anniversary version
-rw-r--r-- | engines/mohawk/detection_tables.h | 172 | ||||
-rw-r--r-- | engines/mohawk/riven.cpp | 45 | ||||
-rw-r--r-- | engines/mohawk/riven.h | 1 |
3 files changed, 218 insertions, 0 deletions
diff --git a/engines/mohawk/detection_tables.h b/engines/mohawk/detection_tables.h index 8644ba96e2..213bbb0723 100644 --- a/engines/mohawk/detection_tables.h +++ b/engines/mohawk/detection_tables.h @@ -636,6 +636,178 @@ static const MohawkGameDescription gameDescriptions[] = { 0, }, + // Riven: The Sequel to Myst - 25th anniversary + // English - Created by the ScummVM team + { + { + "riven", + "25th Anniversary", + { + // The french datafile is included in the list because + // in the 25th anniversary edition, all the files sit in the same + // package. All the detection entries need to have the same amount + // of files to show in the detection results. + { "a_data.mhk", 0, "08fcaa5d5a2a01d7a5a6960f497212fe", -1}, + { "a_data_french.mhk", 0, "ad7547ed7159a97be98a005f62862f85", -1}, + AD_LISTEND + }, + Common::EN_ANY, + Common::kPlatformWindows, + ADGF_DROPPLATFORM, + GUI_OPTIONS_RIVEN + }, + GType_RIVEN, + GF_DVD, + 0, + }, + + // Riven: The Sequel to Myst - 25th anniversary + // French - Created by the ScummVM team + { + { + "riven", + "25th Anniversary", + { + { "a_data.mhk", 0, "08fcaa5d5a2a01d7a5a6960f497212fe", -1}, + { "a_data_french.mhk", 0, "ad7547ed7159a97be98a005f62862f85", -1}, + AD_LISTEND + }, + Common::FR_FRA, + Common::kPlatformWindows, + ADGF_DROPPLATFORM, + GUI_OPTIONS_RIVEN + }, + GType_RIVEN, + GF_DVD, + 0, + }, + + // Riven: The Sequel to Myst - 25th anniversary + // German - Created by the ScummVM team + { + { + "riven", + "25th Anniversary", + { + { "a_data.mhk", 0, "08fcaa5d5a2a01d7a5a6960f497212fe", -1}, + { "a_data_german.mhk", 0, "5ebd301bd4bf6fd7667c4a46eebf6532", -1}, + AD_LISTEND + }, + Common::DE_DEU, + Common::kPlatformWindows, + ADGF_DROPPLATFORM, + GUI_OPTIONS_RIVEN + }, + GType_RIVEN, + GF_DVD, + 0, + }, + + // Riven: The Sequel to Myst - 25th anniversary + // Italian - Created by the ScummVM team + { + { + "riven", + "25th Anniversary", + { + { "a_data.mhk", 0, "08fcaa5d5a2a01d7a5a6960f497212fe", -1}, + { "a_data_italian.mhk", 0, "9d53b178510ce90f10b32ad3ca967d38", -1}, + AD_LISTEND + }, + Common::IT_ITA, + Common::kPlatformWindows, + ADGF_DROPPLATFORM, + GUI_OPTIONS_RIVEN + }, + GType_RIVEN, + GF_DVD, + 0, + }, + + // Riven: The Sequel to Myst - 25th anniversary + // Japanese - Created by the ScummVM team + { + { + "riven", + "25th Anniversary", + { + { "a_data.mhk", 0, "08fcaa5d5a2a01d7a5a6960f497212fe", -1}, + { "a_data_japanese.mhk", 0, "bf43cf8af21fefc5a02881f7cfb68f52", -1}, + AD_LISTEND + }, + Common::JA_JPN, + Common::kPlatformWindows, + ADGF_DROPPLATFORM, + GUI_OPTIONS_RIVEN + }, + GType_RIVEN, + GF_DVD, + 0, + }, + + // Riven: The Sequel to Myst - 25th anniversary + // Polish - Created by the ScummVM team + { + { + "riven", + "25th Anniversary", + { + { "a_data.mhk", 0, "08fcaa5d5a2a01d7a5a6960f497212fe", -1}, + { "a_data_polish.mhk", 0, "5c7cd4b1a1a4c63cc670485816b0b5ec", -1}, + AD_LISTEND + }, + Common::PL_POL, + Common::kPlatformWindows, + ADGF_DROPPLATFORM, + GUI_OPTIONS_RIVEN + }, + GType_RIVEN, + GF_DVD, + 0, + }, + + // Riven: The Sequel to Myst - 25th anniversary + // Russian - Created by the ScummVM team + { + { + "riven", + "25th Anniversary", + { + { "a_data.mhk", 0, "08fcaa5d5a2a01d7a5a6960f497212fe", -1}, + { "a_data_russian.mhk", 0, "76e12906637f5274bb6af8ab42871c25", -1}, + AD_LISTEND + }, + Common::RU_RUS, + Common::kPlatformWindows, + ADGF_DROPPLATFORM, + GUI_OPTIONS_RIVEN + }, + GType_RIVEN, + GF_DVD, + 0, + }, + + // Riven: The Sequel to Myst - 25th anniversary + // Spanish - Created by the ScummVM team + { + { + "riven", + "25th Anniversary", + { + { "a_data.mhk", 0, "08fcaa5d5a2a01d7a5a6960f497212fe", -1}, + { "a_data_spanish.mhk", 0, "6226a3e1748e64962971b2f6536ef283", -1}, + AD_LISTEND + }, + Common::ES_ESP, + Common::kPlatformWindows, + ADGF_DROPPLATFORM, + GUI_OPTIONS_RIVEN + }, + GType_RIVEN, + GF_DVD, + 0, + }, + // Riven: The Sequel to Myst // Version ? (Demo, From "Prince of Persia Collector's Edition") // From Clone2727 diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp index 5faebf8f1e..bbfd139960 100644 --- a/engines/mohawk/riven.cpp +++ b/engines/mohawk/riven.cpp @@ -396,6 +396,16 @@ void MohawkEngine_Riven::changeToStack(uint16 stackId) { // Get the prefix character for the destination stack char prefix = RivenStacks::getName(stackId)[0]; + // Load the localization override file if any + Common::String languageDatafile = getLanguageDatafile(prefix); + if (!languageDatafile.empty()) { + MohawkArchive *mhk = new MohawkArchive(); + if (mhk->openFile(languageDatafile)) + _mhk.push_back(mhk); + else + delete mhk; + } + // Load files that start with the prefix const char **datafiles = listExpectedDatafiles(); for (int i = 0; datafiles[i] != nullptr; i++) { @@ -492,6 +502,41 @@ bool MohawkEngine_Riven::checkDatafiles() { return false; } +Common::String MohawkEngine_Riven::getLanguageDatafile(char prefix) const { + const char *language = nullptr; + switch (getLanguage()) { + case Common::FR_FRA: + language = "french"; + break; + case Common::DE_DEU: + language = "german"; + break; + case Common::IT_ITA: + language = "italian"; + break; + case Common::JA_JPN: + language = "japanese"; + break; + case Common::PL_POL: + language = "polish"; + break; + case Common::RU_RUS: + language = "russian"; + break; + case Common::ES_ESP: + language = "spanish"; + break; + default: + break; + } + + if (!language) { + return ""; + } + + return Common::String::format("%c_data_%s.mhk", prefix, language); +} + RivenStack *MohawkEngine_Riven::constructStackById(uint16 id) { switch (id) { case kStackAspit: diff --git a/engines/mohawk/riven.h b/engines/mohawk/riven.h index 57a3d2b180..80ff6daea7 100644 --- a/engines/mohawk/riven.h +++ b/engines/mohawk/riven.h @@ -111,6 +111,7 @@ private: // Datafiles MohawkArchive *_extrasFile; // We need a separate handle for the extra data const char **listExpectedDatafiles() const; + Common::String getLanguageDatafile(char prefix) const; bool checkDatafiles(); RivenConsole *_console; |