From 69b1485a22dc2b8a2cfe0bd10edcbaad0da0cf6e Mon Sep 17 00:00:00 2001 From: strangerke Date: Thu, 12 May 2011 01:13:57 +0200 Subject: GIT: Clean up: Suppress SVN tags, now useless --- base/commandLine.cpp | 3 --- base/commandLine.h | 3 --- base/main.cpp | 3 --- base/main.h | 3 --- base/plugins.cpp | 3 --- base/plugins.h | 3 --- base/version.cpp | 3 --- base/version.h | 3 --- 8 files changed, 24 deletions(-) (limited to 'base') diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 05e1d2c131..1ca4a642c8 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // FIXME: Avoid using printf diff --git a/base/commandLine.h b/base/commandLine.h index 6205c914e0..4e611d97bf 100644 --- a/base/commandLine.h +++ b/base/commandLine.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef COMMON_COMMAND_LINE_H diff --git a/base/main.cpp b/base/main.cpp index b34eb6966a..4ed70a5587 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ /*! \mainpage %ScummVM Source Reference diff --git a/base/main.h b/base/main.h index 93e73f55e6..3d75931454 100644 --- a/base/main.h +++ b/base/main.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BASE_MAIN_H diff --git a/base/plugins.cpp b/base/plugins.cpp index 38b5626fe2..56bb1e63e5 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" diff --git a/base/plugins.h b/base/plugins.h index d8f1cb96ee..247564171d 100644 --- a/base/plugins.h +++ b/base/plugins.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef BASE_PLUGINS_H diff --git a/base/version.cpp b/base/version.cpp index 6967263f5c..6a670c1a40 100644 --- a/base/version.cpp +++ b/base/version.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/base/version.h b/base/version.h index 1ad6d48b8b..a5c25c03f4 100644 --- a/base/version.h +++ b/base/version.h @@ -17,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ */ #ifndef BASE_VERSION_H -- cgit v1.2.3 From 5c34e33c2c27b2b5083199b40306370d732f4e53 Mon Sep 17 00:00:00 2001 From: athrxx Date: Fri, 29 Apr 2011 22:16:02 +0200 Subject: FM-TOWNS AUDIO: Some more midi driver code for FM-TOWNS monkey2 and indy4 --- base/plugins.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'base') diff --git a/base/plugins.cpp b/base/plugins.cpp index 56bb1e63e5..4a3b201714 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -225,6 +225,7 @@ public: LINK_PLUGIN(AMIGA) LINK_PLUGIN(APPLEIIGS) LINK_PLUGIN(TOWNS) + LINK_PLUGIN(PC98) #if defined(USE_TIMIDITY) LINK_PLUGIN(TIMIDITY) #endif -- cgit v1.2.3 From 590c6ede63d9fa61d2b05ce74596b043f5c79bc8 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 23 May 2011 19:09:34 +0200 Subject: BACKENDS: Move SCUMMVM_SAVEPATH env var handling to POSIX savefile manager --- base/commandLine.cpp | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'base') diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 1ca4a642c8..f819b03658 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -958,26 +958,6 @@ Common::Error processSettings(Common::String &command, Common::StringMap &settin } - // The user can override the savepath with the SCUMMVM_SAVEPATH - // environment variable. This is weaker than a --savepath on the - // command line, but overrides the default savepath, hence it is - // handled here, just before the command line gets parsed. -#if !defined(_WIN32_WCE) && !defined(__GP32__) && !defined(ANDROID) - if (!settings.contains("savepath")) { - const char *dir = getenv("SCUMMVM_SAVEPATH"); - if (dir && *dir && strlen(dir) < MAXPATHLEN) { - Common::FSNode saveDir(dir); - if (!saveDir.exists()) { - warning("Non-existent SCUMMVM_SAVEPATH save path. It will be ignored"); - } else if (!saveDir.isWritable()) { - warning("Non-writable SCUMMVM_SAVEPATH save path. It will be ignored"); - } else { - settings["savepath"] = dir; - } - } - } -#endif - // Finally, store the command line settings into the config manager. for (Common::StringMap::const_iterator x = settings.begin(); x != settings.end(); ++x) { Common::String key(x->_key); -- cgit v1.2.3 From 20cad6e8b6fe9ae843245697e872256c4ca1e545 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 23 May 2011 19:36:45 +0200 Subject: COMMON: Modify Base::processSettings, get rid of Common::kArgumentNotProcessed Instead of defining a hacked up Common::Error code, split the return value of processSettings into two parts: An error code, and a value which indicates whether the specified command was completely handled by processSettings or not. --- base/commandLine.cpp | 24 ++++++++++++++---------- base/commandLine.h | 21 ++++++++++++++++++++- base/main.cpp | 3 +-- 3 files changed, 35 insertions(+), 13 deletions(-) (limited to 'base') diff --git a/base/commandLine.cpp b/base/commandLine.cpp index f819b03658..78eea50082 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -23,6 +23,8 @@ // FIXME: Avoid using printf #define FORBIDDEN_SYMBOL_EXCEPTION_printf +#define FORBIDDEN_SYMBOL_EXCEPTION_exit + #include "engines/metaengine.h" #include "base/commandLine.h" #include "base/plugins.h" @@ -885,7 +887,8 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha #endif // DISABLE_COMMAND_LINE -Common::Error processSettings(Common::String &command, Common::StringMap &settings) { +bool processSettings(Common::String &command, Common::StringMap &settings, Common::Error &err) { + err = Common::kNoError; #ifndef DISABLE_COMMAND_LINE @@ -894,33 +897,34 @@ Common::Error processSettings(Common::String &command, Common::StringMap &settin // have been loaded. if (command == "list-targets") { listTargets(); - return Common::kNoError; + return true; } else if (command == "list-games") { listGames(); - return Common::kNoError; + return true; } else if (command == "list-saves") { - return listSaves(settings["list-saves"].c_str()); + err = listSaves(settings["list-saves"].c_str()); + return true; } else if (command == "list-themes") { listThemes(); - return Common::kNoError; + return true; } else if (command == "version") { printf("%s\n", gScummVMFullVersion); printf("Features compiled in: %s\n", gScummVMFeatures); - return Common::kNoError; + return true; } else if (command == "help") { printf(HELP_STRING, s_appName); - return Common::kNoError; + return true; } #ifdef DETECTOR_TESTING_HACK else if (command == "test-detector") { runDetectorTest(); - return Common::kNoError; + return true; } #endif #ifdef UPGRADE_ALL_TARGETS_HACK else if (command == "upgrade-targets") { upgradeTargets(); - return Common::kNoError; + return true; } #endif @@ -972,7 +976,7 @@ Common::Error processSettings(Common::String &command, Common::StringMap &settin ConfMan.set(key, value, Common::ConfigManager::kTransientDomain); } - return Common::kArgumentNotProcessed; + return false; } } // End of namespace Base diff --git a/base/commandLine.h b/base/commandLine.h index 4e611d97bf..2798ab0934 100644 --- a/base/commandLine.h +++ b/base/commandLine.h @@ -32,9 +32,28 @@ class String; namespace Base { +/** + * Register various defaults with the ConfigManager. + */ void registerDefaults(); + +/** + * Parse the command line for options and a command; the options + * are stored in the map 'settings, the command (if any) is returned. + */ Common::String parseCommandLine(Common::StringMap &settings, int argc, const char * const *argv); -Common::Error processSettings(Common::String &command, Common::StringMap &settings); + +/** + * Process the command line options and arguments. + * Returns true if everything was handled and ScummVM should quit + * (e.g. because "--help" was specified, and handled). + * + * @param[in] command the command as returned by parseCommandLine + * @param[in] settings the settings as returned by parseCommandLine + * @param[out] err indicates whether any error occurred, and which + * @return true if the command was completely processed and ScummVM should quit, false otherwise + */ +bool processSettings(Common::String &command, Common::StringMap &settings, Common::Error &err); } // End of namespace Base diff --git a/base/main.cpp b/base/main.cpp index 4ed70a5587..906f4c9242 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -349,8 +349,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { Common::Error res; // TODO: deal with settings that require plugins to be loaded - res = Base::processSettings(command, settings); - if (res.getCode() != Common::kArgumentNotProcessed) { + if (Base::processSettings(command, settings, res)) { if (res.getCode() != Common::kNoError) warning("%s", res.getDesc().c_str()); return res.getCode(); -- cgit v1.2.3 From 5a2e6e4f3f9b26569797d998252d2016a33f57c0 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Tue, 31 May 2011 04:44:12 +0100 Subject: BUILD: Fix compilation when --enable-plugins is enabled. --- base/plugins.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'base') diff --git a/base/plugins.h b/base/plugins.h index 247564171d..a1ae734159 100644 --- a/base/plugins.h +++ b/base/plugins.h @@ -80,7 +80,7 @@ extern int pluginTypeVersions[PLUGIN_TYPE_MAX]; (ENABLE_##ID && !PLUGIN_ENABLED_DYNAMIC(ID)) #define PLUGIN_ENABLED_DYNAMIC(ID) \ - (ENABLE_##ID && (ENABLE_##ID == DYNAMIC_PLUGIN) && DYNAMIC_MODULES) + (ENABLE_##ID && (ENABLE_##ID == DYNAMIC_PLUGIN) && defined(DYNAMIC_MODULES)) // see comments in backends/plugins/elf/elf-provider.cpp #if defined(USE_ELF_LOADER) && defined(ELF_LOADER_CXA_ATEXIT) -- cgit v1.2.3