diff options
Diffstat (limited to 'base')
| -rw-r--r-- | base/commandLine.cpp | 69 | ||||
| -rw-r--r-- | base/internal_version.h | 2 | ||||
| -rw-r--r-- | base/main.cpp | 52 | ||||
| -rw-r--r-- | base/plugins.h | 8 | ||||
| -rw-r--r-- | base/version.cpp | 25 |
5 files changed, 146 insertions, 10 deletions
diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 19702ea36d..2d7b9f2d9f 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -57,7 +57,7 @@ static const char USAGE_STRING[] = ; // DONT FIXME: DO NOT ORDER ALPHABETICALLY, THIS IS ORDERED BY IMPORTANCE/CATEGORY! :) -#if defined(__SYMBIAN32__) || defined(__GP32__) || defined(ANDROID) || defined(__DS__) +#if defined(__SYMBIAN32__) || defined(__GP32__) || defined(ANDROID) || defined(__DS__) || defined(__3DS__) static const char HELP_STRING[] = "NoUsageString"; // save more data segment space #else static const char HELP_STRING[] = @@ -68,6 +68,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 saved games for the game (TARGET) specified\n" + " --auto-detect Display a list of games from current or specified directory\n" + " and start the first one. Use --path=PATH before --auto-detect\n" + " to specify a directory.\n" #if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) " --console Enable the console window (default:enabled)\n" #endif @@ -80,6 +83,8 @@ static const char HELP_STRING[] = " -g, --gfx-mode=MODE Select graphics scaler (1x,2x,3x,2xsai,super2xsai,\n" " supereagle,advmame2x,advmame3x,hq2x,hq3x,tv2x,\n" " dotmatrix)\n" + " --filtering Force filtered graphics mode\n" + " --no-filtering Force unfiltered graphics mode\n" " --gui-theme=THEME Select GUI theme\n" " --themepath=PATH Path to where GUI themes are stored\n" " --list-themes Display list of all usable GUI themes\n" @@ -97,11 +102,13 @@ static const char HELP_STRING[] = " -d, --debuglevel=NUM Set debug verbosity level\n" " --debugflags=FLAGS Enable engine specific debug flags\n" " (separated by commas)\n" + " --debug-channels-only Show only the specified debug channels\n" " -u, --dump-scripts Enable script dumping if a directory called 'dumps'\n" " exists in the current directory\n" "\n" - " --cdrom=NUM CD drive to play CD audio from (default: 0 = first\n" - " drive)\n" + " --cdrom=DRIVE CD drive to play CD audio from; can either be a\n" + " drive, path, or numeric index (default: 0 = best\n" + " choice drive)\n" " --joystick[=NUM] Enable joystick input (default: 0 = first joystick)\n" " --platform=WORD Specify platform of game (allowed values: 2gs, 3do,\n" " acorn, amiga, atari, c64, fmtowns, nes, mac, pc, pc98,\n" @@ -137,6 +144,9 @@ static const char HELP_STRING[] = #if defined(ENABLE_SCUMM) || defined(ENABLE_GROOVIE) " --demo-mode Start demo mode of Maniac Mansion or The 7th Guest\n" #endif +#if defined(ENABLE_DIRECTOR) + " --start-movie=NAME Start movie for Director\n" +#endif #ifdef ENABLE_SCUMM " --tempo=NUM Set music tempo (in percent, 50-200) for SCUMM games\n" " (default: 100)\n" @@ -176,6 +186,7 @@ void registerDefaults() { // Graphics ConfMan.registerDefault("fullscreen", false); + ConfMan.registerDefault("filtering", false); ConfMan.registerDefault("aspect_ratio", false); ConfMan.registerDefault("gfx_mode", "normal"); ConfMan.registerDefault("render_mode", "default"); @@ -373,6 +384,12 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha // We defer checking whether this is a valid target to a later point. return s; } else { + // On MacOS X prior to 10.9 the OS is sometimes adding a -psn_X_XXXXXX argument (where X are digits) + // to pass the process serial number. We need to ignore it to avoid an error. +#ifdef MACOSX + if (strncmp(s, "-psn_", 5) == 0) + continue; +#endif bool isLongCmd = (s[0] == '-' && s[1] == '-'); @@ -388,6 +405,9 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha DO_COMMAND('z', "list-games") END_COMMAND + DO_LONG_COMMAND("auto-detect") + END_COMMAND + #ifdef DETECTOR_TESTING_HACK // HACK FIXME TODO: This command is intentionally *not* documented! DO_LONG_COMMAND("test-detector") @@ -419,6 +439,9 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha DO_LONG_OPTION("debugflags") END_OPTION + DO_LONG_OPTION_BOOL("debug-channels-only") + END_OPTION + DO_OPTION('e', "music-driver") END_OPTION @@ -431,6 +454,9 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha DO_OPTION_BOOL('f', "fullscreen") END_OPTION + DO_LONG_OPTION_BOOL("filtering") + END_OPTION + #ifdef ENABLE_EVENTRECORDER DO_LONG_OPTION_INT("disable-display") END_OPTION @@ -599,6 +625,11 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha END_OPTION #endif +#if defined(ENABLE_DIRECTOR) + DO_LONG_OPTION("start-movie") + END_OPTION +#endif + unknownOption: // If we get till here, the option is unhandled and hence unknown. usage("Unrecognized option '%s'", argv[i]); @@ -746,6 +777,34 @@ static void listAudioDevices() { } } +/** Display all games in the given directory, or current directory if empty */ +static bool autoDetect(Common::String path) { + if (path.empty()) + path = "."; + //Current directory + Common::FSNode dir(path); + + Common::FSList files; + + //Collect all files from directory + dir.getChildren(files, Common::FSNode::kListAll); + + GameList candidates(EngineMan.detectGames(files)); + if (candidates.empty()) { + printf("ScummVM could not find any game in %s\n", path.c_str()); + return false; + } + + // Print all the candidate found + printf("ID Description\n"); + printf("-------------------- ---------------------------------------------------------\n"); + for (GameList::iterator v = candidates.begin(); v != candidates.end(); ++v) { + printf("%-20s %s\n", v->gameid().c_str(), v->description().c_str()); + } + // Set the active domain to the first one to start it. + ConfMan.setActiveDomain(candidates.begin()->gameid()); + return true; +} #ifdef DETECTOR_TESTING_HACK static void runDetectorTest() { @@ -972,6 +1031,10 @@ bool processSettings(Common::String &command, Common::StringMap &settings, Commo } else if (command == "help") { printf(HELP_STRING, s_appName); return true; + } else if (command == "auto-detect") { + // If auto-detects succeed, we want to return false so that the game is started + return !autoDetect(settings["path"]); + //return true; } #ifdef DETECTOR_TESTING_HACK else if (command == "test-detector") { diff --git a/base/internal_version.h b/base/internal_version.h index 29aacf2d95..c46922da57 100644 --- a/base/internal_version.h +++ b/base/internal_version.h @@ -16,4 +16,4 @@ #define SCUMMVM_REVISION #endif -#define SCUMMVM_VERSION "1.9.0git" SCUMMVM_REVISION +#define SCUMMVM_VERSION "1.10.0git" SCUMMVM_REVISION diff --git a/base/main.cpp b/base/main.cpp index ff441df49c..c52888a827 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -51,6 +51,7 @@ #include "common/textconsole.h" #include "common/tokenizer.h" #include "common/translation.h" +#include "common/osd_message_queue.h" #include "gui/gui-manager.h" #include "gui/error.h" @@ -66,6 +67,15 @@ #endif #include "backends/keymapper/keymapper.h" +#ifdef USE_CLOUD +#ifdef USE_LIBCURL +#include "backends/cloud/cloudmanager.h" +#include "backends/networking/curl/connectionmanager.h" +#endif +#ifdef USE_SDL_NET +#include "backends/networking/sdl_net/localwebserver.h" +#endif +#endif #if defined(_WIN32_WCE) #include "backends/platform/wince/CELauncherDialog.h" @@ -75,6 +85,9 @@ #include "gui/launcher.h" #endif +#ifdef USE_UPDATES +#include "gui/updates-dialog.h" +#endif static bool launcherDialog() { @@ -148,8 +161,11 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const #endif // Verify that the game path refers to an actual directory - if (!(dir.exists() && dir.isDirectory())) + if (!dir.exists()) { + err = Common::kPathDoesNotExist; + } else if (!dir.isDirectory()) { err = Common::kPathNotDirectory; + } // Create the game engine if (err.getCode() == Common::kNoError) { @@ -277,6 +293,8 @@ static void setupGraphics(OSystem &system) { system.setFeatureState(OSystem::kFeatureAspectRatioCorrection, ConfMan.getBool("aspect_ratio")); if (ConfMan.hasKey("fullscreen")) system.setFeatureState(OSystem::kFeatureFullscreenMode, ConfMan.getBool("fullscreen")); + if (ConfMan.hasKey("filtering")) + system.setFeatureState(OSystem::kFeatureFilteringMode, ConfMan.getBool("filtering")); system.endGFXTransaction(); // When starting up launcher for the first time, the user might have specified @@ -382,7 +400,12 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { if (settings.contains("debugflags")) { specialDebug = settings["debugflags"]; settings.erase("debugflags"); - } + } else if (ConfMan.hasKey("debugflags")) + specialDebug = ConfMan.get("debugflags"); + + if (settings.contains("debug-channels-only")) + gDebugChannelsOnly = true; + PluginManager::instance().init(); PluginManager::instance().loadAllPlugins(); // load plugins for cached plugin manager @@ -455,9 +478,23 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { g_eventRec.RegisterEventSource(); #endif + Common::OSDMessageQueue::instance().registerEventSource(); + // Now as the event manager is created, setup the keymapper setupKeymapper(system); +#ifdef USE_UPDATES + if (!ConfMan.hasKey("updates_check")) { + GUI::UpdatesDialog dlg; + dlg.runModal(); + } +#endif + +#if defined(USE_CLOUD) && defined(USE_LIBCURL) + CloudMan.init(); + CloudMan.syncSaves(); +#endif + // Unless a game was specified, show the launcher dialog if (0 == ConfMan.getActiveDomain()) launcherDialog(); @@ -566,11 +603,22 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { launcherDialog(); } } +#ifdef USE_CLOUD +#ifdef USE_SDL_NET + Networking::LocalWebserver::destroy(); +#endif +#ifdef USE_LIBCURL + Networking::ConnectionManager::destroy(); + //I think it's important to destroy it after ConnectionManager + Cloud::CloudManager::destroy(); +#endif +#endif PluginManager::instance().unloadAllPlugins(); PluginManager::destroy(); GUI::GuiManager::destroy(); Common::ConfigManager::destroy(); Common::DebugManager::destroy(); + Common::OSDMessageQueue::destroy(); #ifdef ENABLE_EVENTRECORDER GUI::EventRecorder::destroy(); #endif diff --git a/base/plugins.h b/base/plugins.h index 6037fc2d71..2793ff3ffd 100644 --- a/base/plugins.h +++ b/base/plugins.h @@ -79,8 +79,12 @@ extern int pluginTypeVersions[PLUGIN_TYPE_MAX]; #define PLUGIN_ENABLED_STATIC(ID) \ (ENABLE_##ID && !PLUGIN_ENABLED_DYNAMIC(ID)) -#define PLUGIN_ENABLED_DYNAMIC(ID) \ - (ENABLE_##ID && (ENABLE_##ID == DYNAMIC_PLUGIN) && defined(DYNAMIC_MODULES)) +#ifdef DYNAMIC_MODULES + #define PLUGIN_ENABLED_DYNAMIC(ID) \ + (ENABLE_##ID && (ENABLE_##ID == DYNAMIC_PLUGIN)) +#else + #define PLUGIN_ENABLED_DYNAMIC(ID) 0 +#endif // see comments in backends/plugins/elf/elf-provider.cpp #if defined(USE_ELF_LOADER) && defined(ELF_LOADER_CXA_ATEXIT) diff --git a/base/version.cpp b/base/version.cpp index fcb2740de9..43795294ba 100644 --- a/base/version.cpp +++ b/base/version.cpp @@ -51,13 +51,13 @@ * header file, analog to internal_version.h, maybe called svn_rev.h or so.) * * Drawback: This only works on systems which can run suitable scripts as part - * of the build proces (so I guess Visual C++ would be out of the game here? + * of the build process (so I guess Visual C++ would be out of the game here? * I don't know VC enough to be sure). And of course it must be robust enough * to properly work in exports (i.e. release tar balls etc.). */ const char *gScummVMVersion = SCUMMVM_VERSION; #ifdef __amigaos4__ -static const char *version_cookie __attribute__((used)) = "$VER: ScummVM " SCUMMVM_VERSION " (" __DATE__ ", " __TIME__ ")"; +static const char *version_cookie __attribute__((used)) = "$VER: ScummVM " SCUMMVM_VERSION " (" AMIGA_DATE ")"; #endif #ifdef __PLAYSTATION2__ const char *gScummVMBuildDate = "Git Master"; /* ScummVM Git Master */ @@ -154,4 +154,25 @@ const char *gScummVMFeatures = "" #ifdef ENABLE_VKEYBD "virtual keyboard " #endif + +#ifdef USE_CLOUD + "cloud (" +#ifdef USE_LIBCURL + "servers" +#ifdef USE_SDL_NET + ", " +#endif +#endif +#ifdef USE_SDL_NET + "local" +#endif + ") " +#else +#ifdef USE_LIBCURL + "libcurl " +#endif +#ifdef USE_SDL_NET + "SDL_net " +#endif +#endif ; |
