diff options
Diffstat (limited to 'base')
-rw-r--r-- | base/commandLine.cpp | 11 | ||||
-rw-r--r-- | base/main.cpp | 9 | ||||
-rw-r--r-- | base/plugins.cpp | 26 | ||||
-rw-r--r-- | base/plugins.h | 15 |
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 |