aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorChristopher Page2008-05-28 20:30:20 +0000
committerChristopher Page2008-05-28 20:30:20 +0000
commit8297ead2671e43963098a3dc41e8e75fdbce4ddc (patch)
tree72b0e2bb7d03e461cc157ea5f093261ab902fbfb /base
parent3c0e72bb25f83120f0320782793af64213cbd1c2 (diff)
parent057af1000f5187a93fc1ac1a5f61a7a6a382bf03 (diff)
downloadscummvm-rg350-8297ead2671e43963098a3dc41e8e75fdbce4ddc.tar.gz
scummvm-rg350-8297ead2671e43963098a3dc41e8e75fdbce4ddc.tar.bz2
scummvm-rg350-8297ead2671e43963098a3dc41e8e75fdbce4ddc.zip
Merged revisions 32124,32126-32128,32131,32133,32135-32144,32146-32153,32155-32163,32165-32168,32170-32173,32175-32179,32181-32191,32193-32202,32204-32205,32209-32214,32216,32218,32220-32235,32237-32266,32269-32271,32273-32290,32292-32295,32297-32317,32319-32323,32325-32328,32330-32331,32334-32338,32343-32347 via svnmerge from
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk svn-id: r32350
Diffstat (limited to 'base')
-rw-r--r--base/commandLine.cpp11
-rw-r--r--base/main.cpp9
-rw-r--r--base/plugins.cpp26
-rw-r--r--base/plugins.h15
4 files changed, 32 insertions, 29 deletions
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index d2f286cc4a..b9fd4ecfb7 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -46,6 +46,8 @@
#endif
#elif defined(__SYMBIAN32__)
#define DEFAULT_SAVE_PATH "Savegames"
+#elif defined(PALMOS_MODE)
+#define DEFAULT_SAVE_PATH "/PALM/Programs/ScummVM/Saved"
#endif
#define DETECTOR_TESTING_HACK
@@ -146,7 +148,7 @@ static void usage(const char *s, ...) {
vsnprintf(buf, STRINGBUFLEN, s, va);
va_end(va);
-#if !(defined(PALMOS_ARM) || defined(PALMOS_DEBUG) || defined(__GP32__) || defined (__SYMBIAN32__))
+#if !(defined(__GP32__) || defined (__SYMBIAN32__))
printf(USAGE_STRING, s_appName, buf, s_appName, s_appName);
#endif
exit(1);
@@ -229,6 +231,9 @@ void registerDefaults() {
ConfMan.registerDefault("savepath", savePath);
#elif defined (IPHONE)
ConfMan.registerDefault("savepath", OSystem_IPHONE::getSavePath());
+
+#elif defined(PALMOS_MODE)
+ ConfMan.registerDefault("savepath", DEFAULT_SAVE_PATH);
#endif
#endif // #ifdef DEFAULT_SAVE_PATH
@@ -559,8 +564,8 @@ static void listGames() {
printf("Game ID Full Title \n"
"-------------------- ------------------------------------------------------\n");
- const EnginePlugin::list &plugins = EngineMan.getPlugins();
- EnginePlugin::list::const_iterator iter = plugins.begin();
+ const EnginePlugin::List &plugins = EngineMan.getPlugins();
+ EnginePlugin::List::const_iterator iter = plugins.begin();
for (iter = plugins.begin(); iter != plugins.end(); ++iter) {
GameList list = (**iter)->getSupportedGames();
for (GameList::iterator v = list.begin(); v != list.end(); ++v) {
diff --git a/base/main.cpp b/base/main.cpp
index 126700ef17..dbf740c2ec 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -90,17 +90,20 @@ static const EnginePlugin *detectPlugin() {
ConfMan.set("gameid", gameid);
// Query the plugins and find one that will handle the specified gameid
- printf("Looking for %s\n", gameid.c_str());
+ printf("User picked target '%s' (gameid '%s')...\n", ConfMan.getActiveDomainName().c_str(), gameid.c_str());
+ printf(" Looking for a plugin supporting this gameid... ");
GameDescriptor game = EngineMan.findGame(gameid, &plugin);
if (plugin == 0) {
- printf("Failed game detection\n");
+ printf("failed\n");
warning("%s is an invalid gameid. Use the --list-games option to list supported gameid", gameid.c_str());
return 0;
+ } else {
+ printf("%s\n", plugin->getName());
}
// FIXME: Do we really need this one?
- printf("Trying to start game '%s'\n", game.description().c_str());
+ printf(" Starting '%s'\n", game.description().c_str());
return plugin;
}
diff --git a/base/plugins.cpp b/base/plugins.cpp
index ac8e498469..7c365c7eb6 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -25,6 +25,8 @@
#include "base/plugins.h"
+#include "common/func.h"
+
#ifdef DYNAMIC_MODULES
#include "common/config-manager.h"
#endif
@@ -284,10 +286,8 @@ void PluginManager::loadPlugins() {
for (ProviderList::iterator pp = _providers.begin();
pp != _providers.end();
++pp) {
- PluginList pl((**pp).getPlugins());
- for (PluginList::iterator plugin = pl.begin(); plugin != pl.end(); ++plugin) {
- tryLoadPlugin(*plugin);
- }
+ PluginList pl((*pp)->getPlugins());
+ Common::for_each(pl.begin(), pl.end(), Common::bind1st(Common::mem_fun(&PluginManager::tryLoadPlugin), this));
}
}
@@ -303,7 +303,7 @@ void PluginManager::unloadPluginsExcept(PluginType type, const Plugin *plugin) {
if (*p == plugin) {
found = *p;
} else {
- (**p).unloadPlugin();
+ (*p)->unloadPlugin();
delete *p;
}
}
@@ -355,13 +355,13 @@ DECLARE_SINGLETON(EngineManager);
GameDescriptor EngineManager::findGame(const Common::String &gameName, const EnginePlugin **plugin) const {
// Find the GameDescriptor for this target
- const EnginePlugin::list &plugins = getPlugins();
+ const EnginePlugin::List &plugins = getPlugins();
GameDescriptor result;
if (plugin)
*plugin = 0;
- EnginePlugin::list::const_iterator iter = plugins.begin();
+ EnginePlugin::List::const_iterator iter = plugins.begin();
for (iter = plugins.begin(); iter != plugins.end(); ++iter) {
result = (**iter)->findGame(gameName.c_str());
if (!result.gameid().empty()) {
@@ -376,11 +376,11 @@ GameDescriptor EngineManager::findGame(const Common::String &gameName, const Eng
GameList EngineManager::detectGames(const FSList &fslist) const {
GameList candidates;
- const EnginePlugin::list &plugins = getPlugins();
+ const EnginePlugin::List &plugins = getPlugins();
// Iterate over all known games and for each check if it might be
// the game in the presented directory.
- EnginePlugin::list::const_iterator iter;
+ EnginePlugin::List::const_iterator iter;
for (iter = plugins.begin(); iter != plugins.end(); ++iter) {
candidates.push_back((**iter)->detectGames(fslist));
}
@@ -388,8 +388,8 @@ GameList EngineManager::detectGames(const FSList &fslist) const {
return candidates;
}
-const EnginePlugin::list &EngineManager::getPlugins() const {
- return (const EnginePlugin::list&)PluginManager::instance().getPlugins(PLUGIN_TYPE_ENGINE);
+const EnginePlugin::List &EngineManager::getPlugins() const {
+ return (const EnginePlugin::List &)PluginManager::instance().getPlugins(PLUGIN_TYPE_ENGINE);
}
@@ -399,6 +399,6 @@ const EnginePlugin::list &EngineManager::getPlugins() const {
DECLARE_SINGLETON(MidiManager);
-const MidiPlugin::list &MidiManager::getPlugins() const {
- return (const MidiPlugin::list&)PluginManager::instance().getPlugins(PLUGIN_TYPE_MIDI);
+const MidiPlugin::List &MidiManager::getPlugins() const {
+ return (const MidiPlugin::List &)PluginManager::instance().getPlugins(PLUGIN_TYPE_MIDI);
}
diff --git a/base/plugins.h b/base/plugins.h
index d03a240922..2eaa290ed7 100644
--- a/base/plugins.h
+++ b/base/plugins.h
@@ -63,6 +63,7 @@
enum PluginType {
PLUGIN_TYPE_ENGINE = 0,
PLUGIN_TYPE_MIDI,
+ /* PLUGIN_TYPE_SCALER, */ // TODO: Add graphics scaler plugins
PLUGIN_TYPE_MAX
};
@@ -81,16 +82,10 @@ extern int pluginTypeVersions[PLUGIN_TYPE_MAX];
#define DYNAMIC_PLUGIN 2
#define PLUGIN_ENABLED_STATIC(ID) \
- (defined(ENABLE_##ID) && !PLUGIN_ENABLED_DYNAMIC(ID))
-
-// HACK for MSVC
-#if defined(_MSC_VER)
- #undef PLUGIN_ENABLED_STATIC
- #define PLUGIN_ENABLED_STATIC(ID) 1
-#endif
+ (defined( ENABLE_##ID ) && !PLUGIN_ENABLED_DYNAMIC(ID))
#define PLUGIN_ENABLED_DYNAMIC(ID) \
- (defined(ENABLE_##ID) && (ENABLE_##ID == DYNAMIC_PLUGIN) && defined(DYNAMIC_MODULES))
+ (defined( ENABLE_##ID ) && (ENABLE_##ID == DYNAMIC_PLUGIN) && defined(DYNAMIC_MODULES))
/**
* REGISTER_PLUGIN_STATIC is a convenience macro which is used to declare
@@ -192,7 +187,7 @@ public:
return (PO_t *)_pluginObject;
}
- typedef Common::Array<PluginSubclass *> list;
+ typedef Common::Array<PluginSubclass *> List;
};
/**
@@ -245,7 +240,7 @@ protected:
* @param filename the name of the loadable code module
* @return a pointer to a Plugin instance, or 0 if an error occurred.
*/
- virtual Plugin* createPlugin(const Common::String &filename) const = 0;
+ virtual Plugin *createPlugin(const Common::String &filename) const = 0;
/**
* Check if the supplied filename corresponds to a loadable plugin file in