diff --git a/common/language.cpp b/common/language.cpp index b2dd7794f18..c974a09472b 100644 --- a/common/language.cpp +++ b/common/language.cpp @@ -22,6 +22,7 @@ #include "common/language.h" #include "common/gui_options.h" #include "common/str.h" +#include "common/algorithm.h" namespace Common { @@ -178,4 +179,15 @@ const String getGameGUIOptionsDescriptionLanguage(Language lang) { return String("lang_") + getLanguageDescription(lang); } +List getLanguageList() { + List list; + + for (const LanguageDescription *l = g_languages; l->code; ++l) + list.push_back(l->code); + + Common::sort(list.begin(), list.end()); + + return list; +} + } // End of namespace Common diff --git a/common/language.h b/common/language.h index b2d866bcd9f..eb579c48566 100644 --- a/common/language.h +++ b/common/language.h @@ -23,6 +23,7 @@ #define COMMON_LANGUAGE_H #include "common/scummsys.h" +#include "common/list.h" namespace Common { @@ -105,6 +106,8 @@ const String getGameGUIOptionsDescriptionLanguage(Common::Language lang); // TODO: Document this GUIO related function bool checkGameGUIOptionLanguage(Common::Language lang, const String &str); +List getLanguageList(); + /** @} */ } // End of namespace Common diff --git a/common/platform.cpp b/common/platform.cpp index 277bd62fd13..315ade937d1 100644 --- a/common/platform.cpp +++ b/common/platform.cpp @@ -21,6 +21,7 @@ #include "common/platform.h" #include "common/str.h" +#include "common/algorithm.h" namespace Common { @@ -120,4 +121,15 @@ const char *getPlatformDescription(Platform id) { return l->description; } +List getPlatformList() { + List list; + + for (const PlatformDescription *l = g_platforms; l->code; ++l) + list.push_back(l->code2); + + Common::sort(list.begin(), list.end()); + + return list; +} + } // End of namespace Common diff --git a/common/platform.h b/common/platform.h index 8bd4ebf834b..f4dc4ab96fd 100644 --- a/common/platform.h +++ b/common/platform.h @@ -23,6 +23,7 @@ #define COMMON_PLATFORM_H #include "common/scummsys.h" +#include "common/list.h" namespace Common { @@ -99,6 +100,8 @@ extern const char *getPlatformCode(Platform id); extern const char *getPlatformAbbrev(Platform id); extern const char *getPlatformDescription(Platform id); +List getPlatformList(); + /** @} */ } // End of namespace Common