From 944e0be209f5ab47c3b903f258d2d41b990d80cb Mon Sep 17 00:00:00 2001 From: Pawel Kolodziejski Date: Mon, 23 May 2011 18:11:40 +0200 Subject: SAMSUNGTV: update port --- backends/platform/samsungtv/main.cpp | 4 ++-- backends/platform/samsungtv/samsungtv.cpp | 36 +++++++++++-------------------- backends/platform/samsungtv/samsungtv.h | 10 +++++---- backends/platform/sdl/main.cpp | 1 + backends/platform/sdl/posix/posix.cpp | 3 +++ 5 files changed, 25 insertions(+), 29 deletions(-) (limited to 'backends/platform') diff --git a/backends/platform/samsungtv/main.cpp b/backends/platform/samsungtv/main.cpp index a3253c12f1..4f3291613d 100644 --- a/backends/platform/samsungtv/main.cpp +++ b/backends/platform/samsungtv/main.cpp @@ -38,7 +38,7 @@ extern "C" int Game_Main(char *path, char *) { assert(g_system); // Pre initialize the backend - ((OSystem_SDL_SamsungTV *)g_system)->init(); + ((OSystem_POSIX *)g_system)->init(); #ifdef DYNAMIC_MODULES PluginManager::instance().addPluginProvider(new SDLPluginProvider()); @@ -48,7 +48,7 @@ extern "C" int Game_Main(char *path, char *) { int res = scummvm_main(0, 0); // Free OSystem - delete g_system; + delete (OSystem_SDL_SamsungTV *)g_system; return res; } diff --git a/backends/platform/samsungtv/samsungtv.cpp b/backends/platform/samsungtv/samsungtv.cpp index 2cc520e6fa..cb657a0a22 100644 --- a/backends/platform/samsungtv/samsungtv.cpp +++ b/backends/platform/samsungtv/samsungtv.cpp @@ -22,18 +22,13 @@ #include "backends/platform/samsungtv/samsungtv.h" #include "backends/events/samsungtvsdl/samsungtvsdl-events.h" +#include "backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h" #if defined(SAMSUNGTV) OSystem_SDL_SamsungTV::OSystem_SDL_SamsungTV() : - OSystem_POSIX("/dtv/usb/sda1/.scummvmrc") { -} - -bool OSystem_SDL_SamsungTV::hasFeature(Feature f) { - return - (f == OSystem::kFeatureAspectRatioCorrection) || - (f == OSystem::kFeatureCursorHasPalette); + OSystem_POSIX("/mtd_rwarea/scummvm/.scummvmrc") { } void OSystem_SDL_SamsungTV::initBackend() { @@ -41,27 +36,22 @@ void OSystem_SDL_SamsungTV::initBackend() { if (_eventSource == 0) _eventSource = new SamsungTVSdlEventSource(); + if (_graphicsManager == 0) + _graphicsManager = new SamsungTVSdlGraphicsManager(_eventSource); + // Call parent implementation of this method - OSystem_SDL::initBackend(); + OSystem_POSIX::initBackend(); } -void OSystem_SDL_SamsungTV::setFeatureState(Feature f, bool enable) { - switch (f) { - case OSystem::kFeatureAspectRatioCorrection: - _graphicsManager->setFeatureState(f, enable); - break; - default: - break; - } +void OSystem_SDL_SamsungTV::quit() { + delete this; } -bool OSystem_SDL_SamsungTV::getFeatureState(Feature f) { - switch (f) { - case OSystem::kFeatureAspectRatioCorrection: - return _graphicsManager->getFeatureState(f); - default: - return false; - } +void OSystem_SDL_SamsungTV::fatalError() { + delete this; + // FIXME + warning("fatal error"); + for (;;) {} } #endif diff --git a/backends/platform/samsungtv/samsungtv.h b/backends/platform/samsungtv/samsungtv.h index 22a96495b7..b7a78a96cd 100644 --- a/backends/platform/samsungtv/samsungtv.h +++ b/backends/platform/samsungtv/samsungtv.h @@ -23,6 +23,8 @@ #ifndef PLATFORM_SDL_SAMSUNGTV_H #define PLATFORM_SDL_SAMSUNGTV_H +#if defined(SAMSUNGTV) + #include "backends/platform/sdl/posix/posix.h" class OSystem_SDL_SamsungTV : public OSystem_POSIX { @@ -30,10 +32,10 @@ public: OSystem_SDL_SamsungTV(); virtual void initBackend(); - - virtual bool hasFeature(Feature f); - virtual void setFeatureState(Feature f, bool enable); - virtual bool getFeatureState(Feature f); + virtual void quit(); + virtual void fatalError(); }; #endif + +#endif diff --git a/backends/platform/sdl/main.cpp b/backends/platform/sdl/main.cpp index e8bb9210c3..a0a64e1155 100644 --- a/backends/platform/sdl/main.cpp +++ b/backends/platform/sdl/main.cpp @@ -33,6 +33,7 @@ !defined(DINGUX) && \ !defined(CAANOO) && \ !defined(LINUXMOTO) && \ + !defined(SAMSUNGTV) && \ !defined(OPENPANDORA) #include "backends/platform/sdl/sdl.h" diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp index 1122e9b20a..84bbf55a92 100644 --- a/backends/platform/sdl/posix/posix.cpp +++ b/backends/platform/sdl/posix/posix.cpp @@ -82,6 +82,9 @@ Common::WriteStream *OSystem_POSIX::createLogFile() { #else logFile += "/.scummvm"; #endif +#ifdef SAMSUNGTV + logFile = "/mtd_ram"; +#endif struct stat sb; -- cgit v1.2.3