TWINE: fixed language detection for the scummvm language descriptions

This commit is contained in:
Martin Gerhardy 2020-10-22 10:27:52 +02:00 committed by Eugene Sandulenko
parent cb96e1f388
commit b833a88e43
2 changed files with 12 additions and 17 deletions

View File

@ -172,6 +172,7 @@ static int getLanguageTypeIndex(const char *languageName) {
}
}
debug("Failed to detect language %s - falling back to english", languageName);
return 0; // English
}
@ -181,12 +182,9 @@ static int getLanguageTypeIndex(const char *languageName) {
void TwinEEngine::initConfigurations() {
// TODO: use existing entries for some of the settings - like volume and so on.
Common::String language = ConfGetOrDefault("Language", Common::getLanguageDescription(_gameLang));
cfgfile.LanguageId = getLanguageTypeIndex(language.c_str()) + 1;
Common::String languageCD = ConfGetOrDefault("LanguageCD", "None");
cfgfile.LanguageCDId = getLanguageTypeIndex(languageCD.c_str()) + 1;
const char *lng = Common::getLanguageDescription(_gameLang);
cfgfile.LanguageId = getLanguageTypeIndex(lng) + 1;
cfgfile.LanguageCDId = getLanguageTypeIndex(lng) + 1;
cfgfile.FlagDisplayText = ConfGetOrDefault("FlagDisplayText", "ON") == "ON";
cfgfile.FlagKeepVoice = ConfGetOrDefault("FlagKeepVoice", "OFF") == "ON";
const Common::String midiType = ConfGetOrDefault("MidiType", "auto");
@ -206,7 +204,6 @@ void TwinEEngine::initConfigurations() {
}
}
cfgfile.Version = ConfGetIntOrDefault("Version", EUROPE_VERSION);
cfgfile.FullScreen = ConfGetIntOrDefault("FullScreen", 1) == 1;
cfgfile.UseCD = ConfGetIntOrDefault("UseCD", 0);
cfgfile.Sound = ConfGetIntOrDefault("Sound", 1);
cfgfile.Movie = ConfGetIntOrDefault("Movie", CONF_MOVIE_FLA);
@ -221,9 +218,6 @@ void TwinEEngine::initConfigurations() {
}
void TwinEEngine::initEngine() {
// getting configuration file
initConfigurations();
/** Engine current version */
const char *ENGINE_VERSION = "0.2.2";
@ -236,6 +230,9 @@ void TwinEEngine::initEngine() {
debug("The original Little Big Adventure game is:");
debug("(c)1994 by Adeline Software International, All Rights Reserved.");
// getting configuration file
initConfigurations();
_screens->clearScreen();
// Check if LBA CD-Rom is on drive

View File

@ -63,11 +63,11 @@ static const struct TwinELanguage {
const char *id;
} LanguageTypes[] = {
{"English", "EN_"},
{"Francais", "FR_"},
{"Deutsch", "DE_"},
{"Espanol", "SP_"},
{"Italiano", "IT_"},
{"Portugues", ""}};
{"French", "FR_"},
{"German", "DE_"},
{"Spanish", "SP_"},
{"Italian", "IT_"},
{"Portuguese", ""}};
enum MidiFileType {
MIDIFILE_NONE,
@ -101,8 +101,6 @@ struct ConfigFile {
MidiFileType MidiType = MIDIFILE_NONE;
/** *Game version */
int32 Version = 0;
/** To allow fullscreen or window mode. */
bool FullScreen = false;
/** If you want to use the LBA CD or not */
int32 UseCD = 0;
/** Allow various sound types */