aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2018-06-25 15:59:05 +0200
committerBastien Bouclet2018-06-29 13:31:55 +0200
commit1f4d4b01eaeebecbb790b0e6a719577c14a9b470 (patch)
tree2bef7b6866838cd01649747f03d7d86629126349 /engines
parent318093b41c5c613fbfe5cdf3b903fea26663d4a0 (diff)
downloadscummvm-rg350-1f4d4b01eaeebecbb790b0e6a719577c14a9b470.tar.gz
scummvm-rg350-1f4d4b01eaeebecbb790b0e6a719577c14a9b470.tar.bz2
scummvm-rg350-1f4d4b01eaeebecbb790b0e6a719577c14a9b470.zip
MOHAWK: RIVEN: Removed hardcoded list of language prefixes.
This will let to play with the prefixes without recompilation.
Diffstat (limited to 'engines')
-rw-r--r--engines/mohawk/detection.cpp8
-rw-r--r--engines/mohawk/mohawk.h10
-rw-r--r--engines/mohawk/riven.cpp39
3 files changed, 19 insertions, 38 deletions
diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp
index 58d1483bee..c185a63174 100644
--- a/engines/mohawk/detection.cpp
+++ b/engines/mohawk/detection.cpp
@@ -46,14 +46,6 @@
namespace Mohawk {
-struct MohawkGameDescription {
- ADGameDescription desc;
-
- uint8 gameType;
- uint32 features;
- const char *appName;
-};
-
const char* MohawkEngine::getGameId() const {
return _gameDescription->desc.gameId;
}
diff --git a/engines/mohawk/mohawk.h b/engines/mohawk/mohawk.h
index ad4ff7b3f0..d61512a701 100644
--- a/engines/mohawk/mohawk.h
+++ b/engines/mohawk/mohawk.h
@@ -26,6 +26,7 @@
#include "common/scummsys.h"
#include "common/array.h"
+#include "engines/advancedDetector.h"
#include "engines/engine.h"
class OSystem;
@@ -65,12 +66,19 @@ enum MohawkGameFeatures {
GF_LB_10 = (1 << 4) // very early Living Books 1.0 games
};
-struct MohawkGameDescription;
class Sound;
class PauseDialog;
class Archive;
class CursorManager;
+struct MohawkGameDescription {
+ ADGameDescription desc;
+
+ uint8 gameType;
+ uint32 features;
+ const char *appName;
+};
+
class MohawkEngine : public ::Engine {
protected:
Common::Error run() override;
diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp
index 4075f80c0f..252c994437 100644
--- a/engines/mohawk/riven.cpp
+++ b/engines/mohawk/riven.cpp
@@ -503,38 +503,19 @@ bool MohawkEngine_Riven::checkDatafiles() {
}
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) {
+ if (!(getFeatures() & GF_25TH) || getLanguage() == Common::EN_ANY)
+ return "";
+
+ if (!Common::String(_gameDescription->desc.filesDescriptions[1].fileName).hasPrefix("a_data_")) {
+ warning("Malformed 25th Anniversary Riven entry");
+
return "";
}
- return Common::String::format("%c_data_%s.mhk", prefix, language);
+ const char *fname = _gameDescription->desc.filesDescriptions[1].fileName;
+ Common::String language(&fname[7], strlen(fname) - 7 - 4);
+
+ return Common::String::format("%c_data_%s.mhk", prefix, language.c_str());
}
RivenStack *MohawkEngine_Riven::constructStackById(uint16 id) {