diff options
author | Max Horn | 2010-11-05 01:20:34 +0000 |
---|---|---|
committer | Max Horn | 2010-11-05 01:20:34 +0000 |
commit | 7ace85e63646d3fd4843e7f45595bc04f3b2c7dc (patch) | |
tree | 31fb058c695dab2969f5bf6a4f33db6973c20a33 /backends/plugins/ps2 | |
parent | 102e7ee88cf04fa470ec372a1ac38846d278d463 (diff) | |
download | scummvm-rg350-7ace85e63646d3fd4843e7f45595bc04f3b2c7dc.tar.gz scummvm-rg350-7ace85e63646d3fd4843e7f45595bc04f3b2c7dc.tar.bz2 scummvm-rg350-7ace85e63646d3fd4843e7f45595bc04f3b2c7dc.zip |
PLUGINS: Simplify ELF plugin providers & DLObject subclasses
* Remove DLObject virtual methods allocSegment and freeSegment.
As long as all DLObject implementations use memalign + free to
allocate/release segments, there is no point in wrapping those.
This enables further simplifications.
* Add TemplatedELFPlugin template class. Use this instead of explicit
ELFPlugin subclasses.
* Rename DLObject::discard_symtab to discardSymtab
svn-id: r54082
Diffstat (limited to 'backends/plugins/ps2')
-rw-r--r-- | backends/plugins/ps2/ps2-provider.cpp | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/backends/plugins/ps2/ps2-provider.cpp b/backends/plugins/ps2/ps2-provider.cpp index 71e715ae50..37bdff0525 100644 --- a/backends/plugins/ps2/ps2-provider.cpp +++ b/backends/plugins/ps2/ps2-provider.cpp @@ -29,23 +29,7 @@ #include "backends/plugins/elf/mips-loader.h" class PS2DLObject : public MIPSDLObject { -public: - PS2DLObject() : - MIPSDLObject() { - } - - virtual ~PS2DLObject() { - unload(); - } - protected: - virtual void *allocSegment(size_t boundary, size_t size) const { - return memalign(boundary, size); - } - - virtual void freeSegment(void *segment) const { - free(segment); - } virtual void flushDataCache(void *, uint32) const { FlushCache(0); @@ -53,19 +37,8 @@ protected: } }; -class PS2Plugin : public ELFPlugin { -public: - PS2Plugin(const Common::String &filename) : - ELFPlugin(filename) { - } - - virtual DLObject *makeDLObject() { - return new PS2DLObject(); - } -}; - Plugin *PS2PluginProvider::createPlugin(const Common::FSNode &node) const { - return new PS2Plugin(node.getPath()); + return new TemplatedELFPlugin<PS2DLObject>(node.getPath()); } #endif // defined(DYNAMIC_MODULES) && defined(__PLAYSTATION2__) |