aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--base/plugins.cpp46
-rw-r--r--base/plugins.h11
2 files changed, 56 insertions, 1 deletions
diff --git a/base/plugins.cpp b/base/plugins.cpp
index a8e6ff63b6..0f1db6d6d7 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -286,11 +286,24 @@ void PluginManager::loadPlugins() {
}
#else
+
+#ifdef PALMOS_ARM
+ #define FREE_PLUGIN(ID) \
+ extern PluginRegistrator *g_##ID##_PluginReg; \
+ delete g_##ID##_PluginReg;
+
+ #define LINK_PLUGIN(ID) \
+ extern PluginRegistrator *g_##ID##_PluginReg; \
+ extern void g_##ID##_PluginReg_alloc(); \
+ g_##ID##_PluginReg_alloc(); \
+ plugin = g_##ID##_PluginReg; \
+ tryLoadPlugin(new StaticPlugin(plugin->_name, plugin->_games, plugin->_ef, plugin->_df));
+#else
#define LINK_PLUGIN(ID) \
extern PluginRegistrator g_##ID##_PluginReg; \
plugin = &g_##ID##_PluginReg; \
tryLoadPlugin(new StaticPlugin(plugin->_name, plugin->_games, plugin->_ef, plugin->_df));
-
+#endif
// "Loader" for the static plugins.
// Iterate over all registered (static) plugins and load them.
PluginRegistrator *plugin;
@@ -328,6 +341,36 @@ void PluginManager::loadPlugins() {
void PluginManager::unloadPlugins() {
unloadPluginsExcept(NULL);
+
+#ifdef PALMOS_ARM
+ #ifndef DISABLE_SCUMM
+ FREE_PLUGIN(SCUMM)
+ #endif
+ #ifndef DISABLE_SKY
+ FREE_PLUGIN(SKY)
+ #endif
+ #ifndef DISABLE_SWORD1
+ FREE_PLUGIN(SWORD1)
+ #endif
+ #ifndef DISABLE_SWORD2
+ FREE_PLUGIN(SWORD2)
+ #endif
+ #ifndef DISABLE_SIMON
+ FREE_PLUGIN(SIMON)
+ #endif
+ #ifndef DISABLE_QUEEN
+ FREE_PLUGIN(QUEEN)
+ #endif
+ #ifndef DISABLE_SAGA
+ FREE_PLUGIN(SAGA)
+ #endif
+ #ifndef DISABLE_KYRA
+ FREE_PLUGIN(KYRA)
+ #endif
+ #ifndef DISABLE_GOB
+ FREE_PLUGIN(GOB)
+ #endif
+#endif
}
void PluginManager::unloadPluginsExcept(const Plugin *plugin) {
@@ -373,3 +416,4 @@ DetectedGameList PluginManager::detectGames(const FSList &fslist) const {
return candidates;
}
+
diff --git a/base/plugins.h b/base/plugins.h
index d2b0cca4d3..e3b17de4a5 100644
--- a/base/plugins.h
+++ b/base/plugins.h
@@ -86,6 +86,15 @@ public:
* @todo add some means to query the plugin API version etc.
* @todo on Windows, we might need __declspec(dllexport) ?
*/
+
+#ifdef PALMOS_ARM
+#define REGISTER_PLUGIN(ID,name) \
+ PluginRegistrator *g_##ID##_PluginReg; \
+ void g_##ID##_PluginReg_alloc() { \
+ g_##ID##_PluginReg = new PluginRegistrator(name, Engine_##ID##_gameList(), Engine_##ID##_create, Engine_##ID##_detectGames);\
+ }
+#else
+
#ifndef DYNAMIC_MODULES
#define REGISTER_PLUGIN(ID,name) \
PluginRegistrator g_##ID##_PluginReg(name, Engine_##ID##_gameList(), Engine_##ID##_create, Engine_##ID##_detectGames);
@@ -98,6 +107,7 @@ public:
PLUGIN_EXPORT DetectedGameList PLUGIN_detectGames(const FSList &fslist) { return Engine_##ID##_detectGames(fslist); } \
}
#endif
+#endif
#ifndef DYNAMIC_MODULES
/**
@@ -156,3 +166,4 @@ public:
};
#endif
+