diff options
author | Yotam Barnoy | 2010-11-03 22:01:01 +0000 |
---|---|---|
committer | Yotam Barnoy | 2010-11-03 22:01:01 +0000 |
commit | 13b904d282ea607db94069b927d6cb1b19aa0d0b (patch) | |
tree | cbc8efcc281f735beb9f45117e82a30872995ac7 /base/main.cpp | |
parent | 0ac1eb82c65e7f20f51f6337df5aa64e02a1af29 (diff) | |
parent | 27182f266f48a6d55dd5d830ed19e2c4285ac1ba (diff) | |
download | scummvm-rg350-13b904d282ea607db94069b927d6cb1b19aa0d0b.tar.gz scummvm-rg350-13b904d282ea607db94069b927d6cb1b19aa0d0b.tar.bz2 scummvm-rg350-13b904d282ea607db94069b927d6cb1b19aa0d0b.zip |
Merge from gsoc2010-plugins
This merge was extremely difficult to carry out. It wasn't entirely SVN's fault -- there were several merges to the branch that were done by hand. Please check for any issues and regressions. Also note that the DS makefile was not copied over since the "one at a time" plugin mode currently has too much fragmentation ie. it doesn't work.
svn-id: r54051
Diffstat (limited to 'base/main.cpp')
-rw-r--r-- | base/main.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/base/main.cpp b/base/main.cpp index d2da09fa2f..8928396642 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -105,7 +105,12 @@ 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... "); - GameDescriptor game = EngineMan.findGame(gameid, &plugin); + +#if defined(ONE_PLUGIN_AT_A_TIME) && defined(DYNAMIC_MODULES) + GameDescriptor game = EngineMan.findGameOnePlugAtATime(gameid, &plugin); +#else + GameDescriptor game = EngineMan.findGame(gameid, &plugin); +#endif if (plugin == 0) { printf("failed\n"); @@ -336,8 +341,13 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { settings.erase("debugflags"); } - // Load the plugins. - PluginManager::instance().loadPlugins(); +#if defined(ONE_PLUGIN_AT_A_TIME) && defined(DYNAMIC_MODULES) + // Only load non-engine plugins and first engine plugin initially in this case. + PluginManager::instance().loadFirstPlugin(); +#else + // Load the plugins. + PluginManager::instance().loadPlugins(); +#endif // If we received an invalid music parameter via command line we check this here. // We can't check this before loading the music plugins. @@ -420,7 +430,12 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { ConfMan.setActiveDomain(""); // PluginManager::instance().unloadPlugins(); + +#if defined(ONE_PLUGIN_AT_A_TIME) && defined(DYNAMIC_MODULES) + PluginManager::instance().loadFirstPlugin(); +#else PluginManager::instance().loadPlugins(); +#endif } else { GUI::displayErrorDialog(_("Could not find any engine capable of running the selected game")); } |