Skip to content

Commit

Permalink
WINTERMUTE: Add lots of entries to detection table and refactor handl…
Browse files Browse the repository at this point in the history
…ing of localization packages

* WINTERMUTE: Add detection for unsupported "Basis Octavus" game

This game is not supported by ScummVM, because it's 2.5D. However, there
are already other 2.5D games in detection table and the intent is to add
all known games, and support 2.5D in ResidualVM later.

* WINTERMUTE: Add detection for Alimardan dilogy

"Alimardan's Mischief" and "Alimardan Meets Merlin" are games by Iranian
developer Resana Shokooh Kavir (http://rskgd.com/)
It seems that Persian versions also exist, I'll surely look at it later:
https://www.digikala.com/product/dkp-75901

There were 2 steam releases for alimardan1:
https://steamdb.info/depot/694421/manifests/

There was only one steam release of alimardan2:
https://steamdb.info/depot/694431/manifests/

* WINTERMUTE: Add detection for Oknytt 1.12

Oknytt had 2 steam releases (1.12 and 1.13):
https://steamdb.info/depot/286321/manifests/
I have downloaded 1.12 and added detection.

* WINTERMUTE: Add empty strings between detection table lines

* WINTERMUTE: Add detection for Steam versions of reversion1 for Windows

Source: https://steamdb.info/depot/270572/manifests/

* WINTERMUTE: Add detection for Steam version of reversion1 for Linux

Source: https://steamdb.info/depot/270571/manifests/

* WINTERMUTE: Fix localization loading for Mac and Linux

Mac and Linux builds of reversion1 & reversion2 does not have any
"languages" folders.
So, we need to filter those files according to filenames too.

Once there is such filtering, there is no need for this overspecific
hack for revision1's xlanguage_pt.dcp.

* WINTERMUTE: Add detection for Steam versions of reversion2 for Windows

Source: https://steamdb.info/depot/281061/manifests/

* WINTERMUTE: Language packages priority for Linux & Mac

* WINTERMUTE: Add detection for Steam versions of reversion2 for Linux

Source: https://steamdb.info/depot/281062/manifests/

* WINTERMUTE: Add detection for Steam versions of reversion2 for Mac

Source: https://steamdb.info/depot/281063/manifests/

* WINTERMUTE: Add detection for Steam versions of reversion1 for Mac

Source: https://steamdb.info/depot/270573/manifests/

* WINTERMUTE: Add detection for old Desura versions of reversion2

Source: https://bugs.scummvm.org/ticket/6564

* WINTERMUTE: Add detection for Spanish versions of reversion1&2

As was shown by windlepoons, xlanguage_* contains additional translation
package, while data.dcp contains original translation (which is
Spanish).

So, even without owning those old releases of reversion1&2, I can wrote
detection tables for them by not looking for any "xlanguage_*.dcp" file.
However, we shouldn't use WME_ENTRY1s for Spanish, because advanced
detector say "new best match, removing all previous candidates" once it
hit a WME_ENTRY2s. Instead, let's just look for data.dcp twice to give
user a choice of several WME_ENTRY2s. Lor Linux, it's WME_ENTRY3s.

* WINTERMUTE: Filter language packages ignoring folder name

There are 4 types of multilang games:
1. Each installation contain a data.dcp package (same for all languages)
+ an additional language package. Other localization packages are not
installed. Those games are: "Helga Deep In Trouble", "Dirty Split",
"Looky".

2. Each installation contain a data.dcp package (same for all languages)
+ a folder with all localization packages + a single "selected" language
package copied to main folder.  "xlanguage_" prefix is usual for
reversion series. Other games usually use "english.dcp", "spanich.dcp",
"czech.dcp", etc.
Those are: "Five Lethal Demons", "Five Magical Amulets", "Dead City",
"Oknytt", "Reversion: The Escape", "Reversion: The Meeting".

3. All localizations are inside data.dcp all-together. Those are: "One
Hellavu Day", "The White Chamber" and "James Peris: No License Nor
Control".

4. Different data.dcp build for each language. All other known games are
here.

This code covers all known filenames for localization packages and
provide several guessworks for ignoring all irrelevant localization
packages.

* WINTERMUTE: Add localization detection for Five Lethal Demons

* WINTERMUTE: Tweak detection for Dead City (Czech)

"english.dcp" is not required to play Dead City in Czech language, so we
don't need to detect it

* WINTERMUTE: Add detection table for Looky in English

I got English version here:
https://bullshit-softworx.itch.io/looky-adventure

* WINTERMUTE: Add detection for Czech versions of Helga

"english.dcp" happen to be optional
  • Loading branch information
lolbot-iichan authored and bluegr committed Jun 25, 2019
1 parent bf19375 commit 3c1e883
Show file tree
Hide file tree
Showing 3 changed files with 1,240 additions and 27 deletions.
38 changes: 18 additions & 20 deletions engines/wintermute/base/base_file_manager.cpp
Expand Up @@ -218,52 +218,50 @@ bool BaseFileManager::registerPackages() {
searchSignature = true;
}

// HACK: for Reversion1, avoid loading xlanguage_pt.dcp from the main folder:
if (_language != Common::PT_BRA && targetName.hasPrefix("reversion1")) {
if (fileName == "xlanguage_pt.dcp") {
continue;
}
}

// Again, make the parent's name all lowercase to avoid any case
// issues.
Common::String parentName = it->getName();
parentName.toLowercase();

// Avoid registering all the language files
// TODO: Select based on the gameDesc.
if (_language != Common::UNK_LANG && (parentName == "language" || parentName == "languages")) {
if (_language != Common::UNK_LANG) {
// English
if (_language == Common::EN_ANY && (fileName != "english.dcp" && fileName != "xlanguage_en.dcp")) {
if (_language != Common::EN_ANY && (fileName == "english.dcp" || fileName == "xlanguage_en.dcp")) {
continue;
// Chinese
} else if (_language == Common::ZH_CNA && (fileName != "chinese.dcp" && fileName != "xlanguage_nz.dcp")) {
} else if (_language != Common::ZH_CNA && (fileName == "chinese.dcp" || fileName == "xlanguage_nz.dcp")) {
continue;
// Czech
} else if (_language == Common::CZ_CZE && (fileName != "czech.dcp" && fileName != "xlanguage_cz.dcp")) {
} else if (_language != Common::CZ_CZE && (fileName == "czech.dcp" || fileName == "xlanguage_cz.dcp")) {
continue;
// French
} else if (_language == Common::FR_FRA && (fileName != "french.dcp" && fileName != "xlanguage_fr.dcp")) {
} else if (_language != Common::FR_FRA && (fileName == "french.dcp" || fileName == "xlanguage_fr.dcp")) {
continue;
// German
} else if (_language == Common::DE_DEU && (fileName != "german.dcp" && fileName != "xlanguage_de.dcp")) {
} else if (_language != Common::DE_DEU && (fileName == "german.dcp" || fileName == "xlanguage_de.dcp")) {
continue;
// Italian
} else if (_language == Common::IT_ITA && (fileName != "italian.dcp" && fileName != "xlanguage_it.dcp")) {
} else if (_language != Common::IT_ITA && (fileName == "italian.dcp" || fileName == "xlanguage_it.dcp")) {
continue;
// Latvian
} else if (_language == Common::LV_LAT && (fileName != "latvian.dcp" && fileName != "xlanguage_lv.dcp")) {
// TODO: 'latvian.dcp' is just guesswork. Is there any
// game using Latvian and using this filename?
} else if (_language != Common::LV_LAT && (fileName == "latvian.dcp" || fileName == "xlanguage_lv.dcp")) {
continue;
// Polish
} else if (_language == Common::PL_POL && (fileName != "polish.dcp" && fileName != "xlanguage_pl.dcp")) {
} else if (_language != Common::PL_POL && (fileName == "polish.dcp" || fileName == "xlanguage_pl.dcp")) {
continue;
// Portuguese
} else if (_language == Common::PT_BRA && (fileName != "portuguese.dcp" && fileName != "xlanguage_pt.dcp")) {
} else if (_language != Common::PT_BRA && (fileName == "portuguese.dcp" || fileName == "xlanguage_pt.dcp")) {
continue;
// Russian
} else if (_language == Common::RU_RUS && (fileName != "russian.dcp" && fileName != "xlanguage_ru.dcp")) {
} else if (_language != Common::RU_RUS && (fileName == "russian.dcp" || fileName == "xlanguage_ru.dcp")) {
continue;
// Spanish
} else if (_language != Common::ES_ESP && (fileName == "spanish.dcp" || fileName == "xlanguage_es.dcp")) {
continue;
// generic
} else if (fileName.hasPrefix("xlanguage_")) {
warning("Unknown language package: %s", fileName.c_str());
continue;
}
}
Expand Down
10 changes: 10 additions & 0 deletions engines/wintermute/base/file/base_package.cpp
Expand Up @@ -26,6 +26,7 @@
* Copyright (c) 2011 Jan Nedoma
*/

#include "engines/wintermute/base/base_engine.h"
#include "engines/wintermute/base/file/base_package.h"
#include "engines/wintermute/base/file/base_file_entry.h"
#include "engines/wintermute/base/file/dcpackage.h"
Expand Down Expand Up @@ -90,6 +91,15 @@ void TPackageHeader::readFromStream(Common::ReadStream *stream) {
_gameVersion = stream->readUint32LE();

_priority = stream->readByte();

// HACK: reversion1 and reversion2 for Linux & Mac use some hacked Wintermute
// They provide "xlanguage_*.dcp" packages with 0x00 priority and change priority for a single package in runtime
// We already filter unwanted "xlanguage_*.dcp" packages at BaseFileManager::registerPackages()
// So, let's just raise the priority for all "xlanguage_*.dcp" here to the value of Windows version packages
if (_priority == 0 && BaseEngine::instance().getGameId().hasPrefix("reversion")) {
_priority = 0x02;
}

_cd = stream->readByte();
_masterIndex = stream->readByte();
stream->readByte(); // To align the next byte...
Expand Down

0 comments on commit 3c1e883

Please sign in to comment.