aboutsummaryrefslogtreecommitdiff
path: root/backends/platform
diff options
context:
space:
mode:
authorvanfanel2015-01-27 17:58:08 +0100
committervanfanel2015-03-29 21:52:53 +0200
commit08a3376ba7bdcd262131eafa5ae5e4e8a4ecf18d (patch)
tree4192497ebe80372c18c192222e3e88f8019eb84e /backends/platform
parent79b92fe04698d3336f1d5232d4701133ff3ac10c (diff)
downloadscummvm-rg350-08a3376ba7bdcd262131eafa5ae5e4e8a4ecf18d.tar.gz
scummvm-rg350-08a3376ba7bdcd262131eafa5ae5e4e8a4ecf18d.tar.bz2
scummvm-rg350-08a3376ba7bdcd262131eafa5ae5e4e8a4ecf18d.zip
RASPBERRYPI: Added Raspberry Pi native 2D API support (dispmanx)
Diffstat (limited to 'backends/platform')
-rw-r--r--backends/platform/sdl/module.mk6
-rw-r--r--backends/platform/sdl/posix/posix-main.cpp2
-rw-r--r--backends/platform/sdl/raspberrypi/raspberrypi-main.cpp51
-rw-r--r--backends/platform/sdl/raspberrypi/raspberrypi.cpp42
-rw-r--r--backends/platform/sdl/raspberrypi/raspberrypi.h35
5 files changed, 135 insertions, 1 deletions
diff --git a/backends/platform/sdl/module.mk b/backends/platform/sdl/module.mk
index a17a326889..d87ec6b0d3 100644
--- a/backends/platform/sdl/module.mk
+++ b/backends/platform/sdl/module.mk
@@ -34,6 +34,12 @@ MODULE_OBJS += \
ps3/ps3.o
endif
+ifdef RASPBERRYPI
+MODULE_OBJS += \
+ raspberrypi/raspberrypi-main.o \
+ raspberrypi/raspberrypi.o
+endif
+
# We don't use rules.mk but rather manually update OBJS and MODULE_DIRS.
MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS))
OBJS := $(MODULE_OBJS) $(OBJS)
diff --git a/backends/platform/sdl/posix/posix-main.cpp b/backends/platform/sdl/posix/posix-main.cpp
index d07db11b0c..0785f36df7 100644
--- a/backends/platform/sdl/posix/posix-main.cpp
+++ b/backends/platform/sdl/posix/posix-main.cpp
@@ -22,7 +22,7 @@
#include "common/scummsys.h"
-#if defined(POSIX) && !defined(MACOSX) && !defined(SAMSUNGTV) && !defined(MAEMO) && !defined(WEBOS) && !defined(LINUXMOTO) && !defined(GPH_DEVICE) && !defined(GP2X) && !defined(DINGUX) && !defined(OPENPANDORA) && !defined(PLAYSTATION3)
+#if defined(POSIX) && !defined(MACOSX) && !defined(SAMSUNGTV) && !defined(MAEMO) && !defined(WEBOS) && !defined(LINUXMOTO) && !defined(GPH_DEVICE) && !defined(GP2X) && !defined(DINGUX) && !defined(OPENPANDORA) && !defined(PLAYSTATION3) && !defined(RASPBERRYPI)
#include "backends/platform/sdl/posix/posix.h"
#include "backends/plugins/sdl/sdl-provider.h"
diff --git a/backends/platform/sdl/raspberrypi/raspberrypi-main.cpp b/backends/platform/sdl/raspberrypi/raspberrypi-main.cpp
new file mode 100644
index 0000000000..7d2eff916d
--- /dev/null
+++ b/backends/platform/sdl/raspberrypi/raspberrypi-main.cpp
@@ -0,0 +1,51 @@
+/* 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.
+ *
+ */
+
+#include "backends/platform/sdl/raspberrypi/raspberrypi.h"
+#include "backends/plugins/sdl/sdl-provider.h"
+#include "common/scummsys.h"
+#include "base/main.h"
+
+#if defined(RASPBERRYPI)
+int main(int argc, char* argv[]) {
+
+ // Create our OSystem instance
+ g_system = new OSystem_SDL_RaspberryPi();
+ assert(g_system);
+
+ // Pre initialize the backend
+ ((OSystem_SDL_RaspberryPi *)g_system)->init();
+
+#ifdef DYNAMIC_MODULES
+ PluginManager::instance().addPluginProvider(new SDLPluginProvider());
+#endif
+
+ // Invoke the actual ScummVM main entry point:
+ int res = scummvm_main(argc, argv);
+
+ // Free OSystem
+ delete (OSystem_SDL_RaspberryPi *)g_system;
+
+ return res;
+}
+
+#endif
diff --git a/backends/platform/sdl/raspberrypi/raspberrypi.cpp b/backends/platform/sdl/raspberrypi/raspberrypi.cpp
new file mode 100644
index 0000000000..2405dfaf43
--- /dev/null
+++ b/backends/platform/sdl/raspberrypi/raspberrypi.cpp
@@ -0,0 +1,42 @@
+/* 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.
+ *
+ */
+
+#if defined(RASPBERRYPI)
+
+#include "backends/platform/sdl/raspberrypi/raspberrypi.h"
+#include "backends/graphics/dispmanxsdl/dispmanxsdl-graphics.h"
+
+void OSystem_SDL_RaspberryPi::initBackend() {
+ // Create the events manager
+ if (_eventSource == 0)
+ _eventSource = new SdlEventSource();
+
+ // Create the graphics manager
+ if (_graphicsManager == 0) {
+ _graphicsManager = new DispmanXSdlGraphicsManager(_eventSource);
+ }
+
+ // Call parent implementation of this method
+ OSystem_POSIX::initBackend();
+}
+
+#endif
diff --git a/backends/platform/sdl/raspberrypi/raspberrypi.h b/backends/platform/sdl/raspberrypi/raspberrypi.h
new file mode 100644
index 0000000000..b8070e8b5a
--- /dev/null
+++ b/backends/platform/sdl/raspberrypi/raspberrypi.h
@@ -0,0 +1,35 @@
+/* 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.
+ *
+ */
+
+#ifndef SDL_RASPBERRYPI_COMMON_H
+#define SDL_RASPBERRYPI_COMMON_H
+
+#if defined(RASPBERRYPI)
+#include "backends/platform/sdl/posix/posix.h"
+
+class OSystem_SDL_RaspberryPi : public OSystem_POSIX {
+public:
+ void initBackend();
+};
+
+#endif /* RASPBERRYPI */
+#endif /* SDL_RASPBERRYPI_COMMON_H */