aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2009-01-30 03:35:47 +0000
committerMax Horn2009-01-30 03:35:47 +0000
commitc69ebfd798777fa5db487fe321af274d26baaf3b (patch)
tree799a2a0234e594abc7bc96c5ba1a646571bb06b6
parent1d097d9791b99b78790d68133a4ecf07057a28e6 (diff)
downloadscummvm-rg350-c69ebfd798777fa5db487fe321af274d26baaf3b.tar.gz
scummvm-rg350-c69ebfd798777fa5db487fe321af274d26baaf3b.tar.bz2
scummvm-rg350-c69ebfd798777fa5db487fe321af274d26baaf3b.zip
Moved default implementations for various OSystem methods into a new class BaseBackend
svn-id: r36135
-rw-r--r--Makefile.common2
-rw-r--r--backends/base-backend.cpp80
-rw-r--r--backends/base-backend.h43
-rw-r--r--backends/events/default/default-events.cpp42
-rw-r--r--backends/events/default/default-events.h20
-rw-r--r--backends/module.mk1
-rw-r--r--backends/platform/PalmOS/Src/be_base.h5
-rw-r--r--backends/platform/dc/dc.h4
-rw-r--r--backends/platform/ds/arm9/source/osystem_ds.h5
-rw-r--r--backends/platform/gp2x/gp2x-common.h5
-rw-r--r--backends/platform/iphone/osys_iphone.h4
-rw-r--r--backends/platform/null/null.cpp4
-rw-r--r--backends/platform/ps2/systemps2.h4
-rw-r--r--backends/platform/psp/osys_psp.h4
-rw-r--r--backends/platform/sdl/graphics.cpp1
-rw-r--r--backends/platform/sdl/sdl.h5
-rw-r--r--backends/platform/wii/osystem.h4
-rw-r--r--common/mutex.h3
-rw-r--r--common/system.cpp63
-rw-r--r--common/system.h30
20 files changed, 188 insertions, 141 deletions
diff --git a/Makefile.common b/Makefile.common
index 02005afb89..33e556f1fc 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -25,8 +25,8 @@ MODULES += \
gui \
graphics \
sound \
- common \
engines \
+ common \
backends
ifdef USE_MT32EMU
diff --git a/backends/base-backend.cpp b/backends/base-backend.cpp
new file mode 100644
index 0000000000..4c4b78b6cb
--- /dev/null
+++ b/backends/base-backend.cpp
@@ -0,0 +1,80 @@
+/* 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$
+ *
+ */
+
+#include "backends/base-backend.h"
+#include "backends/events/default/default-events.h"
+#include "gui/message.h"
+
+void BaseBackend::displayMessageOnOSD(const char *msg) {
+ // Display the message for 1.5 seconds
+ GUI::TimedMessageDialog dialog(msg, 1500);
+ dialog.runModal();
+}
+
+
+static Common::EventManager *s_eventManager = 0;
+
+Common::EventManager *BaseBackend::getEventManager() {
+ // FIXME/TODO: Eventually this method should be turned into an abstract one,
+ // to force backends to implement this conciously (even if they
+ // end up returning the default event manager anyway).
+ if (!s_eventManager)
+ s_eventManager = new DefaultEventManager(this);
+ return s_eventManager;
+}
+
+void BaseBackend::clearScreen() {
+ Graphics::Surface *screen = lockScreen();
+ if (screen && screen->pixels)
+ memset(screen->pixels, 0, screen->h * screen->pitch);
+ unlockScreen();
+}
+
+
+/*
+ FIXME: Maybe we should push the default config file loading/saving code below
+ out to all the backends?
+*/
+
+
+#if defined(UNIX)
+#define DEFAULT_CONFIG_FILE ".scummvmrc"
+#else
+#define DEFAULT_CONFIG_FILE "scummvm.ini"
+#endif
+
+Common::SeekableReadStream *BaseBackend::createConfigReadStream() {
+ Common::FSNode file(DEFAULT_CONFIG_FILE);
+ return file.createReadStream();
+}
+
+Common::WriteStream *BaseBackend::createConfigWriteStream() {
+#ifdef __DC__
+ return 0;
+#else
+ Common::FSNode file(DEFAULT_CONFIG_FILE);
+ return file.createWriteStream();
+#endif
+}
diff --git a/backends/base-backend.h b/backends/base-backend.h
new file mode 100644
index 0000000000..6cf04e8c6e
--- /dev/null
+++ b/backends/base-backend.h
@@ -0,0 +1,43 @@
+/* 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_BASE_BACKEND_H
+#define BACKENDS_BASE_BACKEND_H
+
+#include "common/system.h"
+#include "backends/events/default/default-events.h"
+
+class BaseBackend : public OSystem, EventProvider {
+public:
+ virtual Common::EventManager *getEventManager();
+ virtual void displayMessageOnOSD(const char *msg);
+ virtual void clearScreen();
+
+ virtual Common::SeekableReadStream *createConfigReadStream();
+ virtual Common::WriteStream *createConfigWriteStream();
+};
+
+
+#endif
diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp
index feed4b0c62..fffaa3cfff 100644
--- a/backends/events/default/default-events.cpp
+++ b/backends/events/default/default-events.cpp
@@ -92,7 +92,7 @@ void writeRecord(Common::OutSaveFile *outFile, uint32 diff, Common::Event &event
}
}
-DefaultEventManager::DefaultEventManager(OSystem *boss) :
+DefaultEventManager::DefaultEventManager(EventProvider *boss) :
_boss(boss),
_buttonState(0),
_modifierState(0),
@@ -106,8 +106,8 @@ DefaultEventManager::DefaultEventManager(OSystem *boss) :
_recordTimeFile = NULL;
_playbackFile = NULL;
_playbackTimeFile = NULL;
- _timeMutex = _boss->createMutex();
- _recorderMutex = _boss->createMutex();
+ _timeMutex = g_system->createMutex();
+ _recorderMutex = g_system->createMutex();
_eventCount = 0;
_lastEventCount = 0;
@@ -144,8 +144,8 @@ DefaultEventManager::DefaultEventManager(OSystem *boss) :
if (_recordMode == kRecorderRecord) {
_recordCount = 0;
_recordTimeCount = 0;
- _recordFile = _boss->getSavefileManager()->openForSaving(_recordTempFileName.c_str());
- _recordTimeFile = _boss->getSavefileManager()->openForSaving(_recordTimeFileName.c_str());
+ _recordFile = g_system->getSavefileManager()->openForSaving(_recordTempFileName.c_str());
+ _recordTimeFile = g_system->getSavefileManager()->openForSaving(_recordTimeFileName.c_str());
_recordSubtitles = ConfMan.getBool("subtitles");
}
@@ -155,8 +155,8 @@ DefaultEventManager::DefaultEventManager(OSystem *boss) :
if (_recordMode == kRecorderPlayback) {
_playbackCount = 0;
_playbackTimeCount = 0;
- _playbackFile = _boss->getSavefileManager()->openForLoading(_recordFileName.c_str());
- _playbackTimeFile = _boss->getSavefileManager()->openForLoading(_recordTimeFileName.c_str());
+ _playbackFile = g_system->getSavefileManager()->openForLoading(_recordFileName.c_str());
+ _playbackTimeFile = g_system->getSavefileManager()->openForLoading(_recordTimeFileName.c_str());
if (!_playbackFile) {
warning("Cannot open playback file %s. Playback was switched off", _recordFileName.c_str());
@@ -213,11 +213,11 @@ DefaultEventManager::~DefaultEventManager() {
#ifdef ENABLE_VKEYBD
delete _vk;
#endif
- _boss->lockMutex(_timeMutex);
- _boss->lockMutex(_recorderMutex);
+ g_system->lockMutex(_timeMutex);
+ g_system->lockMutex(_recorderMutex);
_recordMode = kPassthrough;
- _boss->unlockMutex(_timeMutex);
- _boss->unlockMutex(_recorderMutex);
+ g_system->unlockMutex(_timeMutex);
+ g_system->unlockMutex(_recorderMutex);
if (!artificialEventQueue.empty())
artificialEventQueue.clear();
@@ -235,9 +235,9 @@ DefaultEventManager::~DefaultEventManager() {
_recordTimeFile->finalize();
delete _recordTimeFile;
- _playbackFile = _boss->getSavefileManager()->openForLoading(_recordTempFileName.c_str());
+ _playbackFile = g_system->getSavefileManager()->openForLoading(_recordTempFileName.c_str());
- _recordFile = _boss->getSavefileManager()->openForSaving(_recordFileName.c_str());
+ _recordFile = g_system->getSavefileManager()->openForSaving(_recordFileName.c_str());
_recordFile->writeUint32LE(RECORD_SIGNATURE);
_recordFile->writeUint32LE(RECORD_VERSION);
@@ -267,8 +267,8 @@ DefaultEventManager::~DefaultEventManager() {
//TODO: remove recordTempFileName'ed file
}
- _boss->deleteMutex(_timeMutex);
- _boss->deleteMutex(_recorderMutex);
+ g_system->deleteMutex(_timeMutex);
+ g_system->deleteMutex(_recorderMutex);
}
void DefaultEventManager::init() {
@@ -301,7 +301,7 @@ bool DefaultEventManager::playback(Common::Event &event) {
case Common::EVENT_RBUTTONUP:
case Common::EVENT_WHEELUP:
case Common::EVENT_WHEELDOWN:
- _boss->warpMouse(_playbackEvent.mouse.x, _playbackEvent.mouse.y);
+ g_system->warpMouse(_playbackEvent.mouse.x, _playbackEvent.mouse.y);
break;
default:
break;
@@ -349,7 +349,7 @@ void DefaultEventManager::processMillis(uint32 &millis) {
return;
}
- _boss->lockMutex(_timeMutex);
+ g_system->lockMutex(_timeMutex);
if (_recordMode == kRecorderRecord) {
//Simple RLE compression
d = millis - _lastMillis;
@@ -374,11 +374,11 @@ void DefaultEventManager::processMillis(uint32 &millis) {
}
_lastMillis = millis;
- _boss->unlockMutex(_timeMutex);
+ g_system->unlockMutex(_timeMutex);
}
bool DefaultEventManager::pollEvent(Common::Event &event) {
- uint32 time = _boss->getMillis();
+ uint32 time = g_system->getMillis();
bool result;
if (!artificialEventQueue.empty()) {
@@ -405,7 +405,7 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
if (_recordMode != kPassthrough) {
- _boss->lockMutex(_recorderMutex);
+ g_system->lockMutex(_recorderMutex);
_eventCount++;
if (_recordMode == kRecorderPlayback) {
@@ -419,7 +419,7 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
}
}
}
- _boss->unlockMutex(_recorderMutex);
+ g_system->unlockMutex(_recorderMutex);
}
if (result) {
diff --git a/backends/events/default/default-events.h b/backends/events/default/default-events.h
index 1aeab4d68b..58b5745b7d 100644
--- a/backends/events/default/default-events.h
+++ b/backends/events/default/default-events.h
@@ -31,8 +31,6 @@
#include "common/mutex.h"
#include "common/queue.h"
-class OSystem;
-
namespace Common {
#ifdef ENABLE_KEYMAPPER
class Keymapper;
@@ -43,20 +41,20 @@ namespace Common {
}
-/*
-At some point we will remove pollEvent from OSystem and change
-DefaultEventManager to use a "boss" derived from this class:
class EventProvider {
-public
+public:
+ virtual ~EventProvider() {}
+ /**
+ * Get the next event in the event queue.
+ * @param event point to an Common::Event struct, which will be filled with the event data.
+ * @return true if an event was retrieved.
+ */
virtual bool pollEvent(Common::Event &event) = 0;
};
-Backends which wish to use the DefaultEventManager then simply can
-use a subclass of EventProvider.
-*/
class DefaultEventManager : public Common::EventManager {
- OSystem *_boss;
+ EventProvider *_boss;
#ifdef ENABLE_VKEYBD
Common::VirtualKeyboard *_vk;
@@ -130,7 +128,7 @@ class DefaultEventManager : public Common::EventManager {
void record(Common::Event &event);
bool playback(Common::Event &event);
public:
- DefaultEventManager(OSystem *boss);
+ DefaultEventManager(EventProvider *boss);
~DefaultEventManager();
virtual void init();
diff --git a/backends/module.mk b/backends/module.mk
index e14a949318..f3294c5dc6 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -1,6 +1,7 @@
MODULE := backends
MODULE_OBJS := \
+ base-backend.o \
events/default/default-events.o \
fs/abstract-fs.o \
fs/stdiostream.o \
diff --git a/backends/platform/PalmOS/Src/be_base.h b/backends/platform/PalmOS/Src/be_base.h
index 36f8a1d080..333b633f05 100644
--- a/backends/platform/PalmOS/Src/be_base.h
+++ b/backends/platform/PalmOS/Src/be_base.h
@@ -31,8 +31,7 @@
#include "PalmVersion.h"
#include "globals.h"
-#include "common/scummsys.h"
-#include "common/system.h"
+#include "backends/base-backend.h"
#include "common/events.h"
#include "graphics/surface.h"
@@ -89,7 +88,7 @@ typedef struct {
void *param;
} SoundType, *SoundPtr;
-class OSystem_PalmBase : public OSystem {
+class OSystem_PalmBase : public BaseBackend {
private:
virtual void int_initBackend() { }
diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h
index f2675c0f89..eabc013cdd 100644
--- a/backends/platform/dc/dc.h
+++ b/backends/platform/dc/dc.h
@@ -23,7 +23,7 @@
*
*/
-#include <common/system.h>
+#include "backends/base-backend.h"
#include <graphics/surface.h>
#include <graphics/colormasks.h>
#include <ronin/soundcommon.h>
@@ -43,7 +43,7 @@ class Interactive
#include "softkbd.h"
-class OSystem_Dreamcast : public OSystem, public FilesystemFactory {
+class OSystem_Dreamcast : public BaseBackend, public FilesystemFactory {
public:
OSystem_Dreamcast();
diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h
index 575bad0609..b5802803d0 100644
--- a/backends/platform/ds/arm9/source/osystem_ds.h
+++ b/backends/platform/ds/arm9/source/osystem_ds.h
@@ -23,7 +23,8 @@
#ifndef _OSYSTEM_DS_H_
#define _OSYSTEM_DS_H_
-#include "common/system.h"
+
+#include "backends/base-backend.h"
#include "common/events.h"
#include "nds.h"
#include "ramsave.h"
@@ -34,7 +35,7 @@
#include "graphics/surface.h"
#include "graphics/colormasks.h"
-class OSystem_DS : public OSystem {
+class OSystem_DS : public BaseBackend {
protected:
int eventNum;
diff --git a/backends/platform/gp2x/gp2x-common.h b/backends/platform/gp2x/gp2x-common.h
index de305923a0..14c62edf87 100644
--- a/backends/platform/gp2x/gp2x-common.h
+++ b/backends/platform/gp2x/gp2x-common.h
@@ -29,8 +29,7 @@
#define __GP2X__
#define USE_OSD
-#include "common/scummsys.h"
-#include "common/system.h"
+#include "backends/base-backend.h"
#include "graphics/scaler.h"
#include <SDL.h>
@@ -58,7 +57,7 @@ enum {
};
-class OSystem_GP2X : public OSystem {
+class OSystem_GP2X : public BaseBackend {
public:
OSystem_GP2X();
virtual ~OSystem_GP2X();
diff --git a/backends/platform/iphone/osys_iphone.h b/backends/platform/iphone/osys_iphone.h
index 746a6e848f..b3404c15c2 100644
--- a/backends/platform/iphone/osys_iphone.h
+++ b/backends/platform/iphone/osys_iphone.h
@@ -27,7 +27,7 @@
#include "graphics/surface.h"
#include "iphone_common.h"
-#include "common/system.h"
+#include "backends/base-backend.h"
#include "common/events.h"
#include "sound/mixer_intern.h"
#include "backends/fs/posix/posix-fs-factory.h"
@@ -52,7 +52,7 @@ typedef struct AQCallbackStruct {
AudioStreamBasicDescription dataFormat;
} AQCallbackStruct;
-class OSystem_IPHONE : public OSystem {
+class OSystem_IPHONE : public BaseBackend {
protected:
static const OSystem::GraphicsMode s_supportedGraphicsModes[];
diff --git a/backends/platform/null/null.cpp b/backends/platform/null/null.cpp
index 0da8dd7712..304b7e80eb 100644
--- a/backends/platform/null/null.cpp
+++ b/backends/platform/null/null.cpp
@@ -23,7 +23,7 @@
*
*/
-#include "common/system.h"
+#include "backends/base-backend.h"
#include "base/main.h"
#if defined(USE_NULL_DRIVER)
@@ -51,7 +51,7 @@
#include "backends/fs/windows/windows-fs-factory.h"
#endif
-class OSystem_NULL : public OSystem {
+class OSystem_NULL : public BaseBackend {
protected:
Common::SaveFileManager *_savefile;
Audio::MixerImpl *_mixer;
diff --git a/backends/platform/ps2/systemps2.h b/backends/platform/ps2/systemps2.h
index fecd7244f8..c0a8b9af60 100644
--- a/backends/platform/ps2/systemps2.h
+++ b/backends/platform/ps2/systemps2.h
@@ -26,7 +26,7 @@
#ifndef SYSTEMPS2_H
#define SYSTEMPS2_H
-#include "common/system.h"
+#include "backends/base-backend.h"
class DefaultTimerManager;
@@ -52,7 +52,7 @@ namespace Audio {
class MixerImpl;
};
-class OSystem_PS2 : public OSystem {
+class OSystem_PS2 : public BaseBackend {
public:
OSystem_PS2(const char *elfPath);
virtual ~OSystem_PS2(void);
diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h
index 5fee067eec..50a5572142 100644
--- a/backends/platform/psp/osys_psp.h
+++ b/backends/platform/psp/osys_psp.h
@@ -24,10 +24,10 @@
*/
#include "common/scummsys.h"
-#include "common/system.h"
#include "graphics/surface.h"
#include "graphics/colormasks.h"
#include "sound/mixer_intern.h"
+#include "backends/base-backend.h"
#include "backends/fs/psp/psp-fs-factory.h"
@@ -40,7 +40,7 @@ enum GraphicModeID {
CENTERED_362X272
};
-class OSystem_PSP : public OSystem {
+class OSystem_PSP : public BaseBackend {
public:
static const OSystem::GraphicsMode s_supportedGraphicsModes[];
static OSystem *instance();
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 2a4e166ab2..d498c8f62a 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -24,6 +24,7 @@
*/
#include "backends/platform/sdl/sdl.h"
+#include "common/mutex.h"
#include "common/util.h"
#include "graphics/font.h"
#include "graphics/fontman.h"
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 80a08de821..d657a964ba 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -32,8 +32,7 @@
#include <SDL.h>
#endif
-#include "common/scummsys.h"
-#include "common/system.h"
+#include "backends/base-backend.h"
#include "graphics/scaler.h"
@@ -72,7 +71,7 @@ enum {
};
-class OSystem_SDL : public OSystem {
+class OSystem_SDL : public BaseBackend {
public:
OSystem_SDL();
virtual ~OSystem_SDL();
diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h
index afc80e1bcd..1d97d5259a 100644
--- a/backends/platform/wii/osystem.h
+++ b/backends/platform/wii/osystem.h
@@ -23,11 +23,11 @@
#define _WII_OSYSTEM_H_
#include "base/main.h"
-#include "common/system.h"
#include "common/fs.h"
#include "common/rect.h"
#include "common/events.h"
+#include "backends/base-backend.h"
#include "backends/saves/default/default-saves.h"
#include "backends/timer/default/default-timer.h"
#include "graphics/colormasks.h"
@@ -53,7 +53,7 @@ extern void wii_memstats(void);
}
#endif
-class OSystem_Wii : public OSystem {
+class OSystem_Wii : public BaseBackend {
private:
s64 _startup_time;
syswd_t _alarm;
diff --git a/common/mutex.h b/common/mutex.h
index 236d75d958..ba5c45c30e 100644
--- a/common/mutex.h
+++ b/common/mutex.h
@@ -27,6 +27,7 @@
#define COMMON_MUTEX_H
#include "common/scummsys.h"
+#include "common/system.h"
namespace Common {
@@ -35,7 +36,7 @@ class Mutex;
/**
* An pseudo-opaque mutex type. See OSystem::createMutex etc. for more details.
*/
-typedef struct OpaqueMutex *MutexRef;
+typedef OSystem::MutexRef MutexRef;
/**
diff --git a/common/system.cpp b/common/system.cpp
index d8dd177a02..387e0dfa0f 100644
--- a/common/system.cpp
+++ b/common/system.cpp
@@ -23,9 +23,7 @@
*
*/
-#include "backends/events/default/default-events.h"
#include "common/system.h"
-#include "gui/message.h"
OSystem *g_system = 0;
@@ -56,13 +54,6 @@ bool OSystem::setGraphicsMode(const char *name) {
return false;
}
-void OSystem::displayMessageOnOSD(const char *msg) {
- // Display the message for 1.5 seconds
- GUI::TimedMessageDialog dialog(msg, 1500);
- dialog.runModal();
-}
-
-
bool OSystem::openCD(int drive) {
return false;
}
@@ -70,57 +61,3 @@ bool OSystem::openCD(int drive) {
bool OSystem::pollCD() {
return false;
}
-
-void OSystem::playCD(int track, int num_loops, int start_frame, int duration) {
-}
-
-void OSystem::stopCD() {
-}
-
-void OSystem::updateCD() {
-}
-
-static Common::EventManager *s_eventManager = 0;
-
-Common::EventManager *OSystem::getEventManager() {
- // FIXME/TODO: Eventually this method should be turned into an abstract one,
- // to force backends to implement this conciously (even if they
- // end up returning the default event manager anyway).
- if (!s_eventManager)
- s_eventManager = new DefaultEventManager(this);
- return s_eventManager;
-}
-
-void OSystem::clearScreen() {
- Graphics::Surface *screen = lockScreen();
- if (screen && screen->pixels)
- memset(screen->pixels, 0, screen->h * screen->pitch);
- unlockScreen();
-}
-
-
-/*
- FIXME: Maybe we should push the default config file loading/saving code below
- out to all the backends?
-*/
-
-
-#if defined(UNIX)
-#define DEFAULT_CONFIG_FILE ".scummvmrc"
-#else
-#define DEFAULT_CONFIG_FILE "scummvm.ini"
-#endif
-
-Common::SeekableReadStream *OSystem::createConfigReadStream() {
- Common::FSNode file(DEFAULT_CONFIG_FILE);
- return file.createReadStream();
-}
-
-Common::WriteStream *OSystem::createConfigWriteStream() {
-#ifdef __DC__
- return 0;
-#else
- Common::FSNode file(DEFAULT_CONFIG_FILE);
- return file.createWriteStream();
-#endif
-}
diff --git a/common/system.h b/common/system.h
index 447feeebe5..505ddb5dc4 100644
--- a/common/system.h
+++ b/common/system.h
@@ -27,7 +27,6 @@
#define COMMON_SYSTEM_H
#include "common/scummsys.h"
-#include "common/mutex.h"
#include "common/noncopyable.h"
#include "common/rect.h"
@@ -515,7 +514,7 @@ public:
/**
* Clear the screen to black.
*/
- virtual void clearScreen();
+ virtual void clearScreen() = 0;
/**
* Flush the whole screen, that is render the current content of the screen
@@ -697,17 +696,6 @@ public:
/** @name Events and Time */
//@{
-protected:
- friend class DefaultEventManager;
-
- /**
- * Get the next event in the event queue.
- * @param event point to an Common::Event struct, which will be filled with the event data.
- * @return true if an event was retrieved.
- */
- virtual bool pollEvent(Common::Event &event) = 0;
-
-public:
/** Get the number of milliseconds since the program was started. */
virtual uint32 getMillis() = 0;
@@ -731,7 +719,7 @@ public:
* Return the event manager singleton. For more information, refer
* to the EventManager documentation.
*/
- virtual Common::EventManager *getEventManager();
+ virtual Common::EventManager *getEventManager() = 0;
//@}
@@ -754,7 +742,7 @@ public:
*/
//@{
- typedef Common::MutexRef MutexRef;
+ typedef struct OpaqueMutex *MutexRef;
/**
* Create a new mutex.
@@ -831,17 +819,17 @@ public:
* @param start_frame the frame at which playback should start (75 frames = 1 second).
* @param duration the number of frames to play.
*/
- virtual void playCD(int track, int num_loops, int start_frame, int duration);
+ virtual void playCD(int track, int num_loops, int start_frame, int duration) {}
/**
* Stop audio CD playback.
*/
- virtual void stopCD();
+ virtual void stopCD() {}
/**
* Update cdrom audio status.
*/
- virtual void updateCD();
+ virtual void updateCD() {}
//@}
@@ -875,7 +863,7 @@ public:
*
* @param msg the message to display on screen
*/
- virtual void displayMessageOnOSD(const char *msg);
+ virtual void displayMessageOnOSD(const char *msg) = 0;
/**
* Return the SaveFileManager, used to store and load savestates
@@ -908,7 +896,7 @@ public:
* ReadStream instance. It is the callers responsiblity to delete
* the stream after use.
*/
- virtual Common::SeekableReadStream *createConfigReadStream();
+ virtual Common::SeekableReadStream *createConfigReadStream() = 0;
/**
* Open the default config file for writing, by returning a suitable
@@ -917,7 +905,7 @@ public:
*
* May return 0 to indicate that writing to config file is not possible.
*/
- virtual Common::WriteStream *createConfigWriteStream();
+ virtual Common::WriteStream *createConfigWriteStream() = 0;
//@}
};