diff options
author | Marcus Comstedt | 2008-03-01 17:48:42 +0000 |
---|---|---|
committer | Marcus Comstedt | 2008-03-01 17:48:42 +0000 |
commit | 4d45121ccf5a2e75b1813e95e6d439b9fe0c0cd6 (patch) | |
tree | 4c96d585a7bb506ff4d90f8e6fd95c5c27038bd3 /backends/platform | |
parent | 964caae2ddc681eec5bd7353a162f584c4fef7d8 (diff) | |
download | scummvm-rg350-4d45121ccf5a2e75b1813e95e6d439b9fe0c0cd6.tar.gz scummvm-rg350-4d45121ccf5a2e75b1813e95e6d439b9fe0c0cd6.tar.bz2 scummvm-rg350-4d45121ccf5a2e75b1813e95e6d439b9fe0c0cd6.zip |
Integrated fs factory into osystem object.
svn-id: r31024
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/dc/Makefile | 2 | ||||
-rw-r--r-- | backends/platform/dc/dc-fs.cpp | 15 | ||||
-rw-r--r-- | backends/platform/dc/dc.h | 10 | ||||
-rw-r--r-- | backends/platform/dc/ronincd-fs-factory.cpp | 40 | ||||
-rw-r--r-- | backends/platform/dc/ronincd-fs-factory.h | 44 |
5 files changed, 19 insertions, 92 deletions
diff --git a/backends/platform/dc/Makefile b/backends/platform/dc/Makefile index 26088cdf17..db56035b7b 100644 --- a/backends/platform/dc/Makefile +++ b/backends/platform/dc/Makefile @@ -35,7 +35,7 @@ POST_OBJS_FLAGS = -Wl,--no-whole-archive endif 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 ronincd-fs-factory.o + label.o vmsave.o softkbd.o dcloader.o cache.o dc-fs.o MODULE_DIRS += . diff --git a/backends/platform/dc/dc-fs.cpp b/backends/platform/dc/dc-fs.cpp index 16b77857c0..3aef82af14 100644 --- a/backends/platform/dc/dc-fs.cpp +++ b/backends/platform/dc/dc-fs.cpp @@ -22,8 +22,7 @@ * $Id$ */ -#if defined(__DC__) - +#include "dc.h" #include "backends/fs/abstract-fs.h" #include <ronin/cdfs.h> @@ -190,4 +189,14 @@ AbstractFilesystemNode *RoninCDFilesystemNode::getParent() const { return new RoninCDFilesystemNode(String(start, end - start), false); } -#endif // defined(__DC__) +AbstractFilesystemNode *OSystem_Dreamcast::makeRootFileNode() const { + return new RoninCDFilesystemNode(); +} + +AbstractFilesystemNode *OSystem_Dreamcast::makeCurrentDirectoryFileNode() const { + return new RoninCDFilesystemNode(); +} + +AbstractFilesystemNode *OSystem_Dreamcast::makeFileNodePath(const Common::String &path) const { + return new RoninCDFilesystemNode(path, true); +} diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h index 8d16e59bb7..6a7d8c5f16 100644 --- a/backends/platform/dc/dc.h +++ b/backends/platform/dc/dc.h @@ -27,7 +27,7 @@ #include <graphics/surface.h> #include <ronin/soundcommon.h> #include "backends/timer/default/default-timer.h" -#include "ronincd-fs-factory.h" +#include "backends/fs/fs-factory.h" #define NUM_BUFFERS 4 #define SOUND_BUFFER_SHIFT 3 @@ -41,7 +41,7 @@ class Interactive #include "softkbd.h" -class OSystem_Dreamcast : public OSystem { +class OSystem_Dreamcast : public OSystem, public FilesystemFactory { public: OSystem_Dreamcast(); @@ -184,7 +184,10 @@ class OSystem_Dreamcast : public OSystem { void mouseToSoftKbd(int x, int y, int &rx, int &ry) const; // Filesystem - FilesystemFactory *getFilesystemFactory() { return &_fileSystemFactory; } + FilesystemFactory *getFilesystemFactory() { return this; } + AbstractFilesystemNode *makeRootFileNode() const; + AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; + AbstractFilesystemNode *makeFileNodePath(const Common::String &path) const; private: @@ -192,7 +195,6 @@ class OSystem_Dreamcast : public OSystem { Audio::Mixer *_mixer; DefaultTimerManager *_timer; SoftKeyboard _softkbd; - RoninCDFilesystemFactory _fileSystemFactory; int _ms_cur_x, _ms_cur_y, _ms_cur_w, _ms_cur_h, _ms_old_x, _ms_old_y; int _ms_hotspot_x, _ms_hotspot_y, _ms_visible, _devpoll; diff --git a/backends/platform/dc/ronincd-fs-factory.cpp b/backends/platform/dc/ronincd-fs-factory.cpp deleted file mode 100644 index 8980436cf0..0000000000 --- a/backends/platform/dc/ronincd-fs-factory.cpp +++ /dev/null @@ -1,40 +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$ - */ - -#if defined(__DC__) -#include "ronincd-fs-factory.h" -#include "dc-fs.cpp" - -AbstractFilesystemNode *RoninCDFilesystemFactory::makeRootFileNode() const { - return new RoninCDFilesystemNode(); -} - -AbstractFilesystemNode *RoninCDFilesystemFactory::makeCurrentDirectoryFileNode() const { - return new RoninCDFilesystemNode(); -} - -AbstractFilesystemNode *RoninCDFilesystemFactory::makeFileNodePath(const String &path) const { - return new RoninCDFilesystemNode(path, true); -} -#endif diff --git a/backends/platform/dc/ronincd-fs-factory.h b/backends/platform/dc/ronincd-fs-factory.h deleted file mode 100644 index 7763b2bb9f..0000000000 --- a/backends/platform/dc/ronincd-fs-factory.h +++ /dev/null @@ -1,44 +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 RONINCD_FILESYSTEM_FACTORY_H -#define RONINCD_FILESYSTEM_FACTORY_H - -#include "backends/fs/fs-factory.h" - -/** - * Creates RoninCDFilesystemNode objects. - * - * Parts of this class are documented in the base interface class, FilesystemFactory. - */ -class RoninCDFilesystemFactory : public FilesystemFactory { -public: - typedef Common::String String; - - virtual AbstractFilesystemNode *makeRootFileNode() const; - virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; - virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; -}; - -#endif /*RONINCD_FILESYSTEM_FACTORY_H*/ |