Permalink
Browse files

SLUDGE: use multiple entries for language selection

  • Loading branch information...
yinsimei authored and sev- committed Jul 12, 2017
1 parent 6b794d3 commit ef5e8091f60ffe8f031e26c4c669b60ba11e0cfc
@@ -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; }
@@ -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
},
{
{
@@ -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;
}
View
@@ -65,7 +65,7 @@ class SludgeEngine: public Engine {
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;
@@ -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)

0 comments on commit ef5e809

Please sign in to comment.