aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
Diffstat (limited to 'base')
-rw-r--r--base/commandLine.cpp15
-rw-r--r--base/main.cpp50
-rw-r--r--base/plugins.cpp2
-rw-r--r--base/version.cpp4
4 files changed, 45 insertions, 26 deletions
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index c3059ced2f..6407ab1c4a 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -33,9 +33,10 @@
#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"
@@ -67,7 +68,7 @@ static const char HELP_STRING[] =
" -z, --list-games Display list of supported games and exit\n"
" -t, --list-targets Display list of configured targets and exit\n"
" --list-saves=TARGET Display a list of savegames for the game (TARGET) specified\n"
-#if defined (WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__)
+#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__)
" --console Enable the console window (default:enabled)\n"
#endif
"\n"
@@ -154,7 +155,7 @@ static void usage(const char *s, ...) {
vsnprintf(buf, STRINGBUFLEN, s, va);
va_end(va);
-#if !(defined(__GP32__) || defined (__SYMBIAN32__) || defined(__DS__))
+#if !(defined(__GP32__) || defined(__SYMBIAN32__) || defined(__DS__))
printf(USAGE_STRING, s_appName, buf, s_appName, s_appName);
#endif
exit(1);
@@ -276,12 +277,12 @@ void registerDefaults() {
// Use this for boolean options; this distinguishes between "-x" and "-X",
// 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); \
+ if (isLongCmd ? (!strcmp(s+2, longCmd) || !strcmp(s+2, "no-" longCmd)) : (tolower(s[1]) == shortCmd)) { \
+ bool boolValue = (Common::isLower(s[1]) != 0); \
s += 2; \
if (isLongCmd) { \
boolValue = !strcmp(s, longCmd); \
- s += boolValue ? (sizeof(longCmd) - 1) : (sizeof("no-"longCmd) - 1); \
+ s += boolValue ? (sizeof(longCmd) - 1) : (sizeof("no-" longCmd) - 1); \
} \
if (*s != '\0') goto unknownOption; \
const char *option = boolValue ? "true" : "false"; \
@@ -556,7 +557,7 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha
END_OPTION
#endif
-#if defined (WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__)
+#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__)
// Optional console window on Windows (default: enabled)
DO_LONG_OPTION_BOOL("console")
END_OPTION
diff --git a/base/main.cpp b/base/main.cpp
index 61a05154c1..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", true);
+ // 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 f76db8363c..204167e930 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -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
;