diff options
| author | Willem Jan Palenstijn | 2013-04-18 23:35:23 +0200 |
|---|---|---|
| committer | Willem Jan Palenstijn | 2013-05-08 20:40:58 +0200 |
| commit | 9c2341678ef4984bf92b3878295250faf980b066 (patch) | |
| tree | 2fb4805e05e16b9924e80c9947e6bad723b28c4b /base | |
| parent | 8172d679df5148a4a32f46074b20cb6caf91844f (diff) | |
| parent | a5f4ff36ffc386d48f2da49387a9655ce9295a4d (diff) | |
| download | scummvm-rg350-9c2341678ef4984bf92b3878295250faf980b066.tar.gz scummvm-rg350-9c2341678ef4984bf92b3878295250faf980b066.tar.bz2 scummvm-rg350-9c2341678ef4984bf92b3878295250faf980b066.zip | |
Merge branch 'master'
Diffstat (limited to 'base')
| -rw-r--r-- | base/commandLine.cpp | 29 | ||||
| -rw-r--r-- | base/main.cpp | 50 | ||||
| -rw-r--r-- | base/plugins.cpp | 8 | ||||
| -rw-r--r-- | base/version.cpp | 4 |
4 files changed, 67 insertions, 24 deletions
diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 6550f60670..08838167e9 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -33,12 +33,15 @@ #include "base/version.h" #include "common/config-manager.h" +#include "common/fs.h" +#include "common/rendermode.h" #include "common/system.h" #include "common/textconsole.h" -#include "common/fs.h" #include "gui/ThemeEngine.h" +#include "audio/musicplugin.h" + #define DETECTOR_TESTING_HACK #define UPGRADE_ALL_TARGETS_HACK @@ -81,6 +84,7 @@ static const char HELP_STRING[] = " --themepath=PATH Path to where GUI themes are stored\n" " --list-themes Display list of all usable GUI themes\n" " -e, --music-driver=MODE Select music driver (see README for details)\n" + " --list-audio-devices List all available audio devices\n" " -q, --language=LANG Select language (en,de,fr,it,pt,es,jp,zh,kr,se,gb,\n" " hb,ru,cz)\n" " -m, --music-volume=NUM Set the music volume, 0-255 (default: 192)\n" @@ -274,7 +278,7 @@ void registerDefaults() { // resp. between "--some-option" and "--no-some-option". #define DO_OPTION_BOOL(shortCmd, longCmd) \ if (isLongCmd ? (!strcmp(s+2, longCmd) || !strcmp(s+2, "no-"longCmd)) : (tolower(s[1]) == shortCmd)) { \ - bool boolValue = (islower(static_cast<unsigned char>(s[1])) != 0); \ + bool boolValue = (Common::isLower(s[1]) != 0); \ s += 2; \ if (isLongCmd) { \ boolValue = !strcmp(s, longCmd); \ @@ -381,6 +385,9 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha DO_OPTION('e', "music-driver") END_OPTION + DO_LONG_COMMAND("list-audio-devices") + END_OPTION + DO_LONG_OPTION_INT("output-rate") END_OPTION @@ -689,6 +696,21 @@ static void listThemes() { printf("%-14s %s\n", i->id.c_str(), i->name.c_str()); } +/** Lists all output devices */ +static void listAudioDevices() { + MusicPlugin::List pluginList = MusicMan.getPlugins(); + + printf("ID Description\n"); + printf("------------------------------ ------------------------------------------------\n"); + + for (MusicPlugin::List::const_iterator i = pluginList.begin(), iend = pluginList.end(); i != iend; ++i) { + MusicDevices deviceList = (**i)->getDevices(); + for (MusicDevices::iterator j = deviceList.begin(), jend = deviceList.end(); j != jend; ++j) { + printf("%-30s %s\n", Common::String::format("\"%s\"", j->getCompleteId().c_str()).c_str(), j->getCompleteName().c_str()); + } + } +} + #ifdef DETECTOR_TESTING_HACK static void runDetectorTest() { @@ -906,6 +928,9 @@ bool processSettings(Common::String &command, Common::StringMap &settings, Commo } else if (command == "list-themes") { listThemes(); return true; + } else if (command == "list-audio-devices") { + listAudioDevices(); + return true; } else if (command == "version") { printf("%s\n", gScummVMFullVersion); printf("Features compiled in: %s\n", gScummVMFeatures); diff --git a/base/main.cpp b/base/main.cpp index 5d0c0ea09a..391d911ae8 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -203,6 +203,9 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const warning(_("Engine does not support debug level '%s'"), token.c_str()); } + // Initialize any game-specific keymaps + engine->initKeymap(); + // Inform backend that the engine is about to be run system.engineInit(); @@ -212,6 +215,9 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const // Inform backend that the engine finished system.engineDone(); + // Clean up any game-specific keymaps + engine->deinitKeymap(); + // Free up memory delete engine; @@ -253,42 +259,52 @@ static void setupGraphics(OSystem &system) { } static void setupKeymapper(OSystem &system) { - #ifdef ENABLE_KEYMAPPER using namespace Common; Keymapper *mapper = system.getEventManager()->getKeymapper(); - Keymap *globalMap = new Keymap("global"); - Action *act; - HardwareKeySet *keySet; - keySet = system.getHardwareKeySet(); + HardwareInputSet *inputSet = system.getHardwareInputSet(); // Query backend for hardware keys and register them - mapper->registerHardwareKeySet(keySet); + mapper->registerHardwareInputSet(inputSet); // Now create the global keymap - act = new Action(globalMap, "MENU", _("Menu"), kGenericActionType, kSelectKeyType); - act->addKeyEvent(KeyState(KEYCODE_F5, ASCII_F5, 0)); + Keymap *primaryGlobalKeymap = new Keymap(kGlobalKeymapName); + Action *act; + act = new Action(primaryGlobalKeymap, "MENU", _("Menu")); + act->addEvent(EVENT_MAINMENU); - act = new Action(globalMap, "SKCT", _("Skip"), kGenericActionType, kActionKeyType); + act = new Action(primaryGlobalKeymap, "SKCT", _("Skip")); act->addKeyEvent(KeyState(KEYCODE_ESCAPE, ASCII_ESCAPE, 0)); - act = new Action(globalMap, "PAUS", _("Pause"), kGenericActionType, kStartKeyType); + act = new Action(primaryGlobalKeymap, "PAUS", _("Pause")); act->addKeyEvent(KeyState(KEYCODE_SPACE, ' ', 0)); - act = new Action(globalMap, "SKLI", _("Skip line"), kGenericActionType, kActionKeyType); + act = new Action(primaryGlobalKeymap, "SKLI", _("Skip line")); act->addKeyEvent(KeyState(KEYCODE_PERIOD, '.', 0)); - act = new Action(globalMap, "VIRT", _("Display keyboard"), kVirtualKeyboardActionType); - act->addKeyEvent(KeyState(KEYCODE_F7, ASCII_F7, 0)); +#ifdef ENABLE_VKEYBD + act = new Action(primaryGlobalKeymap, "VIRT", _("Display keyboard")); + act->addEvent(EVENT_VIRTUAL_KEYBOARD); +#endif + + act = new Action(primaryGlobalKeymap, "REMP", _("Remap keys")); + act->addEvent(EVENT_KEYMAPPER_REMAP); - act = new Action(globalMap, "REMP", _("Remap keys"), kKeyRemapActionType); - act->addKeyEvent(KeyState(KEYCODE_F8, ASCII_F8, 0)); + act = new Action(primaryGlobalKeymap, "FULS", _("Toggle FullScreen")); + act->addKeyEvent(KeyState(KEYCODE_RETURN, ASCII_RETURN, KBD_ALT)); - mapper->addGlobalKeymap(globalMap); + mapper->addGlobalKeymap(primaryGlobalKeymap); + mapper->pushKeymap(kGlobalKeymapName, true); - mapper->pushKeymap("global"); + // Get the platform-specific global keymap (if it exists) + Keymap *platformGlobalKeymap = system.getGlobalKeymap(); + if (platformGlobalKeymap) { + String platformGlobalKeymapName = platformGlobalKeymap->getName(); + mapper->addGlobalKeymap(platformGlobalKeymap); + mapper->pushKeymap(platformGlobalKeymapName, true); + } #endif } diff --git a/base/plugins.cpp b/base/plugins.cpp index f9ac338d40..f1b08f7893 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -133,9 +133,6 @@ public: #if PLUGIN_ENABLED_STATIC(LURE) LINK_PLUGIN(LURE) #endif - #if PLUGIN_ENABLED_STATIC(M4) - LINK_PLUGIN(M4) - #endif #if PLUGIN_ENABLED_STATIC(MADE) LINK_PLUGIN(MADE) #endif @@ -178,6 +175,9 @@ public: #if PLUGIN_ENABLED_STATIC(TINSEL) LINK_PLUGIN(TINSEL) #endif + #if PLUGIN_ENABLED_STATIC(TOLTECS) + LINK_PLUGIN(TOLTECS) + #endif #if PLUGIN_ENABLED_STATIC(TOON) LINK_PLUGIN(TOON) #endif @@ -358,8 +358,6 @@ void PluginManagerUncached::init() { unloadAllPlugins(); _allEnginePlugins.clear(); - // Resize our pluginsInMem list to prevent fragmentation - _pluginsInMem[PLUGIN_TYPE_ENGINE].resize(2); unloadPluginsExcept(PLUGIN_TYPE_ENGINE, NULL, false); // empty the engine plugins for (ProviderList::iterator pp = _providers.begin(); diff --git a/base/version.cpp b/base/version.cpp index a068f2b141..7943552418 100644 --- a/base/version.cpp +++ b/base/version.cpp @@ -121,4 +121,8 @@ const char *gScummVMFeatures = "" #ifdef USE_FAAD "AAC " #endif + +#ifdef USE_FREETYPE2 + "FreeType2 " +#endif ; |
