From 5661570e4efd6ac64cfdbca68515c78329d11a77 Mon Sep 17 00:00:00 2001 From: David-John Willis Date: Mon, 11 Apr 2011 16:31:29 +0100 Subject: GP2X: Commit some cleanup/fudges with a view to collapsing into the GPH backend. --- backends/events/gp2xsdl/gp2xsdl-events.cpp | 9 --------- backends/events/gp2xsdl/gp2xsdl-events.h | 3 --- backends/platform/gp2x/gp2x-common.h | 15 +++++++++++---- backends/platform/gp2x/gp2x-main.cpp | 10 +++++----- backends/platform/gp2x/gp2x.cpp | 8 ++------ 5 files changed, 18 insertions(+), 27 deletions(-) (limited to 'backends') diff --git a/backends/events/gp2xsdl/gp2xsdl-events.cpp b/backends/events/gp2xsdl/gp2xsdl-events.cpp index 91feb2b447..38b7a47346 100644 --- a/backends/events/gp2xsdl/gp2xsdl-events.cpp +++ b/backends/events/gp2xsdl/gp2xsdl-events.cpp @@ -18,9 +18,6 @@ * 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 "common/scummsys.h" @@ -28,12 +25,8 @@ #if defined(GP2X) #include "backends/events/gp2xsdl/gp2xsdl-events.h" -#if defined(GP2X) #include "backends/platform/gp2x/gp2x-hw.h" #include "backends/graphics/gp2xsdl/gp2xsdl-graphics.h" -#else -#include "backends/platform/gp2xwiz/gp2xwiz-hw.h" -#endif #include "backends/platform/sdl/sdl.h" @@ -88,7 +81,6 @@ enum { GP2XSdlEventSource::GP2XSdlEventSource() : _buttonStateL(false){ - } void GP2XSdlEventSource::SDLModToOSystemKeyFlags(SDLMod mod, Common::Event &event) { @@ -468,5 +460,4 @@ bool GP2XSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) { return false; } - #endif diff --git a/backends/events/gp2xsdl/gp2xsdl-events.h b/backends/events/gp2xsdl/gp2xsdl-events.h index 5bf472d3d8..0d74c1bcac 100644 --- a/backends/events/gp2xsdl/gp2xsdl-events.h +++ b/backends/events/gp2xsdl/gp2xsdl-events.h @@ -18,9 +18,6 @@ * 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(BACKEND_EVENTS_SDL_GP2X_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER) diff --git a/backends/platform/gp2x/gp2x-common.h b/backends/platform/gp2x/gp2x-common.h index 4d2a9c33cc..2a06cab788 100644 --- a/backends/platform/gp2x/gp2x-common.h +++ b/backends/platform/gp2x/gp2x-common.h @@ -26,7 +26,11 @@ #ifndef PLATFORM_SDL_GP2X_H #define PLATFORM_SDL_GP2X_H +#include "backends/base-backend.h" +#include "backends/platform/sdl/sdl.h" #include "backends/platform/sdl/posix/posix.h" +#include "backends/graphics/gp2xsdl/gp2xsdl-graphics.h" +#include "backends/events/gp2xsdl/gp2xsdl-events.h" #ifndef PATH_MAX #define PATH_MAX 255 @@ -34,12 +38,15 @@ class OSystem_GP2X : public OSystem_POSIX { public: - virtual void initBackend(); - virtual void quit(); - virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0); + OSystem_GP2X() {} + + void initBackend(); + void quit(); + void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0); + void initSDL(); protected: - virtual void initSDL(); + }; #endif diff --git a/backends/platform/gp2x/gp2x-main.cpp b/backends/platform/gp2x/gp2x-main.cpp index a194accd77..f1ee5ed5f3 100644 --- a/backends/platform/gp2x/gp2x-main.cpp +++ b/backends/platform/gp2x/gp2x-main.cpp @@ -18,15 +18,13 @@ * 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/platform/gp2x/gp2x-common.h" -#include "backends/plugins/posix/posix-provider.h" +#include "backends/plugins/sdl/sdl-provider.h" #include "base/main.h" +#if defined(GP2X) int main(int argc, char *argv[]) { // Create our OSystem instance @@ -37,7 +35,7 @@ int main(int argc, char *argv[]) { ((OSystem_GP2X *)g_system)->init(); #ifdef DYNAMIC_MODULES - PluginManager::instance().addPluginProvider(new POSIXPluginProvider()); + PluginManager::instance().addPluginProvider(new SDLPluginProvider()); #endif // Invoke the actual ScummVM main entry point: @@ -48,3 +46,5 @@ int main(int argc, char *argv[]) { return res; } + +#endif diff --git a/backends/platform/gp2x/gp2x.cpp b/backends/platform/gp2x/gp2x.cpp index 8ae54d679c..4cdb4cd0d5 100644 --- a/backends/platform/gp2x/gp2x.cpp +++ b/backends/platform/gp2x/gp2x.cpp @@ -18,9 +18,6 @@ * 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$ - * */ /* @@ -31,12 +28,11 @@ // Disable symbol overrides so that we can use system headers. #define FORBIDDEN_SYMBOL_ALLOW_ALL +#include "backends/platform/sdl/sdl-sys.h" #include "backends/platform/gp2x/gp2x-common.h" #include "backends/platform/gp2x/gp2x-hw.h" #include "backends/platform/gp2x/gp2x-mem.h" -#include "backends/graphics/gp2xsdl/gp2xsdl-graphics.h" -#include "backends/events/gp2xsdl/gp2xsdl-events.h" #include "backends/saves/default/default-saves.h" #include "common/config-manager.h" @@ -143,7 +139,7 @@ void OSystem_GP2X::initBackend() { if (_graphicsManager == 0) _graphicsManager = new GP2XSdlGraphicsManager(_eventSource); - // Call parent implementation of this method + /* Pass to POSIX method to do the heavy lifting */ OSystem_POSIX::initBackend(); } -- cgit v1.2.3