aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/module.mk5
-rw-r--r--backends/platform/dc/Makefile2
-rw-r--r--backends/platform/dc/dc.h17
-rw-r--r--backends/platform/dc/dcmain.cpp3
-rw-r--r--backends/platform/dc/module.mk2
-rw-r--r--backends/platform/dc/plugins.cpp (renamed from backends/plugins/dc/dc-provider.cpp)11
-rw-r--r--backends/plugins/dc/dc-provider.h42
7 files changed, 24 insertions, 58 deletions
diff --git a/backends/module.mk b/backends/module.mk
index 426409ab73..cd0e2a56de 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -75,11 +75,6 @@ MODULE_OBJS := \
vkeybd/virtual-keyboard-gui.o \
vkeybd/virtual-keyboard-parser.o
-ifeq ($(BACKEND),dc)
-MODULE_OBJS += \
- plugins/dc/dc-provider.o
-endif
-
ifeq ($(BACKEND),ds)
MODULE_OBJS += \
fs/ds/ds-fs-factory.o \
diff --git a/backends/platform/dc/Makefile b/backends/platform/dc/Makefile
index 637f474b4b..11d9421a0a 100644
--- a/backends/platform/dc/Makefile
+++ b/backends/platform/dc/Makefile
@@ -65,7 +65,7 @@ ENABLE_TOUCHE = $(ENABLED)
ENABLE_TUCKER = $(ENABLED)
OBJS := dcmain.o time.o display.o audio.o input.o selector.o icon.o \
- label.o vmsave.o softkbd.o dcloader.o cache.o dc-fs.o
+ label.o vmsave.o softkbd.o dcloader.o cache.o dc-fs.o plugins.o
MODULE_DIRS += ./
diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h
index 76c4b8cfd2..f0c8c1f96c 100644
--- a/backends/platform/dc/dc.h
+++ b/backends/platform/dc/dc.h
@@ -31,6 +31,9 @@
#include "backends/audiocd/default/default-audiocd.h"
#include "backends/fs/fs-factory.h"
#include "audio/mixer_intern.h"
+#ifdef DYNAMIC_MODULES
+#include "backends/plugins/dynamic-plugin.h"
+#endif
#define NUM_BUFFERS 4
#define SOUND_BUFFER_SHIFT 3
@@ -69,7 +72,11 @@ class DCCDManager : public DefaultAudioCDManager {
void updateCD();
};
-class OSystem_Dreamcast : private DCHardware, public BaseBackend, public PaletteManager, public FilesystemFactory {
+class OSystem_Dreamcast : private DCHardware, public BaseBackend, public PaletteManager, public FilesystemFactory
+#ifdef DYNAMIC_MODULES
+ , public FilePluginProvider
+#endif
+ {
public:
OSystem_Dreamcast();
@@ -250,6 +257,14 @@ public:
void logMessage(LogMessageType::Type type, const char *message);
Common::String getSystemLanguage() const;
+
+#ifdef DYNAMIC_MODULES
+ class DCPlugin;
+
+ protected:
+ Plugin* createPlugin(const Common::FSNode &node) const;
+ bool isPluginFilename(const Common::FSNode &node) const;
+#endif
};
diff --git a/backends/platform/dc/dcmain.cpp b/backends/platform/dc/dcmain.cpp
index bbd4f994f7..f9640130d3 100644
--- a/backends/platform/dc/dcmain.cpp
+++ b/backends/platform/dc/dcmain.cpp
@@ -33,7 +33,6 @@
#include <common/config-manager.h>
#include <common/memstream.h>
-#include "backends/plugins/dc/dc-provider.h"
#include "audio/mixer_intern.h"
@@ -336,7 +335,7 @@ int main()
g_system = &osys_dc;
#ifdef DYNAMIC_MODULES
- PluginManager::instance().addPluginProvider(new DCPluginProvider());
+ PluginManager::instance().addPluginProvider(&osys_dc);
#endif
scummvm_main(argc, argv);
diff --git a/backends/platform/dc/module.mk b/backends/platform/dc/module.mk
index c52ca1a474..9ab287c080 100644
--- a/backends/platform/dc/module.mk
+++ b/backends/platform/dc/module.mk
@@ -1,7 +1,7 @@
MODULE := backends/platform/dc
MODULE_OBJS := dcmain.o time.o display.o audio.o input.o selector.o icon.o \
- label.o vmsave.o softkbd.o dcloader.o cache.o dc-fs.o
+ label.o vmsave.o softkbd.o dcloader.o cache.o dc-fs.o plugins.o
# We don't use rules.mk but rather manually update OBJS and MODULE_DIRS.
MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS))
diff --git a/backends/plugins/dc/dc-provider.cpp b/backends/platform/dc/plugins.cpp
index 86ef68828c..7b07947847 100644
--- a/backends/plugins/dc/dc-provider.cpp
+++ b/backends/platform/dc/plugins.cpp
@@ -25,16 +25,15 @@
#include "common/scummsys.h"
-#if defined(DYNAMIC_MODULES) && defined(__DC__)
+#if defined(DYNAMIC_MODULES)
-#include "backends/plugins/dc/dc-provider.h"
#include "backends/plugins/dynamic-plugin.h"
#include "common/fs.h"
#include "dcloader.h"
-class DCPlugin : public DynamicPlugin {
+class OSystem_Dreamcast::DCPlugin : public DynamicPlugin {
protected:
void *_dlHandle;
@@ -85,11 +84,11 @@ public:
};
-Plugin* DCPluginProvider::createPlugin(const Common::FSNode &node) const {
+Plugin* OSystem_Dreamcast::createPlugin(const Common::FSNode &node) const {
return new DCPlugin(node.getPath());
}
-bool DCPluginProvider::isPluginFilename(const Common::FSNode &node) const {
+bool OSystem_Dreamcast::isPluginFilename(const Common::FSNode &node) const {
// Check the plugin suffix
Common::String filename = node.getName();
if (!filename.hasSuffix(".PLG"))
@@ -98,4 +97,4 @@ bool DCPluginProvider::isPluginFilename(const Common::FSNode &node) const {
return true;
}
-#endif // defined(DYNAMIC_MODULES) && defined(__DC__)
+#endif // defined(DYNAMIC_MODULES)
diff --git a/backends/plugins/dc/dc-provider.h b/backends/plugins/dc/dc-provider.h
deleted file mode 100644
index 55413ade5a..0000000000
--- a/backends/plugins/dc/dc-provider.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#ifndef BACKENDS_PLUGINS_DC_H
-#define BACKENDS_PLUGINS_DC_H
-
-#include "base/plugins.h"
-
-#if defined(DYNAMIC_MODULES) && defined(__DC__)
-
-class DCPluginProvider : public FilePluginProvider {
-protected:
- Plugin* createPlugin(const Common::FSNode &node) const;
-
- bool isPluginFilename(const Common::FSNode &node) const;
-};
-
-#endif // defined(DYNAMIC_MODULES) && defined(__DC__)
-
-#endif