From ef5e8091f60ffe8f031e26c4c669b60ba11e0cfc Mon Sep 17 00:00:00 2001 From: yinsimei Date: Wed, 12 Jul 2017 23:20:46 +0200 Subject: SLUDGE: use multiple entries for language selection --- engines/sludge/detection.cpp | 5 ++--- engines/sludge/detection_tables.h | 12 ++++++++++++ engines/sludge/language.cpp | 5 ++--- engines/sludge/sludge.h | 2 +- engines/sludge/sludger.cpp | 9 ++------- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/engines/sludge/detection.cpp b/engines/sludge/detection.cpp index e884d17074..b0c3ef24dd 100644 --- a/engines/sludge/detection.cpp +++ b/engines/sludge/detection.cpp @@ -30,11 +30,10 @@ namespace Sludge { struct SludgeGameDescription { ADGameDescription desc; - - int gameType; + uint languageID; }; -int SludgeEngine::getGameType() const { return _gameDescription->gameType; } +uint SludgeEngine::getLanguageID() const { return _gameDescription->languageID; } const char *SludgeEngine::getGameId() const { return _gameDescription->desc.gameId;} uint32 SludgeEngine::getFeatures() const { return _gameDescription->desc.flags; } Common::Language SludgeEngine::getLanguage() const { return _gameDescription->desc.language; } diff --git a/engines/sludge/detection_tables.h b/engines/sludge/detection_tables.h index e67d238258..b162533f31 100644 --- a/engines/sludge/detection_tables.h +++ b/engines/sludge/detection_tables.h @@ -49,6 +49,18 @@ static const SludgeGameDescription gameDescriptions[] = { 0 }, + { + { + "verbcoin", + "", + AD_ENTRY1s("Verb Coin.slg", "e39ec315dcbf3a1137481f0a5fe1617d", 980270), + Common::DE_DEU, + Common::kPlatformUnknown, + ADGF_NO_FLAGS, + GUIO0() + }, + 1 + }, { { diff --git a/engines/sludge/language.cpp b/engines/sludge/language.cpp index 5b7adeee3a..06f2a0842f 100644 --- a/engines/sludge/language.cpp +++ b/engines/sludge/language.cpp @@ -31,12 +31,12 @@ namespace Sludge { -int *languageTable; +uint *languageTable; Common::String *languageName; settingsStruct gameSettings; void makeLanguageTable(Common::File *table) { - languageTable = new int[gameSettings.numLanguages + 1]; + languageTable = new uint[gameSettings.numLanguages + 1]; if (!checkNew(languageTable)) return; @@ -64,7 +64,6 @@ int getLanguageForFileB() { if (languageTable[i] == gameSettings.languageID) indexNum = i; } - return indexNum; } diff --git a/engines/sludge/sludge.h b/engines/sludge/sludge.h index 6ed1380b2d..cb3d5248b0 100644 --- a/engines/sludge/sludge.h +++ b/engines/sludge/sludge.h @@ -65,7 +65,7 @@ public: SludgeEngine(OSystem *syst, const SludgeGameDescription *gameDesc); virtual ~SludgeEngine(); - int getGameType() const; + uint getLanguageID() const; const char *getGameId() const; uint32 getFeatures() const; Common::Language getLanguage() const; diff --git a/engines/sludge/sludger.cpp b/engines/sludge/sludger.cpp index c1b9af8865..620d50dbd6 100644 --- a/engines/sludge/sludger.cpp +++ b/engines/sludge/sludger.cpp @@ -511,14 +511,9 @@ bool initSludge(const Common::String &filename) { if (chdir(gameName)) return fatal("This game's preference folder is inaccessible!\nI can't access the following directory (maybe there's a file with the same name, or maybe it's read-protected):", gameName); #endif - // Get user settings - readIniFile(filename); + // Get language selected by user + gameSettings.languageID = g_sludge->getLanguageID(); - // There's no startup window on Linux and respecting this - // option from the ini file would disable commandline options. - saveIniFile(filename); - - // Now set file indices properly to the chosen language. languageNum = getLanguageForFileB(); if (languageNum < 0) -- cgit v1.2.3