aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorMax Horn2003-10-17 15:35:46 +0000
committerMax Horn2003-10-17 15:35:46 +0000
commita70460833e498620122bd60a1e6708d2a263626a (patch)
tree5f01fea8d1ea7409f584a25ac2e6329322ebbc93 /base
parent4fe33a1dae09704835ea29608cdfcdf46eabcd7c (diff)
downloadscummvm-rg350-a70460833e498620122bd60a1e6708d2a263626a.tar.gz
scummvm-rg350-a70460833e498620122bd60a1e6708d2a263626a.tar.bz2
scummvm-rg350-a70460833e498620122bd60a1e6708d2a263626a.zip
moved platform/language constants to common/util.*
svn-id: r10862
Diffstat (limited to 'base')
-rw-r--r--base/gameDetector.cpp58
-rw-r--r--base/gameDetector.h23
2 files changed, 2 insertions, 79 deletions
diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp
index d3a2ecc5a9..38e71aaa4f 100644
--- a/base/gameDetector.cpp
+++ b/base/gameDetector.cpp
@@ -151,28 +151,6 @@ static const struct GraphicsMode gfx_modes[] = {
{0, 0, 0}
};
-struct LanguageDescription {
- const char *name;
- const char *description;
- Language id;
-};
-
-static const struct LanguageDescription languages[] = {
- {"en", "English", EN_USA},
- {"de", "German", DE_DEU},
- {"fr", "French", FR_FRA},
- {"it", "Italian", IT_ITA},
- {"pt", "Portuguese", PT_BRA},
- {"es", "Spanish", ES_ESP},
- {"jp", "Japanese", JA_JPN},
- {"zh", "Chinese (Taiwan)", ZH_TWN},
- {"kr", "Korean", KO_KOR},
- {"gb", "English", EN_GRB},
- {"se", "Swedish", SE_SWE},
- {"hb", "Hebrew", HB_HEB},
- {0, 0, UNK_LANG}
-};
-
GameDetector::GameDetector() {
// Graphics
@@ -365,7 +343,7 @@ void GameDetector::parseCommandLine(int argc, char **argv) {
break;
case 'q':
HANDLE_OPTION();
- if (parseLanguage(option) == UNK_LANG)
+ if (Common::parseLanguage(option) == Common::UNK_LANG)
goto ShowHelpAndExit;
ConfMan.set("language", option);
break;
@@ -409,7 +387,7 @@ void GameDetector::parseCommandLine(int argc, char **argv) {
// Long options. Let the fun begin!
if (!strncmp(s, "platform=", 9)) {
s += 9;
- int platform = parsePlatform(s);
+ int platform = Common::parsePlatform(s);
if (platform == kPlatformUnknown)
goto ShowHelpAndExit;
@@ -491,38 +469,6 @@ int GameDetector::parseGraphicsMode(const String &str) {
return -1;
}
-Language GameDetector::parseLanguage(const String &str) {
- if (str.isEmpty())
- return UNK_LANG;
-
- const char *s = str.c_str();
- const LanguageDescription *l = languages;
- while (l->name) {
- if (!scumm_stricmp(l->name, s))
- return l->id;
- l++;
- }
-
- return UNK_LANG;
-}
-
-Platform GameDetector::parsePlatform(const String &str) {
- if (str.isEmpty())
- return kPlatformUnknown;
-
- const char *s = str.c_str();
- if (!scumm_stricmp(s, "pc"))
- return kPlatformPC;
- else if (!scumm_stricmp(s, "amiga") || !scumm_stricmp(s, "1"))
- return kPlatformAmiga;
- else if (!scumm_stricmp(s, "atari-st") || !scumm_stricmp(s, "atari") || !scumm_stricmp(s, "2"))
- return kPlatformAtariST;
- else if (!scumm_stricmp(s, "macintosh") || !scumm_stricmp(s, "mac") || !scumm_stricmp(s, "3"))
- return kPlatformMacintosh;
- else
- return kPlatformUnknown;
-}
-
int GameDetector::parseMusicDriver(const String &str) {
if (str.isEmpty())
return -1;
diff --git a/base/gameDetector.h b/base/gameDetector.h
index 81213a3836..bcc3e45d31 100644
--- a/base/gameDetector.h
+++ b/base/gameDetector.h
@@ -38,27 +38,6 @@ enum {
GF_DEFAULT_TO_1X_SCALER = 1 << 31
};
-/**
- * List of language ids.
- * @note The order and mappings of the values 0..8 are *required* to stay the
- * way they are now, as scripts in COMI rely on them. So don't touch them.
- */
-enum Language {
- UNK_LANG = -1, // Use default language (i.e. none specified)
- EN_USA = 0,
- DE_DEU = 1,
- FR_FRA = 2,
- IT_ITA = 3,
- PT_BRA = 4,
- ES_ESP = 5,
- JA_JPN = 6,
- ZH_TWN = 7,
- KO_KOR = 8,
- SE_SWE = 9,
- EN_GRB = 10,
- HB_HEB = 20
-};
-
enum Platform {
kPlatformUnknown = -1,
kPlatformPC = 0,
@@ -115,8 +94,6 @@ public:
static int parseGraphicsMode(const String &s); // Used in main()
static int parseMusicDriver(const String &s);
- static Language parseLanguage(const String &s);
- static Platform parsePlatform(const String &s);
static GameSettings findGame(const String &gameName, const Plugin **plugin = NULL);