diff options
author | Tony Puccinelli | 2010-08-10 23:21:08 +0000 |
---|---|---|
committer | Tony Puccinelli | 2010-08-10 23:21:08 +0000 |
commit | 682807f0e916b189c69b60765418ee1ccc327cbf (patch) | |
tree | e8b220b934f6b14d4dac290181fce0c1b209579a /base/main.cpp | |
parent | 83f1531cb8fa5ba43c246143ecdde2cb1d140a8e (diff) | |
parent | fffec23a02cc88ed8daba0a3b50007b7e220c075 (diff) | |
download | scummvm-rg350-682807f0e916b189c69b60765418ee1ccc327cbf.tar.gz scummvm-rg350-682807f0e916b189c69b60765418ee1ccc327cbf.tar.bz2 scummvm-rg350-682807f0e916b189c69b60765418ee1ccc327cbf.zip |
merged trunk into branch, reverted Cruise Singleton changes
svn-id: r51961
Diffstat (limited to 'base/main.cpp')
-rw-r--r-- | base/main.cpp | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/base/main.cpp b/base/main.cpp index 8067bd0a26..08d59aafab 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -47,12 +47,14 @@ #include "common/fs.h" #include "common/system.h" #include "common/tokenizer.h" +#include "common/translation.h" #include "gui/GuiManager.h" #include "gui/message.h" #include "gui/error.h" #include "sound/audiocd.h" +#include "sound/mididrv.h" #include "backends/keymapper/keymapper.h" @@ -102,7 +104,7 @@ static const EnginePlugin *detectPlugin() { // Query the plugins and find one that will handle the specified gameid printf("User picked target '%s' (gameid '%s')...\n", ConfMan.getActiveDomainName().c_str(), gameid.c_str()); - printf(" Looking for a plugin supporting this gameid... "); + printf("%s", " Looking for a plugin supporting this gameid... "); #if defined(NEW_PLUGIN_DESIGN_FIRST_REFINEMENT) && defined(DYNAMIC_MODULES) GameDescriptor game = EngineMan.findGameOnePlugAtATime(gameid, &plugin); @@ -146,7 +148,7 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const // Is a separate dialog here still required? //GUI::displayErrorDialog("ScummVM could not find any game in the specified directory!"); - const char *errMsg = Common::errorToString(err); + const char *errMsg = _(Common::errorToString(err)); warning("%s failed to instantiate engine: %s (target '%s', path '%s')", plugin->getName(), @@ -205,7 +207,7 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const while (!tokenizer.empty()) { Common::String token = tokenizer.nextToken(); if (!DebugMan.enableDebugChannel(token)) - warning("Engine does not support debug level '%s'", token.c_str()); + warning(_("Engine does not support debug level '%s'"), token.c_str()); } // Inform backend that the engine is about to be run @@ -273,22 +275,22 @@ static void setupKeymapper(OSystem &system) { mapper->registerHardwareKeySet(keySet); // Now create the global keymap - act = new Action(globalMap, "MENU", "Menu", kGenericActionType, kSelectKeyType); + act = new Action(globalMap, "MENU", _("Menu"), kGenericActionType, kSelectKeyType); act->addKeyEvent(KeyState(KEYCODE_F5, ASCII_F5, 0)); - act = new Action(globalMap, "SKCT", "Skip", kGenericActionType, kActionKeyType); + act = new Action(globalMap, "SKCT", _("Skip"), kGenericActionType, kActionKeyType); act->addKeyEvent(KeyState(KEYCODE_ESCAPE, ASCII_ESCAPE, 0)); - act = new Action(globalMap, "PAUS", "Pause", kGenericActionType, kStartKeyType); + act = new Action(globalMap, "PAUS", _("Pause"), kGenericActionType, kStartKeyType); act->addKeyEvent(KeyState(KEYCODE_SPACE, ' ', 0)); - act = new Action(globalMap, "SKLI", "Skip line", kGenericActionType, kActionKeyType); + act = new Action(globalMap, "SKLI", _("Skip line"), kGenericActionType, kActionKeyType); act->addKeyEvent(KeyState(KEYCODE_PERIOD, '.', 0)); - act = new Action(globalMap, "VIRT", "Display keyboard", kVirtualKeyboardActionType); + act = new Action(globalMap, "VIRT", _("Display keyboard"), kVirtualKeyboardActionType); act->addKeyEvent(KeyState(KEYCODE_F7, ASCII_F7, 0)); - act = new Action(globalMap, "REMP", "Remap keys", kKeyRemapActionType); + act = new Action(globalMap, "REMP", _("Remap keys"), kKeyRemapActionType); act->addKeyEvent(KeyState(KEYCODE_F8, ASCII_F8, 0)); mapper->addGlobalKeymap(globalMap); @@ -324,6 +326,8 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { // Update the config file ConfMan.set("versioninfo", gScummVMVersion, Common::ConfigManager::kApplicationDomain); + // Enable translation + TransMan.setLanguage(ConfMan.get("gui_language").c_str()); // Load and setup the debuglevel and the debug flags. We do this at the // soonest possible moment to ensure debug output starts early on, if @@ -347,6 +351,16 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { PluginManager::instance().loadPlugins(); #endif + // If we received an invalid music parameter via command line we check this here. + // We can't check this before loading the music plugins. + // On the other hand we cannot load the plugins before we know the file paths (in case of external plugins). + if (settings.contains("music-driver")) { + if (MidiDriver::getMusicType(MidiDriver::getDeviceHandle(settings["music-driver"])) == MT_INVALID) { + warning("Unrecognized music driver '%s'. Switching to default device", settings["music-driver"].c_str()); + settings["music-driver"] = "auto"; + } + } + // Process the remaining command line settings. Must be done after the // config file and the plugins have been loaded. if (!Base::processSettings(command, settings)) @@ -394,7 +408,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { // Did an error occur ? if (result != Common::kNoError) { // Shows an informative error dialog if starting the selected game failed. - GUI::displayErrorDialog(result, "Error running game:"); + GUI::displayErrorDialog(result, _("Error running game:")); } // Quit unless an error occurred, or Return to launcher was requested @@ -420,8 +434,8 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { } else { // A dialog would be nicer, but we don't have any // screen to draw on yet. - warning("Could not find any engine capable of running the selected game"); - GUI::displayErrorDialog("Could not find any engine capable of running the selected game"); + warning("%s", _("Could not find any engine capable of running the selected game")); + GUI::displayErrorDialog(_("Could not find any engine capable of running the selected game")); } // We will destroy the AudioCDManager singleton here to save some memory. |