diff options
author | lubomyr | 2016-05-19 19:54:18 +0200 |
---|---|---|
committer | lubomyr | 2016-05-19 20:33:27 +0200 |
commit | 961976f17ed09580bda7ec7531230378b4bf184e (patch) | |
tree | 73c66bc6ceabc496d3cef5de1e36cd4ec7811f15 /backends/platform | |
parent | d35cdf5009698b74a2d444dea508755a9f5e3cbc (diff) | |
download | scummvm-rg350-961976f17ed09580bda7ec7531230378b4bf184e.tar.gz scummvm-rg350-961976f17ed09580bda7ec7531230378b4bf184e.tar.bz2 scummvm-rg350-961976f17ed09580bda7ec7531230378b4bf184e.zip |
ANDROIDSDL: add androidsdl backend
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/androidsdl/androidsdl-main.cpp | 42 | ||||
-rw-r--r-- | backends/platform/androidsdl/androidsdl-sdl.cpp | 37 | ||||
-rw-r--r-- | backends/platform/androidsdl/androidsdl-sdl.h | 38 | ||||
-rw-r--r-- | backends/platform/androidsdl/androidsdl.mk | 11 | ||||
-rw-r--r-- | backends/platform/androidsdl/module.mk | 13 | ||||
-rw-r--r-- | backends/platform/sdl/posix/posix-main.cpp | 2 |
6 files changed, 142 insertions, 1 deletions
diff --git a/backends/platform/androidsdl/androidsdl-main.cpp b/backends/platform/androidsdl/androidsdl-main.cpp new file mode 100644 index 0000000000..26a73579c0 --- /dev/null +++ b/backends/platform/androidsdl/androidsdl-main.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. + * + */ + +#include "backends/platform/androidsdl/androidsdl-sdl.h" +#include "base/main.h" + +int main(int argc, char *argv[]) { + + // Create our OSystem instance + g_system = new OSystem_ANDROIDSDL(); + assert(g_system); + + // Pre initialize the backend + ((OSystem_POSIX *)g_system)->init(); + + // Invoke the actual ScummVM main entry point: + int res = scummvm_main(argc, argv); + + // Free OSystem + delete (OSystem_ANDROIDSDL *)g_system; + + return res; +} diff --git a/backends/platform/androidsdl/androidsdl-sdl.cpp b/backends/platform/androidsdl/androidsdl-sdl.cpp new file mode 100644 index 0000000000..5e0eaa0408 --- /dev/null +++ b/backends/platform/androidsdl/androidsdl-sdl.cpp @@ -0,0 +1,37 @@ +/* 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/androidsdl/androidsdl-sdl.h" +#include "backends/events/androidsdl/androidsdl-events.h" +#include "backends/graphics/androidsdl/androidsdl-graphics.h" + +void OSystem_ANDROIDSDL::initBackend() { + // Create the backend custom managers + if (_eventSource == 0) + _eventSource = new AndroidSdlEventSource(); + + if (_graphicsManager == 0) + _graphicsManager = new AndroidSdlGraphicsManager(_eventSource, _window); + + // Call parent implementation of this method + OSystem_POSIX::initBackend(); +} diff --git a/backends/platform/androidsdl/androidsdl-sdl.h b/backends/platform/androidsdl/androidsdl-sdl.h new file mode 100644 index 0000000000..6ebe5022eb --- /dev/null +++ b/backends/platform/androidsdl/androidsdl-sdl.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. + * + */ + +#ifndef PLATFORM_SDL_ANDROIDSDL_H +#define PLATFORM_SDL_ANDROIDSDL_H + +#include "backends/platform/sdl/posix/posix.h" + +class OSystem_ANDROIDSDL : public OSystem_POSIX { +public: + virtual void initBackend(); + +#ifdef ENABLE_KEYMAPPER + // FIXME: This just calls parent methods, is it needed? + virtual Common::HardwareInputSet *getHardwareInputSet(); +#endif +}; + +#endif diff --git a/backends/platform/androidsdl/androidsdl.mk b/backends/platform/androidsdl/androidsdl.mk new file mode 100644 index 0000000000..1defb81b97 --- /dev/null +++ b/backends/platform/androidsdl/androidsdl.mk @@ -0,0 +1,11 @@ +# Special target to create an AndroidSDL snapshot +androidsdl: + $(MKDIR) release + $(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) release + $(INSTALL) -c -m 644 $(DIST_FILES_DOCS) release + $(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip release + zip -j scummvm190-git-appdata.zip release/* + split -d -b 1000000 scummvm190-git-appdata.zip scummvm190-git-appdata.zip0 + $(RM) -r scummvm190-git-appdata.zip + +.PHONY: androidsdl diff --git a/backends/platform/androidsdl/module.mk b/backends/platform/androidsdl/module.mk new file mode 100644 index 0000000000..df927163b8 --- /dev/null +++ b/backends/platform/androidsdl/module.mk @@ -0,0 +1,13 @@ +MODULE := backends/platform/androidsdl + +MODULE_OBJS := \ + androidsdl-main.o \ + androidsdl-sdl.o + +# We don't use rules.mk but rather manually update OBJS and MODULE_DIRS. +MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) +OBJS := $(MODULE_OBJS) $(OBJS) +MODULE_DIRS += $(sort $(dir $(MODULE_OBJS))) + +# Hack to ensure the SDL backend is built so we can use OSystem_SDL. +-include $(srcdir)/backends/platform/sdl/module.mk diff --git a/backends/platform/sdl/posix/posix-main.cpp b/backends/platform/sdl/posix/posix-main.cpp index d07db11b0c..5deebb0ae3 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(ANDROIDSDL) #include "backends/platform/sdl/posix/posix.h" #include "backends/plugins/sdl/sdl-provider.h" |