From 23a0f5318c50cdf3dce19e4de0c98fb5ae1c2618 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sun, 7 Aug 2011 11:39:54 +0200 Subject: JANITORIAL: Remove trailing empty lines. --- common/util.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'common/util.cpp') diff --git a/common/util.cpp b/common/util.cpp index a7ec1a9de7..32315bc29a 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -402,4 +402,3 @@ void updateGameGUIOptions(const uint32 options, const String &langOption) { } } // End of namespace Common - -- cgit v1.2.3 From 84220d2ca05707f22a0242b1745caf0b657237a3 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sat, 6 Aug 2011 09:47:19 +0200 Subject: COMMON: Remove superfluous Common:: qualifiers. --- common/util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/util.cpp') diff --git a/common/util.cpp b/common/util.cpp index 32315bc29a..6bde6a6555 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -82,7 +82,7 @@ void hexdump(const byte *data, int len, int bytesPerLine, int startOffset) { #pragma mark - -bool parseBool(const Common::String &val, bool &valAsBool) { +bool parseBool(const String &val, bool &valAsBool) { if (val.equalsIgnoreCase("true") || val.equalsIgnoreCase("yes") || val.equals("1")) { -- cgit v1.2.3 From 2585de56b62ee3a4bd73cd0e9c061db32c277af4 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 20 Aug 2011 12:05:20 +0100 Subject: COMMON: Restore locale <-> Common::Language conversion utils This reverts commit 284b49aabc54590e1444f06561a815c2a3c5de7e. --- common/util.cpp | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'common/util.cpp') diff --git a/common/util.cpp b/common/util.cpp index 6bde6a6555..7f28dfa7fe 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -104,29 +104,29 @@ bool parseBool(const String &val, bool &valAsBool) { const LanguageDescription g_languages[] = { - { "zh-cn"/*, "zh_CN"*/, "Chinese (China)", ZH_CNA }, - { "zh"/*, "zh_TW"*/, "Chinese (Taiwan)", ZH_TWN }, - { "cz"/*, "cs_CZ"*/, "Czech", CZ_CZE }, - { "nl"/*, "nl_NL"*/, "Dutch", NL_NLD }, - { "en"/*, "en"*/, "English", EN_ANY }, // Generic English (when only one game version exist) - { "gb"/*, "en_GB"*/, "English (GB)", EN_GRB }, - { "us"/*, "en_US"*/, "English (US)", EN_USA }, - { "fr"/*, "fr_FR"*/, "French", FR_FRA }, - { "de"/*, "de_DE"*/, "German", DE_DEU }, - { "gr"/*, "el_GR"*/, "Greek", GR_GRE }, - { "he"/*, "he_IL"*/, "Hebrew", HE_ISR }, - { "hb"/*, "he_IL"*/, "Hebrew", HE_ISR }, // Deprecated - { "hu"/*, "hu_HU"*/, "Hungarian", HU_HUN }, - { "it"/*, "it_IT"*/, "Italian", IT_ITA }, - { "jp"/*, "ja_JP"*/, "Japanese", JA_JPN }, - { "kr"/*, "ko_KR"*/, "Korean", KO_KOR }, - { "nb"/*, "nb_NO"*/, "Norwegian Bokm\xE5l", NB_NOR }, // TODO Someone should verify the unix locale - { "pl"/*, "pl_PL"*/, "Polish", PL_POL }, - { "br"/*, "pt_BR"*/, "Portuguese", PT_BRA }, - { "ru"/*, "ru_RU"*/, "Russian", RU_RUS }, - { "es"/*, "es_ES"*/, "Spanish", ES_ESP }, - { "se"/*, "sv_SE"*/, "Swedish", SE_SWE }, - { 0/*, 0*/, 0, UNK_LANG } + { "zh-cn", "zh_CN", "Chinese (China)", ZH_CNA }, + { "zh", "zh_TW", "Chinese (Taiwan)", ZH_TWN }, + { "cz", "cs_CZ", "Czech", CZ_CZE }, + { "nl", "nl_NL", "Dutch", NL_NLD }, + { "en", "en", "English", EN_ANY }, // Generic English (when only one game version exist) + { "gb", "en_GB", "English (GB)", EN_GRB }, + { "us", "en_US", "English (US)", EN_USA }, + { "fr", "fr_FR", "French", FR_FRA }, + { "de", "de_DE", "German", DE_DEU }, + { "gr", "el_GR", "Greek", GR_GRE }, + { "he", "he_IL", "Hebrew", HE_ISR }, + { "hb", "he_IL", "Hebrew", HE_ISR }, // Deprecated + { "hu", "hu_HU", "Hungarian", HU_HUN }, + { "it", "it_IT", "Italian", IT_ITA }, + { "jp", "ja_JP", "Japanese", JA_JPN }, + { "kr", "ko_KR", "Korean", KO_KOR }, + { "nb", "nb_NO", "Norwegian Bokm\xE5l", NB_NOR }, // TODO Someone should verify the unix locale + { "pl", "pl_PL", "Polish", PL_POL }, + { "br", "pt_BR", "Portuguese", PT_BRA }, + { "ru", "ru_RU", "Russian", RU_RUS }, + { "es", "es_ES", "Spanish", ES_ESP }, + { "se", "sv_SE", "Swedish", SE_SWE }, + { 0, 0, 0, UNK_LANG } }; Language parseLanguage(const String &str) { @@ -142,7 +142,7 @@ Language parseLanguage(const String &str) { return UNK_LANG; } -/*Language parseLanguageFromLocale(const char *locale) { +Language parseLanguageFromLocale(const char *locale) { if (!locale || !*locale) return UNK_LANG; @@ -153,7 +153,7 @@ Language parseLanguage(const String &str) { } return UNK_LANG; -}*/ +} const char *getLanguageCode(Language id) { const LanguageDescription *l = g_languages; @@ -164,14 +164,14 @@ const char *getLanguageCode(Language id) { return 0; } -/*const char *getLanguageLocale(Language id) { +const char *getLanguageLocale(Language id) { const LanguageDescription *l = g_languages; for (; l->code; ++l) { if (l->id == id) return l->unixLocale; } return 0; -}*/ +} const char *getLanguageDescription(Language id) { const LanguageDescription *l = g_languages; -- cgit v1.2.3 From 03d3b683d2044d456e2ca0c0d1c05cfc75f3739c Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 20 Aug 2011 15:11:47 +0100 Subject: I18N: Added comments to some of obscure translatable strings --- common/util.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'common/util.cpp') diff --git a/common/util.cpp b/common/util.cpp index 7f28dfa7fe..699950dac3 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -271,6 +271,7 @@ const char *getPlatformDescription(Platform id) { const RenderModeDescription g_renderModes[] = { + // I18N: Hercules is graphics card name { "hercGreen", _s("Hercules Green"), kRenderHercG }, { "hercAmber", _s("Hercules Amber"), kRenderHercA }, { "cga", "CGA", kRenderCGA }, -- cgit v1.2.3 From 77c65648b1db8f8b7b245510681eafd856798d26 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 23 Oct 2011 15:14:41 +0100 Subject: AD: Swtich GUI options to a char array. This eliminates nasty limitation of caping number of flags to 31. Current code has limitation of 255 flags, though. Only SCUMM engine is converted, rest do not even compile. Detection of fan talkie MI is broken as it has to be implemented differently. --- common/util.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'common/util.cpp') diff --git a/common/util.cpp b/common/util.cpp index 699950dac3..bd2ebc4937 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -315,7 +315,7 @@ const char *getRenderModeDescription(RenderMode id) { } const struct GameOpt { - uint32 option; + const char *option; const char *desc; } g_gameOptions[] = { { GUIO_NOSUBTITLES, "sndNoSubs" }, @@ -341,9 +341,9 @@ const struct GameOpt { { GUIO_NONE, 0 } }; -bool checkGameGUIOption(GameGUIOption option, const String &str) { +bool checkGameGUIOption(const String &option, const String &str) { for (int i = 0; g_gameOptions[i].desc; i++) { - if (g_gameOptions[i].option & option) { + if (option.contains(g_gameOptions[i].option)) { if (str.contains(g_gameOptions[i].desc)) return true; else @@ -370,21 +370,21 @@ const String getGameGUIOptionsDescriptionLanguage(Language lang) { return String(String("lang_") + getLanguageDescription(lang)); } -uint32 parseGameGUIOptions(const String &str) { - uint32 res = 0; +String parseGameGUIOptions(const String &str) { + Common::String res; for (int i = 0; g_gameOptions[i].desc; i++) if (str.contains(g_gameOptions[i].desc)) - res |= g_gameOptions[i].option; + res += g_gameOptions[i].option; return res; } -const String getGameGUIOptionsDescription(uint32 options) { +const String getGameGUIOptionsDescription(const String &options) { String res = ""; for (int i = 0; g_gameOptions[i].desc; i++) - if (options & g_gameOptions[i].option) + if (options.contains(g_gameOptions[i].option[0])) res += String(g_gameOptions[i].desc) + " "; res.trim(); @@ -392,10 +392,10 @@ const String getGameGUIOptionsDescription(uint32 options) { return res; } -void updateGameGUIOptions(const uint32 options, const String &langOption) { +void updateGameGUIOptions(const String &options, const String &langOption) { const String newOptionString = getGameGUIOptionsDescription(options) + " " + langOption; - if ((options && !ConfMan.hasKey("guioptions")) || + if ((!options.empty() && !ConfMan.hasKey("guioptions")) || (ConfMan.hasKey("guioptions") && ConfMan.get("guioptions") != newOptionString)) { ConfMan.set("guioptions", newOptionString); ConfMan.flushToDisk(); -- cgit v1.2.3