[Scummvm-cvs-logs] scummvm master -> 944e0be209f5ab47c3b903f258d2d41b990d80cb

aquadran aquadran at xtr.net.pl
Mon May 23 18:15:17 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
944e0be209 SAMSUNGTV: update port


Commit: 944e0be209f5ab47c3b903f258d2d41b990d80cb
    https://github.com/scummvm/scummvm/commit/944e0be209f5ab47c3b903f258d2d41b990d80cb
Author: Pawel Kolodziejski (aquadran at users.sourceforge.net)
Date: 2011-05-23T09:11:40-07:00

Commit Message:
SAMSUNGTV: update port

Changed paths:
  A backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp
  A backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h
    backends/base-backend.cpp
    backends/module.mk
    backends/platform/samsungtv/main.cpp
    backends/platform/samsungtv/samsungtv.cpp
    backends/platform/samsungtv/samsungtv.h
    backends/platform/sdl/main.cpp
    backends/platform/sdl/posix/posix.cpp
    backends/saves/posix/posix-saves.cpp



diff --git a/backends/base-backend.cpp b/backends/base-backend.cpp
index 68ec5ef..f3935b5 100644
--- a/backends/base-backend.cpp
+++ b/backends/base-backend.cpp
@@ -58,12 +58,8 @@ void BaseBackend::fillScreen(uint32 col) {
 
 
 #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"
diff --git a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp
new file mode 100644
index 0000000..b929b5f
--- /dev/null
+++ b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp
@@ -0,0 +1,58 @@
+/* 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/samsungtv/samsungtv.h"
+#include "backends/events/samsungtvsdl/samsungtvsdl-events.h"
+#include "backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h"
+
+#if defined(SAMSUNGTV)
+
+SamsungTVSdlGraphicsManager::SamsungTVSdlGraphicsManager(SdlEventSource *sdlEventSource)
+	: SdlGraphicsManager(sdlEventSource) {
+}
+
+bool SamsungTVSdlGraphicsManager::hasFeature(OSystem::Feature f) {
+	return
+		(f == OSystem::kFeatureAspectRatioCorrection) ||
+		(f == OSystem::kFeatureCursorHasPalette);
+}
+
+void SamsungTVSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
+	switch (f) {
+	case OSystem::kFeatureAspectRatioCorrection:
+		SdlGraphicsManager::setFeatureState(f, enable);
+		break;
+	default:
+		break;
+	}
+}
+
+bool SamsungTVSdlGraphicsManager::getFeatureState(OSystem::Feature f) {
+	switch (f) {
+	case OSystem::kFeatureAspectRatioCorrection:
+		return SdlGraphicsManager::getFeatureState(f);
+	default:
+		return false;
+	}
+}
+
+#endif
diff --git a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h
new file mode 100644
index 0000000..dc65c3a
--- /dev/null
+++ b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h
@@ -0,0 +1,41 @@
+/* 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 BACKENDS_GRAPHICS_SAMSUNGTV_H
+#define BACKENDS_GRAPHICS_SAMSUNGTV_H
+
+#if defined(SAMSUNGTV)
+
+#include "backends/graphics/sdl/sdl-graphics.h"
+
+class SamsungTVSdlGraphicsManager : public SdlGraphicsManager {
+public:
+	SamsungTVSdlGraphicsManager(SdlEventSource *sdlEventSource);
+
+	bool hasFeature(OSystem::Feature f);
+	void setFeatureState(OSystem::Feature f, bool enable);
+	bool getFeatureState(OSystem::Feature f);
+};
+
+#endif
+
+#endif
diff --git a/backends/module.mk b/backends/module.mk
index 15af3ab..adef8a2 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -149,7 +149,8 @@ endif
 
 ifeq ($(BACKEND),samsungstv)
 MODULE_OBJS += \
-	events/samsungtvsdl/samsungtvsdl-events.o
+	events/samsungtvsdl/samsungtvsdl-events.o \
+	graphics/samsungtvsdl/samsungtvsdl-graphics.o
 endif
 
 ifeq ($(BACKEND),webos)
diff --git a/backends/platform/samsungtv/main.cpp b/backends/platform/samsungtv/main.cpp
index a3253c1..4f32916 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 2cc520e..cb657a0 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 22a9649..b7a78a9 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 e8bb921..a0a64e1 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 1122e9b..84bbf55 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;
 
diff --git a/backends/saves/posix/posix-saves.cpp b/backends/saves/posix/posix-saves.cpp
index 5145a03..d82f8a1 100644
--- a/backends/saves/posix/posix-saves.cpp
+++ b/backends/saves/posix/posix-saves.cpp
@@ -50,7 +50,7 @@
 POSIXSaveFileManager::POSIXSaveFileManager() {
 	// Register default savepath based on HOME
 #if defined(SAMSUNGTV)
-	ConfMan.registerDefault("savepath", "/dtv/usb/sda1/.scummvm");
+	ConfMan.registerDefault("savepath", "/mtd_rwarea/scummvm/savegames");
 #else
 	Common::String savePath;
 	const char *home = getenv("HOME");






More information about the Scummvm-git-logs mailing list