aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base
diff options
context:
space:
mode:
Diffstat (limited to 'engines/wintermute/base')
-rw-r--r--engines/wintermute/base/base_file_manager.cpp38
-rw-r--r--engines/wintermute/base/file/base_package.cpp10
2 files changed, 28 insertions, 20 deletions
diff --git a/engines/wintermute/base/base_file_manager.cpp b/engines/wintermute/base/base_file_manager.cpp
index b026bbee56..16ae85f41d 100644
--- a/engines/wintermute/base/base_file_manager.cpp
+++ b/engines/wintermute/base/base_file_manager.cpp
@@ -218,13 +218,6 @@ 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();
@@ -232,38 +225,43 @@ bool BaseFileManager::registerPackages() {
// 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;
}
}
diff --git a/engines/wintermute/base/file/base_package.cpp b/engines/wintermute/base/file/base_package.cpp
index b80547f509..2ed27e2c32 100644
--- a/engines/wintermute/base/file/base_package.cpp
+++ b/engines/wintermute/base/file/base_package.cpp
@@ -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"
@@ -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...