diff options
author | Willem Jan Palenstijn | 2013-04-18 23:34:29 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-05-08 20:39:44 +0200 |
commit | 01f3f3a8dd0ad2891939d03b0ce47cbf36ea9bc6 (patch) | |
tree | 544b07f3aa41abe7907bcd2040cdad11ebc324bb /base | |
parent | 9cf2c83e5e5a35816ab153bf8443dac691829ea8 (diff) | |
parent | a41d72a44a660c72fdadbc3a8ef580e5e03cb890 (diff) | |
download | scummvm-rg350-01f3f3a8dd0ad2891939d03b0ce47cbf36ea9bc6.tar.gz scummvm-rg350-01f3f3a8dd0ad2891939d03b0ce47cbf36ea9bc6.tar.bz2 scummvm-rg350-01f3f3a8dd0ad2891939d03b0ce47cbf36ea9bc6.zip |
Merge branch 'master'
Diffstat (limited to 'base')
-rw-r--r-- | base/commandLine.cpp | 35 | ||||
-rw-r--r-- | base/internal_version.h | 2 | ||||
-rw-r--r-- | base/main.cpp | 21 | ||||
-rw-r--r-- | base/plugins.cpp | 10 | ||||
-rw-r--r-- | base/version.cpp | 1 |
5 files changed, 41 insertions, 28 deletions
diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 61853a1ebc..6550f60670 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -25,6 +25,8 @@ #define FORBIDDEN_SYMBOL_EXCEPTION_exit +#include <limits.h> + #include "engines/metaengine.h" #include "base/commandLine.h" #include "base/plugins.h" @@ -63,6 +65,9 @@ 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__) + " --console Enable the console window (default:enabled)\n" +#endif "\n" " -c, --config=CONFIG Use alternate configuration file\n" " -p, --path=PATH Path to where the game is installed\n" @@ -179,8 +184,8 @@ void registerDefaults() { ConfMan.registerDefault("native_mt32", false); ConfMan.registerDefault("enable_gs", false); ConfMan.registerDefault("midi_gain", 100); -// ConfMan.registerDefault("music_driver", ???); + ConfMan.registerDefault("music_driver", "auto"); ConfMan.registerDefault("mt32_device", "null"); ConfMan.registerDefault("gm_device", "null"); @@ -229,13 +234,6 @@ void registerDefaults() { ConfMan.registerDefault("record_temp_file_name", "record.tmp"); ConfMan.registerDefault("record_time_file_name", "record.time"); -#if 0 - // NEW CODE TO HIDE CONSOLE FOR WIN32 -#ifdef WIN32 - // console hiding for win32 - ConfMan.registerDefault("show_console", false); -#endif -#endif } // @@ -264,17 +262,19 @@ void registerDefaults() { if (!option) usage("Option '%s' requires an argument", argv[isLongCmd ? i : i-1]); // Use this for options which have a required integer value +// (we don't check ERANGE because WinCE doesn't support errno, so we're stuck just rejecting LONG_MAX/LONG_MIN..) #define DO_OPTION_INT(shortCmd, longCmd) \ DO_OPTION(shortCmd, longCmd) \ - char *endptr = 0; \ - strtol(option, &endptr, 0); \ - if (endptr == NULL || *endptr != 0) usage("--%s: Invalid number '%s'", longCmd, option); + char *endptr; \ + long int retval = strtol(option, &endptr, 0); \ + if (*endptr != '\0' || retval == LONG_MAX || retval == LONG_MIN) \ + usage("--%s: Invalid number '%s'", longCmd, option); // 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(s[1]) != 0); \ + bool boolValue = (islower(static_cast<unsigned char>(s[1])) != 0); \ s += 2; \ if (isLongCmd) { \ boolValue = !strcmp(s, longCmd); \ @@ -550,14 +550,11 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha END_OPTION #endif -#if 0 - // NEW CODE TO HIDE CONSOLE FOR WIN32 -#ifdef WIN32 - // console hiding for win32 - DO_LONG_OPTION_BOOL("show-console") +#if defined (WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) + // Optional console window on Windows (default: enabled) + DO_LONG_OPTION_BOOL("console") END_OPTION #endif -#endif unknownOption: // If we get till here, the option is unhandled and hence unknown. @@ -665,7 +662,7 @@ static Common::Error listSaves(const char *target) { " ---- ------------------------------------------------------\n"); for (SaveStateList::const_iterator x = saveList.begin(); x != saveList.end(); ++x) { - printf(" %-4s %s\n", x->save_slot().c_str(), x->description().c_str()); + printf(" %-4d %s\n", x->getSaveSlot(), x->getDescription().c_str()); // TODO: Could also iterate over the full hashmap, printing all key-value pairs } } else { diff --git a/base/internal_version.h b/base/internal_version.h index bb25bce4e4..5392012169 100644 --- a/base/internal_version.h +++ b/base/internal_version.h @@ -16,4 +16,4 @@ #define SCUMMVM_REVISION #endif -#define SCUMMVM_VERSION "1.4.0git" SCUMMVM_REVISION +#define SCUMMVM_VERSION "1.5.0git" SCUMMVM_REVISION diff --git a/base/main.cpp b/base/main.cpp index 717ccb3344..5d0c0ea09a 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -103,7 +103,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("%s", " Looking for a plugin supporting this gameid... "); + printf(" Looking for a plugin supporting this gameid... "); GameDescriptor game = EngineMan.findGame(gameid, &plugin); @@ -111,10 +111,7 @@ static const EnginePlugin *detectPlugin() { printf("failed\n"); warning("%s is an invalid gameid. Use the --list-games option to list supported gameid", gameid.c_str()); } else { - printf("%s\n", plugin->getName()); - - // FIXME: Do we really need this one? - printf(" Starting '%s'\n", game.description().c_str()); + printf("%s\n Starting '%s'\n", plugin->getName(), game.description().c_str()); } return plugin; @@ -186,9 +183,15 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const } // If a second extrapath is specified on the app domain level, add that as well. + // However, since the default hasKey() and get() check the app domain level, + // verify that it's not already there before adding it. The search manager will + // check for that too, so this check is mostly to avoid a warning message. if (ConfMan.hasKey("extrapath", Common::ConfigManager::kApplicationDomain)) { - dir = Common::FSNode(ConfMan.get("extrapath", Common::ConfigManager::kApplicationDomain)); - SearchMan.addDirectory(dir.getPath(), dir); + Common::String extraPath = ConfMan.get("extrapath", Common::ConfigManager::kApplicationDomain); + if (!SearchMan.hasArchive(extraPath)) { + dir = Common::FSNode(extraPath); + SearchMan.addDirectory(dir.getPath(), dir); + } } // On creation the engine should have set up all debug levels so we can use @@ -419,6 +422,10 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { // Try to run the game Common::Error result = runGame(plugin, system, specialDebug); + // Flush Event recorder file. The recorder does not get reinitialized for next game + // which is intentional. Only single game per session is allowed. + g_eventRec.deinit(); + #if defined(UNCACHED_PLUGINS) && defined(DYNAMIC_MODULES) // do our best to prevent fragmentation by unloading as soon as we can PluginManager::instance().unloadPluginsExcept(PLUGIN_TYPE_ENGINE, NULL, false); diff --git a/base/plugins.cpp b/base/plugins.cpp index 261ae4ca59..f9ac338d40 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -94,9 +94,15 @@ public: #if PLUGIN_ENABLED_STATIC(AGOS) LINK_PLUGIN(AGOS) #endif + #if PLUGIN_ENABLED_STATIC(CGE) + LINK_PLUGIN(CGE) + #endif #if PLUGIN_ENABLED_STATIC(CINE) LINK_PLUGIN(CINE) #endif + #if PLUGIN_ENABLED_STATIC(COMPOSER) + LINK_PLUGIN(COMPOSER) + #endif #if PLUGIN_ENABLED_STATIC(CRUISE) LINK_PLUGIN(CRUISE) #endif @@ -543,7 +549,9 @@ void PluginManager::addToPluginsInMemList(Plugin *plugin) { #include "engines/metaengine.h" +namespace Common { DECLARE_SINGLETON(EngineManager); +} /** * This function works for both cached and uncached PluginManagers. @@ -634,7 +642,9 @@ const EnginePlugin::List &EngineManager::getPlugins() const { #include "audio/musicplugin.h" +namespace Common { DECLARE_SINGLETON(MusicManager); +} const MusicPlugin::List &MusicManager::getPlugins() const { return (const MusicPlugin::List &)PluginManager::instance().getPlugins(PLUGIN_TYPE_MUSIC); diff --git a/base/version.cpp b/base/version.cpp index c91698cba9..a068f2b141 100644 --- a/base/version.cpp +++ b/base/version.cpp @@ -122,4 +122,3 @@ const char *gScummVMFeatures = "" "AAC " #endif ; - |