aboutsummaryrefslogtreecommitdiff
path: root/backends/plugins/ds
diff options
context:
space:
mode:
authorTony Puccinelli2010-08-06 06:54:44 +0000
committerTony Puccinelli2010-08-06 06:54:44 +0000
commit4bed67767cc4b8555a3d7169fcbb589ce0145303 (patch)
treed78c581f5367b4d27fed255c93df5a9166c601a2 /backends/plugins/ds
parentd4a4176123f1a39916d1b407ab531bf3adb04697 (diff)
downloadscummvm-rg350-4bed67767cc4b8555a3d7169fcbb589ce0145303.tar.gz
scummvm-rg350-4bed67767cc4b8555a3d7169fcbb589ce0145303.tar.bz2
scummvm-rg350-4bed67767cc4b8555a3d7169fcbb589ce0145303.zip
added loadPlugin function into DSPlugin (doesn't use a DSDLObject yet)
svn-id: r51778
Diffstat (limited to 'backends/plugins/ds')
-rw-r--r--backends/plugins/ds/ds-provider.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/backends/plugins/ds/ds-provider.cpp b/backends/plugins/ds/ds-provider.cpp
index e4ffb7bd43..999781754b 100644
--- a/backends/plugins/ds/ds-provider.cpp
+++ b/backends/plugins/ds/ds-provider.cpp
@@ -45,11 +45,32 @@ public:
unloadPlugin();
}
+ bool loadPlugin();
};
-/*bool DSPlugin::loadPlugin() {
+bool DSPlugin::loadPlugin() {
+ assert(!_dlHandle);
+ DLObject *obj = new DLObject(NULL);
+ if (obj->open(_filename.c_str())) {
+ _dlHandle = obj;
+ } else {
+ delete obj;
+ _dlHandle = NULL;
+ }
-};*/
+ if (!_dlHandle) {
+ warning("Failed loading plugin '%s'", _filename.c_str());
+ return false;
+ }
+
+ bool ret = DynamicPlugin::loadPlugin();
+
+ if (ret && _dlHandle) {
+ _dlHandle->discard_symtab();
+ }
+
+ return ret;
+};
Plugin* DSPluginProvider::createPlugin(const Common::FSNode &node) const {
return new DSPlugin(node.getPath());