From 5204d012f6b059532f68e9c7330616989f95a380 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 20 May 2008 15:54:27 +0000 Subject: Add a tiny TODO entry for graphics scaler plugins svn-id: r32194 --- base/plugins.h | 1 + 1 file changed, 1 insertion(+) (limited to 'base') diff --git a/base/plugins.h b/base/plugins.h index d03a240922..20469e67bd 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 }; -- cgit v1.2.3 From 770f0ad619a354f6a60ec41d2027ca0142ff8f13 Mon Sep 17 00:00:00 2001 From: Chris Apers Date: Fri, 23 May 2008 12:59:18 +0000 Subject: Use default save game class svn-id: r32227 --- base/commandLine.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'base') diff --git a/base/commandLine.cpp b/base/commandLine.cpp index d2f286cc4a..96ed6c89f1 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 -- cgit v1.2.3 From 6af9fcc57991c504382bd5a3be65fc4992c2e868 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 24 May 2008 14:12:32 +0000 Subject: Made the startup log output a bit more informative svn-id: r32243 --- base/main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'base') diff --git a/base/main.cpp b/base/main.cpp index c36c506d7f..ff246fd8b3 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; } -- cgit v1.2.3 From 2862a30dac114fd728e80669a15f315fe21bc8d6 Mon Sep 17 00:00:00 2001 From: Jordi Vilalta Prat Date: Mon, 26 May 2008 00:28:48 +0000 Subject: Fixed some code formatting thanks to LordHoto svn-id: r32275 --- base/commandLine.cpp | 4 ++-- base/plugins.cpp | 20 ++++++++++---------- base/plugins.h | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'base') diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 96ed6c89f1..b9fd4ecfb7 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -564,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/plugins.cpp b/base/plugins.cpp index ac8e498469..435e5bf1f1 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -284,7 +284,7 @@ void PluginManager::loadPlugins() { for (ProviderList::iterator pp = _providers.begin(); pp != _providers.end(); ++pp) { - PluginList pl((**pp).getPlugins()); + PluginList pl((*pp)->getPlugins()); for (PluginList::iterator plugin = pl.begin(); plugin != pl.end(); ++plugin) { tryLoadPlugin(*plugin); } @@ -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 20469e67bd..7507e0c358 100644 --- a/base/plugins.h +++ b/base/plugins.h @@ -193,7 +193,7 @@ public: return (PO_t *)_pluginObject; } - typedef Common::Array list; + typedef Common::Array List; }; /** @@ -246,7 +246,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 -- cgit v1.2.3 From a6d591b947384470a85e2229c231df1eb3773ff7 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 26 May 2008 12:12:51 +0000 Subject: Replaced a loop in PluginManger::loadPlugins with Common::for_each as a typical usage example. svn-id: r32286 --- base/plugins.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'base') diff --git a/base/plugins.cpp b/base/plugins.cpp index 435e5bf1f1..052bca935d 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -285,9 +285,7 @@ void PluginManager::loadPlugins() { pp != _providers.end(); ++pp) { PluginList pl((*pp)->getPlugins()); - for (PluginList::iterator plugin = pl.begin(); plugin != pl.end(); ++plugin) { - tryLoadPlugin(*plugin); - } + Common::for_each(pl.begin(), pl.end(), Common::bind1st(Common::mem_fun(&PluginManager::tryLoadPlugin), this)); } } -- cgit v1.2.3 From 86d0dcabde0224872a4e00012d553ed202752fe3 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 26 May 2008 12:43:01 +0000 Subject: Should fix compiling erros. svn-id: r32289 --- base/plugins.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'base') diff --git a/base/plugins.cpp b/base/plugins.cpp index 052bca935d..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 -- cgit v1.2.3 From 057af1000f5187a93fc1ac1a5f61a7a6a382bf03 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 28 May 2008 19:45:04 +0000 Subject: Removed an MSVC specific hack, after discussing with jvprat. It seems that MSVC was trying to add the parenthesis after ENABLE_##ID to the check... svn-id: r32347 --- base/plugins.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'base') diff --git a/base/plugins.h b/base/plugins.h index 7507e0c358..2eaa290ed7 100644 --- a/base/plugins.h +++ b/base/plugins.h @@ -82,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 -- cgit v1.2.3