From 40b68b41c7a507dad5a1d38813bfa7f89e7c6551 Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Fri, 30 Dec 2011 11:50:15 -0600 Subject: KEYMAPPER: Make engine keymap init and cleanup more generic --- base/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'base') diff --git a/base/main.cpp b/base/main.cpp index 61a05154c1..b4cfd45689 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; -- cgit v1.2.3 From d143872be605b881eaec63b0168c9d4d551787ee Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Sat, 7 Jan 2012 21:20:29 -0600 Subject: KEYMAPPER: Constantify global keymap name --- base/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'base') diff --git a/base/main.cpp b/base/main.cpp index b4cfd45689..b39165ed6a 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -264,7 +264,7 @@ static void setupKeymapper(OSystem &system) { using namespace Common; Keymapper *mapper = system.getEventManager()->getKeymapper(); - Keymap *globalMap = new Keymap("global"); + Keymap *globalMap = new Keymap(kGlobalKeymapName); Action *act; HardwareKeySet *keySet; @@ -294,7 +294,7 @@ static void setupKeymapper(OSystem &system) { mapper->addGlobalKeymap(globalMap); - mapper->pushKeymap("global", true); + mapper->pushKeymap(kGlobalKeymapName, true); #endif } -- cgit v1.2.3 From 843b9f96655feda8c78450d9236b09330bdb6bd1 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 25 Jul 2011 22:54:32 +0200 Subject: GRAPHICS: Add a TTF font class using FreeType2. --- base/version.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'base') 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 ; -- cgit v1.2.3 From 1e0de79cf54f2483c819584033ae3405ea7e8011 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 1 Feb 2012 19:38:27 +0100 Subject: BASE: Get rid of unecessary friend in PluginManagerUncached. --- base/plugins.h | 1 - 1 file changed, 1 deletion(-) (limited to 'base') diff --git a/base/plugins.h b/base/plugins.h index fffb5fb910..327aaf47d8 100644 --- a/base/plugins.h +++ b/base/plugins.h @@ -344,7 +344,6 @@ public: **/ class PluginManagerUncached : public PluginManager { protected: - friend class PluginManager; PluginList _allEnginePlugins; PluginList::iterator _currentPlugin; -- cgit v1.2.3 From 31d1ae653044d1260329f17831fb1b72406d6458 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Wed, 1 Feb 2012 21:54:40 +0100 Subject: Revert "BASE: Get rid of unecessary friend in PluginManagerUncached." This reverts commit 1e0de79cf54f2483c819584033ae3405ea7e8011. The only available constructor for PluginManagerUncached is protected, so this broke the builds using it. --- base/plugins.h | 1 + 1 file changed, 1 insertion(+) (limited to 'base') diff --git a/base/plugins.h b/base/plugins.h index 327aaf47d8..fffb5fb910 100644 --- a/base/plugins.h +++ b/base/plugins.h @@ -344,6 +344,7 @@ public: **/ class PluginManagerUncached : public PluginManager { protected: + friend class PluginManager; PluginList _allEnginePlugins; PluginList::iterator _currentPlugin; -- cgit v1.2.3 From a488556dcdfb69ec30af740aa2c71977f505ef35 Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Thu, 2 Feb 2012 18:53:14 -0600 Subject: KEYMAPPER: Handle EVENT_MAINMENU directly --- base/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'base') diff --git a/base/main.cpp b/base/main.cpp index b39165ed6a..c6f29bc33e 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -275,7 +275,7 @@ static void setupKeymapper(OSystem &system) { // Now create the global keymap act = new Action(globalMap, "MENU", _("Menu"), kGenericActionType, kSelectKeyType); - act->addKeyEvent(KeyState(KEYCODE_F5, ASCII_F5, 0)); + act->addEvent(EVENT_MAINMENU); act = new Action(globalMap, "SKCT", _("Skip"), kGenericActionType, kActionKeyType); act->addKeyEvent(KeyState(KEYCODE_ESCAPE, ASCII_ESCAPE, 0)); -- cgit v1.2.3 From da4b03139d83dd08f39b7eda7579395436feda7d Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Sat, 4 Feb 2012 19:53:16 -0600 Subject: KEYMAPPER: Added Toggle FullScreen action --- base/main.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'base') diff --git a/base/main.cpp b/base/main.cpp index c6f29bc33e..9bf67a3cdc 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -292,6 +292,9 @@ static void setupKeymapper(OSystem &system) { act = new Action(globalMap, "REMP", _("Remap keys"), kKeyRemapActionType); act->addKeyEvent(KeyState(KEYCODE_F8, ASCII_F8, 0)); + act = new Action(globalMap, "FULS", _("Toggle FullScreen"), kKeyRemapActionType); + act->addKeyEvent(KeyState(KEYCODE_RETURN, ASCII_RETURN, KBD_ALT)); + mapper->addGlobalKeymap(globalMap); mapper->pushKeymap(kGlobalKeymapName, true); -- cgit v1.2.3 From 1adc7f0bdd159e733959c24a122f593e3a006628 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Fri, 10 Feb 2012 01:45:16 +0100 Subject: BASE: Remove unneeded code in PluginManagerUncached. Thanks to Yotam for confirming that this isn't needed anymore. --- base/plugins.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'base') diff --git a/base/plugins.cpp b/base/plugins.cpp index df12d0d3ba..db8a5d8817 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -355,8 +355,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(); -- cgit v1.2.3 From 705761011d24f08eb56add90f6dfa605b36ac8ee Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Thu, 9 Feb 2012 01:26:29 -0600 Subject: KEYMAPPER: Allow ports to define their own global keymap --- base/main.cpp | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'base') diff --git a/base/main.cpp b/base/main.cpp index 9bf67a3cdc..f3ff081d28 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -259,13 +259,11 @@ 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(kGlobalKeymapName); - Action *act; + HardwareKeySet *keySet; keySet = system.getHardwareKeySet(); @@ -274,30 +272,39 @@ static void setupKeymapper(OSystem &system) { mapper->registerHardwareKeySet(keySet); // Now create the global keymap - act = new Action(globalMap, "MENU", _("Menu"), kGenericActionType, kSelectKeyType); + Keymap *primaryGlobalKeymap = new Keymap(kGlobalKeymapName); + Action *act; + act = new Action(primaryGlobalKeymap, "MENU", _("Menu"), kGenericActionType, kSelectKeyType); act->addEvent(EVENT_MAINMENU); - act = new Action(globalMap, "SKCT", _("Skip"), kGenericActionType, kActionKeyType); + act = new Action(primaryGlobalKeymap, "SKCT", _("Skip"), kGenericActionType, kActionKeyType); act->addKeyEvent(KeyState(KEYCODE_ESCAPE, ASCII_ESCAPE, 0)); - act = new Action(globalMap, "PAUS", _("Pause"), kGenericActionType, kStartKeyType); + act = new Action(primaryGlobalKeymap, "PAUS", _("Pause"), kGenericActionType, kStartKeyType); act->addKeyEvent(KeyState(KEYCODE_SPACE, ' ', 0)); - act = new Action(globalMap, "SKLI", _("Skip line"), kGenericActionType, kActionKeyType); + act = new Action(primaryGlobalKeymap, "SKLI", _("Skip line"), kGenericActionType, kActionKeyType); act->addKeyEvent(KeyState(KEYCODE_PERIOD, '.', 0)); - act = new Action(globalMap, "VIRT", _("Display keyboard"), kVirtualKeyboardActionType); + act = new Action(primaryGlobalKeymap, "VIRT", _("Display keyboard"), kVirtualKeyboardActionType); act->addKeyEvent(KeyState(KEYCODE_F7, ASCII_F7, 0)); - act = new Action(globalMap, "REMP", _("Remap keys"), kKeyRemapActionType); + act = new Action(primaryGlobalKeymap, "REMP", _("Remap keys"), kKeyRemapActionType); act->addKeyEvent(KeyState(KEYCODE_F8, ASCII_F8, 0)); - act = new Action(globalMap, "FULS", _("Toggle FullScreen"), kKeyRemapActionType); + act = new Action(primaryGlobalKeymap, "FULS", _("Toggle FullScreen"), kKeyRemapActionType); act->addKeyEvent(KeyState(KEYCODE_RETURN, ASCII_RETURN, KBD_ALT)); - mapper->addGlobalKeymap(globalMap); - + mapper->addGlobalKeymap(primaryGlobalKeymap); mapper->pushKeymap(kGlobalKeymapName, 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 } -- cgit v1.2.3 From 5cf932198e289b8e8d2fe0ee3e57d7cfbf3b65eb Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Mon, 13 Feb 2012 23:24:09 -0600 Subject: KEYMAPPER: Fix Action ctor args in most keymaps --- base/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'base') diff --git a/base/main.cpp b/base/main.cpp index f3ff081d28..81f9b91aa7 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -274,16 +274,16 @@ static void setupKeymapper(OSystem &system) { // Now create the global keymap Keymap *primaryGlobalKeymap = new Keymap(kGlobalKeymapName); Action *act; - act = new Action(primaryGlobalKeymap, "MENU", _("Menu"), kGenericActionType, kSelectKeyType); + act = new Action(primaryGlobalKeymap, "MENU", _("Menu"), kMenuActionType); act->addEvent(EVENT_MAINMENU); - act = new Action(primaryGlobalKeymap, "SKCT", _("Skip"), kGenericActionType, kActionKeyType); + act = new Action(primaryGlobalKeymap, "SKCT", _("Skip")); act->addKeyEvent(KeyState(KEYCODE_ESCAPE, ASCII_ESCAPE, 0)); - act = new Action(primaryGlobalKeymap, "PAUS", _("Pause"), kGenericActionType, kStartKeyType); + act = new Action(primaryGlobalKeymap, "PAUS", _("Pause")); act->addKeyEvent(KeyState(KEYCODE_SPACE, ' ', 0)); - act = new Action(primaryGlobalKeymap, "SKLI", _("Skip line"), kGenericActionType, kActionKeyType); + act = new Action(primaryGlobalKeymap, "SKLI", _("Skip line")); act->addKeyEvent(KeyState(KEYCODE_PERIOD, '.', 0)); act = new Action(primaryGlobalKeymap, "VIRT", _("Display keyboard"), kVirtualKeyboardActionType); @@ -292,7 +292,7 @@ static void setupKeymapper(OSystem &system) { act = new Action(primaryGlobalKeymap, "REMP", _("Remap keys"), kKeyRemapActionType); act->addKeyEvent(KeyState(KEYCODE_F8, ASCII_F8, 0)); - act = new Action(primaryGlobalKeymap, "FULS", _("Toggle FullScreen"), kKeyRemapActionType); + act = new Action(primaryGlobalKeymap, "FULS", _("Toggle FullScreen")); act->addKeyEvent(KeyState(KEYCODE_RETURN, ASCII_RETURN, KBD_ALT)); mapper->addGlobalKeymap(primaryGlobalKeymap); -- cgit v1.2.3 From 658080deeda79d20ea40643569fbcb072573e7cf Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 28 Jan 2012 01:15:49 +0100 Subject: ALL: Avoid using is* macros from ctype.h On some systems, passing signed chars to macros like isspace() etc. lead to a runtime error. Hence, mark these macros as forbidden by default, and introduce otherwise equivalent alternatives for them. --- base/commandLine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'base') diff --git a/base/commandLine.cpp b/base/commandLine.cpp index c3059ced2f..16a2b6f9f0 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -277,7 +277,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(s[1])) != 0); \ + bool boolValue = (isLower(s[1]) != 0); \ s += 2; \ if (isLongCmd) { \ boolValue = !strcmp(s, longCmd); \ -- cgit v1.2.3 From 3f6d549b0e891be33ef48926629d6e626009fc8f Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Sat, 18 Feb 2012 22:17:48 -0600 Subject: KEYMAPPER: Move F7 and F8 handling to DefaultEventMapper --- base/main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'base') diff --git a/base/main.cpp b/base/main.cpp index 81f9b91aa7..9e4a500da6 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -286,11 +286,13 @@ static void setupKeymapper(OSystem &system) { act = new Action(primaryGlobalKeymap, "SKLI", _("Skip line")); act->addKeyEvent(KeyState(KEYCODE_PERIOD, '.', 0)); +#ifdef ENABLE_VKEYBD act = new Action(primaryGlobalKeymap, "VIRT", _("Display keyboard"), kVirtualKeyboardActionType); - act->addKeyEvent(KeyState(KEYCODE_F7, ASCII_F7, 0)); + act->addEvent(EVENT_VIRTUAL_KEYBOARD); +#endif act = new Action(primaryGlobalKeymap, "REMP", _("Remap keys"), kKeyRemapActionType); - act->addKeyEvent(KeyState(KEYCODE_F8, ASCII_F8, 0)); + act->addEvent(EVENT_KEYMAPPER_REMAP); act = new Action(primaryGlobalKeymap, "FULS", _("Toggle FullScreen")); act->addKeyEvent(KeyState(KEYCODE_RETURN, ASCII_RETURN, KBD_ALT)); -- cgit v1.2.3 From 4f8665fc836898ebf54fc73b1061125b748183bc Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 20 Feb 2012 16:03:39 +0100 Subject: COMMON: Move isFoo functions to namespace Common, add doxygen comments --- base/commandLine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'base') diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 16a2b6f9f0..aa589ed15f 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -277,7 +277,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(s[1]) != 0); \ + bool boolValue = (Common::isLower(s[1]) != 0); \ s += 2; \ if (isLongCmd) { \ boolValue = !strcmp(s, longCmd); \ -- cgit v1.2.3 From aa42d78658eacc17a36ffe0d86541deffa534f79 Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Tue, 21 Feb 2012 06:57:32 -0600 Subject: KEYMAPPER: Remove automapping dead code --- base/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'base') diff --git a/base/main.cpp b/base/main.cpp index 9e4a500da6..5311b6fd78 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -274,7 +274,7 @@ static void setupKeymapper(OSystem &system) { // Now create the global keymap Keymap *primaryGlobalKeymap = new Keymap(kGlobalKeymapName); Action *act; - act = new Action(primaryGlobalKeymap, "MENU", _("Menu"), kMenuActionType); + act = new Action(primaryGlobalKeymap, "MENU", _("Menu")); act->addEvent(EVENT_MAINMENU); act = new Action(primaryGlobalKeymap, "SKCT", _("Skip")); @@ -287,11 +287,11 @@ static void setupKeymapper(OSystem &system) { act->addKeyEvent(KeyState(KEYCODE_PERIOD, '.', 0)); #ifdef ENABLE_VKEYBD - act = new Action(primaryGlobalKeymap, "VIRT", _("Display keyboard"), kVirtualKeyboardActionType); + act = new Action(primaryGlobalKeymap, "VIRT", _("Display keyboard")); act->addEvent(EVENT_VIRTUAL_KEYBOARD); #endif - act = new Action(primaryGlobalKeymap, "REMP", _("Remap keys"), kKeyRemapActionType); + act = new Action(primaryGlobalKeymap, "REMP", _("Remap keys")); act->addEvent(EVENT_KEYMAPPER_REMAP); act = new Action(primaryGlobalKeymap, "FULS", _("Toggle FullScreen")); -- cgit v1.2.3 From befff7ee446760dec618552bc4afb66b91e30262 Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Wed, 22 Feb 2012 16:59:56 -0600 Subject: KEYMAPPER: Minor cleanup --- base/main.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'base') diff --git a/base/main.cpp b/base/main.cpp index 5311b6fd78..f8d04fa4f2 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -264,9 +264,7 @@ static void setupKeymapper(OSystem &system) { Keymapper *mapper = system.getEventManager()->getKeymapper(); - HardwareKeySet *keySet; - - keySet = system.getHardwareKeySet(); + HardwareInputSet *inputSet = system.getHardwareInputSet(); // Query backend for hardware keys and register them mapper->registerHardwareKeySet(keySet); -- cgit v1.2.3 From 784ee5dd655c3e0dfa7007e3cb746c3bc5cd7f29 Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Wed, 22 Feb 2012 17:23:12 -0600 Subject: KEYMAPPER: Fix mistake in last commit --- base/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'base') diff --git a/base/main.cpp b/base/main.cpp index f8d04fa4f2..5e9f1d4f25 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -264,7 +264,7 @@ static void setupKeymapper(OSystem &system) { Keymapper *mapper = system.getEventManager()->getKeymapper(); - HardwareInputSet *inputSet = system.getHardwareInputSet(); + HardwareKeySet *keySet = system.getHardwareKeySet(); // Query backend for hardware keys and register them mapper->registerHardwareKeySet(keySet); -- cgit v1.2.3 From 215b41b244e042019f82cb507463d7e13672a6d0 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 22 Feb 2012 15:33:29 +0100 Subject: COMMON: Move RenderMode and GUIOptions functionality into separate files --- base/commandLine.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'base') diff --git a/base/commandLine.cpp b/base/commandLine.cpp index aa589ed15f..08838167e9 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" -- cgit v1.2.3 From 6afac4e01eba5c297e99597dd2cb17c2e4732a7e Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Fri, 24 Feb 2012 13:23:55 -0600 Subject: KEYMAPPER: Rename HardwareKey to HardwareInput --- base/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'base') diff --git a/base/main.cpp b/base/main.cpp index 5e9f1d4f25..391d911ae8 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -264,10 +264,10 @@ static void setupKeymapper(OSystem &system) { Keymapper *mapper = system.getEventManager()->getKeymapper(); - HardwareKeySet *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 Keymap *primaryGlobalKeymap = new Keymap(kGlobalKeymapName); -- cgit v1.2.3 From 991d5364be542b54c5dc62be1a75cacf635c39f6 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Thu, 15 Mar 2012 10:40:04 +0100 Subject: COMMON: Add a space between a string literal and a macro parameter so C++11 does not think the latter is a string literal suffix. --- base/commandLine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'base') diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 08838167e9..d877c58718 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -277,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)) { \ + 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"; \ -- cgit v1.2.3 From 223794fb383637944c3b161c04ecc233a354c9ae Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 17 Mar 2012 22:02:16 +0100 Subject: ALL: Make use of defined() for the preprocessor consistent. This does not change the use of defined for some NDS source files, since they seem to be (based on?) third party code. --- base/commandLine.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'base') diff --git a/base/commandLine.cpp b/base/commandLine.cpp index d877c58718..6407ab1c4a 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -68,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" @@ -155,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); @@ -557,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 -- cgit v1.2.3