diff options
Diffstat (limited to 'backends')
-rw-r--r-- | backends/base-backend.cpp | 86 | ||||
-rw-r--r-- | backends/base-subsys-audio.h (renamed from backends/base-backend.h) | 15 | ||||
-rw-r--r-- | backends/base-subsys-events.h | 38 | ||||
-rw-r--r-- | backends/base-subsys-file.h | 38 | ||||
-rw-r--r-- | backends/base-subsys-graphics.h | 38 | ||||
-rw-r--r-- | backends/base-subsys-mutex.h | 38 | ||||
-rw-r--r-- | backends/base-subsys-timer.h | 38 | ||||
-rw-r--r-- | backends/module.mk | 1 |
8 files changed, 195 insertions, 97 deletions
diff --git a/backends/base-backend.cpp b/backends/base-backend.cpp deleted file mode 100644 index c06695a727..0000000000 --- a/backends/base-backend.cpp +++ /dev/null @@ -1,86 +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$ - * - */ - -#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::fillScreen(uint32 col) { - Graphics::Surface *screen = lockScreen(); - if (screen && screen->pixels) - memset(screen->pixels, col, 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) -#if defined(SAMSUNGTV) -#define DEFAULT_CONFIG_FILE "/dtv/usb/sda1/.scummvmrc" -#else -#define DEFAULT_CONFIG_FILE ".scummvmrc" -#endif -#endif - -#if !defined(UNIX) -#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-subsys-audio.h index 3fcca9c3b7..e3d3a06c01 100644 --- a/backends/base-backend.h +++ b/backends/base-subsys-audio.h @@ -23,20 +23,15 @@ * */ -#ifndef BACKENDS_BASE_BACKEND_H -#define BACKENDS_BASE_BACKEND_H +#ifndef BACKENDS_BASE_SUBSYS_AUDIO_H +#define BACKENDS_BASE_SUBSYS_AUDIO_H #include "common/system.h" -#include "backends/events/default/default-events.h" -class BaseBackend : public OSystem, Common::EventSource { +class BaseSubSys_Audio : public virtual OSystem { public: - virtual Common::EventManager *getEventManager(); - virtual void displayMessageOnOSD(const char *msg); - virtual void fillScreen(uint32 col); - - virtual Common::SeekableReadStream *createConfigReadStream(); - virtual Common::WriteStream *createConfigWriteStream(); + virtual void audioInit() = 0; + virtual void audioDone() = 0; }; diff --git a/backends/base-subsys-events.h b/backends/base-subsys-events.h new file mode 100644 index 0000000000..fc94fd054c --- /dev/null +++ b/backends/base-subsys-events.h @@ -0,0 +1,38 @@ +/* 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_SUBSYS_EVENTS_H +#define BACKENDS_BASE_SUBSYS_EVENTS_H + +#include "common/system.h" + +class BaseSubSys_Events : public virtual OSystem { +public: + virtual void eventsInit() = 0; + virtual void eventsDone() = 0; +}; + + +#endif diff --git a/backends/base-subsys-file.h b/backends/base-subsys-file.h new file mode 100644 index 0000000000..98b16c0c63 --- /dev/null +++ b/backends/base-subsys-file.h @@ -0,0 +1,38 @@ +/* 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_SUBSYS_FILE_H +#define BACKENDS_BASE_SUBSYS_FILE_H + +#include "common/system.h" + +class BaseSubSys_File : public virtual OSystem { +public: + virtual void fileInit() = 0; + virtual void fileDone() = 0; +}; + + +#endif diff --git a/backends/base-subsys-graphics.h b/backends/base-subsys-graphics.h new file mode 100644 index 0000000000..94acecfd17 --- /dev/null +++ b/backends/base-subsys-graphics.h @@ -0,0 +1,38 @@ +/* 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_SUBSYS_GRAPHICS_H +#define BACKENDS_BASE_SUBSYS_GRAPHICS_H + +#include "common/system.h" + +class BaseSubSys_Graphics : public virtual OSystem { +public: + virtual void graphicsInit() = 0; + virtual void graphicsDone() = 0; +}; + + +#endif diff --git a/backends/base-subsys-mutex.h b/backends/base-subsys-mutex.h new file mode 100644 index 0000000000..4a991ba438 --- /dev/null +++ b/backends/base-subsys-mutex.h @@ -0,0 +1,38 @@ +/* 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_SUBSYS_MUTEX_H +#define BACKENDS_BASE_SUBSYS_MUTEX_H + +#include "common/system.h" + +class BaseSubSys_Mutex : public virtual OSystem { +public: + virtual void mutexInit() = 0; + virtual void mutexDone() = 0; +}; + + +#endif diff --git a/backends/base-subsys-timer.h b/backends/base-subsys-timer.h new file mode 100644 index 0000000000..c857c49d41 --- /dev/null +++ b/backends/base-subsys-timer.h @@ -0,0 +1,38 @@ +/* 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_SUBSYS_TIMER_H +#define BACKENDS_BASE_SUBSYS_TIMER_H + +#include "common/system.h" + +class BaseSubSys_Timer : public virtual OSystem { +public: + virtual void timerInit() = 0; + virtual void timerDone() = 0; +}; + + +#endif diff --git a/backends/module.mk b/backends/module.mk index 59df56b468..b0b7deaac3 100644 --- a/backends/module.mk +++ b/backends/module.mk @@ -1,7 +1,6 @@ MODULE := backends MODULE_OBJS := \ - base-backend.o \ events/default/default-events.o \ fs/abstract-fs.o \ fs/stdiostream.o \ |