diff options
| author | Max Horn | 2006-04-15 17:39:14 +0000 |
|---|---|---|
| committer | Max Horn | 2006-04-15 17:39:14 +0000 |
| commit | ad45318328e23b76e346414c62ef4c22d8ebe059 (patch) | |
| tree | 9956847a38797471f73fd26ec3203dbbae6efd78 /backends | |
| parent | dc5f513bcf7b6177a4d8f7e10fb4ed4dd55d7588 (diff) | |
| download | scummvm-rg350-ad45318328e23b76e346414c62ef4c22d8ebe059.tar.gz scummvm-rg350-ad45318328e23b76e346414c62ef4c22d8ebe059.tar.bz2 scummvm-rg350-ad45318328e23b76e346414c62ef4c22d8ebe059.zip | |
Removed GameDetector::_gameid in favor of using a config manager entry
svn-id: r21915
Diffstat (limited to 'backends')
| -rw-r--r-- | backends/symbian/src/SymbianActions.cpp | 23 | ||||
| -rw-r--r-- | backends/symbian/src/SymbianOS.cpp | 2 | ||||
| -rw-r--r-- | backends/wince/CEActionsPocket.cpp | 21 | ||||
| -rw-r--r-- | backends/wince/CEActionsSmartphone.cpp | 24 | ||||
| -rw-r--r-- | backends/wince/wince-sdl.cpp | 10 |
5 files changed, 41 insertions, 39 deletions
diff --git a/backends/symbian/src/SymbianActions.cpp b/backends/symbian/src/SymbianActions.cpp index 42679b889f..4844bc27b2 100644 --- a/backends/symbian/src/SymbianActions.cpp +++ b/backends/symbian/src/SymbianActions.cpp @@ -62,8 +62,8 @@ const int ACTIONS_DEFAULT[ACTION_LAST] = { 0, 0, 0, 0, 0x11a, 0x11b, SDLK_MENU, #endif // creator function according to Factory Pattern -void SymbianActions::init(const Common::String &gameid) { - _instance = new SymbianActions(gameid); +void SymbianActions::init() { + _instance = new SymbianActions(); } @@ -83,8 +83,8 @@ int SymbianActions::version() { return ACTION_VERSION; } -SymbianActions::SymbianActions(const Common::String &gameid) : - Actions(gameid) { +SymbianActions::SymbianActions() + : Actions() { int i; for (i = 0; i < ACTION_LAST; i++) { @@ -121,17 +121,18 @@ void SymbianActions::initInstanceMain(OSystem *mainSystem) { } void SymbianActions::initInstanceGame() { - bool is_simon = (strncmp(_gameid.c_str(), "simon", 5) == 0); - bool is_sky = (_gameid == "sky"); - bool is_queen = (_gameid == "queen"); - bool is_gob = (strncmp(_gameid.c_str(), "gob", 3) == 0); - bool is_ite = ((strncmp(_gameid.c_str(), "ite", 3) == 0) || - (strncmp(_gameid.c_str(), "ihnm", 4) == 0)); + String gameid(ConfMan.get("gameid")); + bool is_simon = (strncmp(gameid.c_str(), "simon", 5) == 0); + bool is_sky = (gameid == "sky"); + bool is_queen = (gameid == "queen"); + bool is_gob = (strncmp(gameid.c_str(), "gob", 3) == 0); + bool is_ite = ((strncmp(gameid.c_str(), "ite", 3) == 0) || + (strncmp(gameid.c_str(), "ihnm", 4) == 0)); Actions::initInstanceGame(); // See if a right click mapping could be needed - if (is_sky || _gameid == "samnmax" || is_gob) + if (is_sky || gameid == "samnmax" || is_gob) _right_click_needed = true; // Initialize keys for different actions diff --git a/backends/symbian/src/SymbianOS.cpp b/backends/symbian/src/SymbianOS.cpp index d7539fcfe9..13dac270fd 100644 --- a/backends/symbian/src/SymbianOS.cpp +++ b/backends/symbian/src/SymbianOS.cpp @@ -377,7 +377,7 @@ void OSystem_SDL_Symbian::setWindowCaption(const char *caption) { } void OSystem_SDL_Symbian::check_mappings() { - if (!GUI::Actions::Instance()->_gameid.size() || GUI::Actions::Instance()->initialized()) + if (ConfMan.get("gameid").empty() || GUI::Actions::Instance()->initialized()) return; GUI::Actions::Instance()->initInstanceGame(); diff --git a/backends/wince/CEActionsPocket.cpp b/backends/wince/CEActionsPocket.cpp index 4050cd136b..3c2b3e3e4d 100644 --- a/backends/wince/CEActionsPocket.cpp +++ b/backends/wince/CEActionsPocket.cpp @@ -98,21 +98,22 @@ void CEActionsPocket::initInstanceMain(OSystem *mainSystem) { } void CEActionsPocket::initInstanceGame() { - bool is_simon = (strncmp(_gameid.c_str(), "simon", 5) == 0); - bool is_sword1 = (_gameid == "sword1"); - bool is_sword2 = (strcmp(_gameid.c_str(), "sword2") == 0); - bool is_queen = (_gameid == "queen"); - bool is_sky = (_gameid == "sky"); - bool is_comi = (strncmp(_gameid.c_str(), "comi", 4) == 0); - bool is_gob = (strncmp(_gameid.c_str(), "gob", 3) == 0); - bool is_ite = ((strncmp(_gameid.c_str(), "ite", 3) == 0) || - (strncmp(_gameid.c_str(), "ihnm", 4) == 0)); + String gameid(ConfMan.get("gameid")); + bool is_simon = (strncmp(gameid.c_str(), "simon", 5) == 0); + bool is_sword1 = (gameid == "sword1"); + bool is_sword2 = (strcmp(gameid.c_str(), "sword2") == 0); + bool is_queen = (gameid == "queen"); + bool is_sky = (gameid == "sky"); + bool is_comi = (strncmp(gameid.c_str(), "comi", 4) == 0); + bool is_gob = (strncmp(gameid.c_str(), "gob", 3) == 0); + bool is_ite = ((strncmp(gameid.c_str(), "ite", 3) == 0) || + (strncmp(gameid.c_str(), "ihnm", 4) == 0)); GUI_Actions::initInstanceGame(); // See if a right click mapping could be needed if (is_sword1 || is_sword2 || is_sky || is_queen || is_comi || is_gob || - _gameid == "samnmax") + gameid == "samnmax") _right_click_needed = true; // See if a "hide toolbar" mapping could be needed diff --git a/backends/wince/CEActionsSmartphone.cpp b/backends/wince/CEActionsSmartphone.cpp index 6f1ee62701..5817fac744 100644 --- a/backends/wince/CEActionsSmartphone.cpp +++ b/backends/wince/CEActionsSmartphone.cpp @@ -60,8 +60,8 @@ const int ACTIONS_SMARTPHONE_DEFAULT[] = { 0x111, 0x112, 0x114, 0x113, 0x11a, 0x const int ACTIONS_SMARTPHONE_DEFAULT[] = { '4', '6', '8', '2', 0x11a, 0x11b, '0', VK_ESCAPE, '9', 0, VK_RETURN }; #endif -void CEActionsSmartphone::init(const Common::String &gameid) { - _instance = new CEActionsSmartphone(gameid); +void CEActionsSmartphone::init() { + _instance = new CEActionsSmartphone(); } @@ -81,9 +81,8 @@ int CEActionsSmartphone::version() { return SMARTPHONE_ACTION_VERSION; } -CEActionsSmartphone::CEActionsSmartphone(const Common::String &gameid) : -GUI::Actions(gameid) -{ +CEActionsSmartphone::CEActionsSmartphone() +: GUI::Actions() { int i; for (i=0; i<SMARTPHONE_ACTION_LAST; i++) { @@ -112,17 +111,18 @@ void CEActionsSmartphone::initInstanceMain(OSystem *mainSystem) { } void CEActionsSmartphone::initInstanceGame() { - bool is_simon = (strncmp(_gameid.c_str(), "simon", 5) == 0); - bool is_sky = (_gameid == "sky"); - bool is_queen = (_gameid == "queen"); - bool is_gob = (strncmp(_gameid.c_str(), "gob", 3) == 0); - bool is_ite = ((strncmp(_gameid.c_str(), "ite", 3) == 0) || - (strncmp(_gameid.c_str(), "ihnm", 4) == 0)); + String gameid(ConfMan.get("gameid")); + bool is_simon = (strncmp(gameid.c_str(), "simon", 5) == 0); + bool is_sky = (gameid == "sky"); + bool is_queen = (gameid == "queen"); + bool is_gob = (strncmp(gameid.c_str(), "gob", 3) == 0); + bool is_ite = ((strncmp(gameid.c_str(), "ite", 3) == 0) || + (strncmp(gameid.c_str(), "ihnm", 4) == 0)); GUI_Actions::initInstanceGame(); // See if a right click mapping could be needed - if (is_sky || _gameid == "samnmax" || is_gob) + if (is_sky || gameid == "samnmax" || is_gob) _right_click_needed = true; // Initialize keys for different actions diff --git a/backends/wince/wince-sdl.cpp b/backends/wince/wince-sdl.cpp index 885e2ce242..1f877e77ba 100644 --- a/backends/wince/wince-sdl.cpp +++ b/backends/wince/wince-sdl.cpp @@ -522,7 +522,7 @@ bool OSystem_WINCE3::checkOggHighSampleRate() { void OSystem_WINCE3::get_sample_rate() { // Force at least medium quality FM synthesis for FOTAQ - Common::String gameid(GUI::Actions::Instance()->_gameid); + Common::String gameid(ConfMan.get("gameid")); if (gameid == "queen") { if (!((ConfMan.hasKey("FM_high_quality") && ConfMan.getBool("FM_high_quality")) || (ConfMan.hasKey("FM_medium_quality") && ConfMan.getBool("FM_medium_quality")))) { @@ -653,9 +653,9 @@ bool OSystem_WINCE3::setSoundCallback(SoundProc proc, void *param) { void OSystem_WINCE3::check_mappings() { CEActionsPocket *instance; - Common::String gameid(GUI::Actions::Instance()->_gameid); + Common::String gameid(ConfMan.get("gameid")); - if (!gameid.size() || GUI_Actions::Instance()->initialized()) + if (gameid.empty() || GUI_Actions::Instance()->initialized()) return; GUI_Actions::Instance()->initInstanceGame(); @@ -707,10 +707,10 @@ void OSystem_WINCE3::check_mappings() { } void OSystem_WINCE3::update_game_settings() { - Common::String gameid(GUI::Actions::Instance()->_gameid); + Common::String gameid(ConfMan.get("gameid")); // Finish panel initialization - if (!_panelInitialized && gameid.size()) { + if (!_panelInitialized && !gameid.empty()) { Panel *panel; _panelInitialized = true; // Add the main panel |
