[Scummvm-cvs-logs] SF.net SVN: scummvm:[50258] scummvm/branches/gsoc2010-opengl/backends

vgvgf at users.sourceforge.net vgvgf at users.sourceforge.net
Fri Jun 25 07:02:40 CEST 2010


Revision: 50258
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50258&view=rev
Author:   vgvgf
Date:     2010-06-25 05:02:40 +0000 (Fri, 25 Jun 2010)

Log Message:
-----------
Modularized Samsung TV port.

Modified Paths:
--------------
    scummvm/branches/gsoc2010-opengl/backends/events/sdl/sdl-events.h
    scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/main.cpp
    scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/module.mk
    scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/samsungtv.cpp
    scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/samsungtv.h
    scummvm/branches/gsoc2010-opengl/backends/platform/sdl/posix/posix-main.cpp

Added Paths:
-----------
    scummvm/branches/gsoc2010-opengl/backends/events/samsungtv/
    scummvm/branches/gsoc2010-opengl/backends/events/samsungtv/samsungtv-events.cpp
    scummvm/branches/gsoc2010-opengl/backends/events/samsungtv/samsungtv-events.h

Removed Paths:
-------------
    scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/events.cpp


Property changes on: scummvm/branches/gsoc2010-opengl/backends/events/samsungtv
___________________________________________________________________
Added: svn:ignore
   + .deps
*.o
lib*.a


Added: scummvm/branches/gsoc2010-opengl/backends/events/samsungtv/samsungtv-events.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/events/samsungtv/samsungtv-events.cpp	                        (rev 0)
+++ scummvm/branches/gsoc2010-opengl/backends/events/samsungtv/samsungtv-events.cpp	2010-06-25 05:02:40 UTC (rev 50258)
@@ -0,0 +1,78 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#if defined(SAMSUNGTV)
+
+#include "backends/events/samsungtv/samsungtv-events.h"
+
+SdlSamsungTVEventManager::SdlSamsungTVEventManager(Common::EventSource *boss)
+	:
+	SdlEventManager(boss) {
+
+}
+
+bool SdlSamsungTVEventManager::remapKey(SDL_Event &ev, Common::Event &event) {
+	switch (ev.type) {
+		case SDL_KEYDOWN:{
+			if (ev.key.keysym.sym == SDLK_POWER) {
+				event.type = Common::EVENT_QUIT;
+				return true;
+			} else if (ev.key.keysym.sym == SDLK_F1 && ev.key.keysym.scancode == 20) {
+				event.type = Common::EVENT_KEYDOWN;
+				event.kbd.keycode = Common::KEYCODE_F5;
+				event.kbd.ascii = Common::ASCII_F5;
+				return true;
+			} else if (ev.key.keysym.sym == SDLK_F2 && ev.key.keysym.scancode == 21) {
+				event.type = Common::EVENT_KEYDOWN;
+				event.kbd.keycode = Common::KEYCODE_F7;
+				event.kbd.ascii = Common::ASCII_F7;
+				return true;
+			}
+			break;
+		}
+		case SDL_KEYUP: {
+			if (ev.key.keysym.sym == SDLK_POWER) {
+				event.type = Common::EVENT_QUIT;
+				return true;
+			} else if (ev.key.keysym.sym == SDLK_F1 && ev.key.keysym.scancode == 20) {
+				event.type = Common::EVENT_KEYUP;
+				event.kbd.keycode = Common::KEYCODE_F5;
+				event.kbd.ascii = Common::ASCII_F5;
+				return true;
+			} else if (ev.key.keysym.sym == SDLK_F2 && ev.key.keysym.scancode == 21) {
+				event.type = Common::EVENT_KEYUP;
+				event.kbd.keycode = Common::KEYCODE_F7;
+				event.kbd.ascii = Common::ASCII_F7;
+				return true;
+			}
+			break;
+		}
+	}
+
+	// Invoke parent implementation of this method
+	return SdlEventManager::remapKey(ev, event);
+}
+
+#endif


Property changes on: scummvm/branches/gsoc2010-opengl/backends/events/samsungtv/samsungtv-events.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Added: scummvm/branches/gsoc2010-opengl/backends/events/samsungtv/samsungtv-events.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/events/samsungtv/samsungtv-events.h	                        (rev 0)
+++ scummvm/branches/gsoc2010-opengl/backends/events/samsungtv/samsungtv-events.h	2010-06-25 05:02:40 UTC (rev 50258)
@@ -0,0 +1,40 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#if !defined(BACKEND_EVENTS_SDL_SAMSUNGTV_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER)
+#define BACKEND_EVENTS_SDL_SAMSUNGTV_H
+
+#include "backends/events/sdl/sdl-events.h"
+
+class SdlSamsungTVEventManager : public SdlEventManager {
+public:
+	SdlSamsungTVEventManager(Common::EventSource *boss);
+	~SdlSamsungTVEventManager() {}
+
+protected:
+	bool remapKey(SDL_Event &ev, Common::Event &event);
+};
+
+#endif


Property changes on: scummvm/branches/gsoc2010-opengl/backends/events/samsungtv/samsungtv-events.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Modified: scummvm/branches/gsoc2010-opengl/backends/events/sdl/sdl-events.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/events/sdl/sdl-events.h	2010-06-25 03:48:28 UTC (rev 50257)
+++ scummvm/branches/gsoc2010-opengl/backends/events/sdl/sdl-events.h	2010-06-25 05:02:40 UTC (rev 50258)
@@ -37,11 +37,11 @@
 class SdlEventManager : public DefaultEventManager {
 public:
 	SdlEventManager(Common::EventSource *boss);
-	~SdlEventManager();
+	virtual ~SdlEventManager();
 
 	virtual bool pollSdlEvent(Common::Event &event);
 
-	void resetKeyboadEmulation(int16 x_max, int16 y_max);
+	virtual void resetKeyboadEmulation(int16 x_max, int16 y_max);
 
 protected:
 	virtual void preprocessEvents(SDL_Event *event) {}
@@ -78,9 +78,9 @@
 	virtual bool handleJoyAxisMotion(SDL_Event &ev, Common::Event &event);
 
 	virtual void fillMouseEvent(Common::Event &event, int x, int y); // overloaded by CE backend
-	void toggleMouseGrab();
+	virtual void toggleMouseGrab();
 
-	void handleKbdMouse();
+	virtual void handleKbdMouse();
 	virtual bool remapKey(SDL_Event &ev, Common::Event &event);
 
 	int _lastScreenID;

Deleted: scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/events.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/events.cpp	2010-06-25 03:48:28 UTC (rev 50257)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/events.cpp	2010-06-25 05:02:40 UTC (rev 50258)
@@ -1,73 +0,0 @@
-/* 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.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "backends/platform/samsungtv/samsungtv.h"
-#include "common/util.h"
-#include "common/events.h"
-
-#if defined(SAMSUNGTV)
-
-bool OSystem_SDL_SamsungTV::remapKey(SDL_Event &ev, Common::Event &event) {
-	switch (ev.type) {
-		case SDL_KEYDOWN:{
-			if (ev.key.keysym.sym == SDLK_POWER) {
-				event.type = Common::EVENT_QUIT;
-				return true;
-			} else if (ev.key.keysym.sym == SDLK_F1 && ev.key.keysym.scancode == 20) {
-				event.type = Common::EVENT_KEYDOWN;
-				event.kbd.keycode = Common::KEYCODE_F5;
-				event.kbd.ascii = Common::ASCII_F5;
-				return true;
-			} else if (ev.key.keysym.sym == SDLK_F2 && ev.key.keysym.scancode == 21) {
-				event.type = Common::EVENT_KEYDOWN;
-				event.kbd.keycode = Common::KEYCODE_F7;
-				event.kbd.ascii = Common::ASCII_F7;
-				return true;
-			}
-			break;
-		}
-		case SDL_KEYUP: {
-			if (ev.key.keysym.sym == SDLK_POWER) {
-				event.type = Common::EVENT_QUIT;
-				return true;
-			} else if (ev.key.keysym.sym == SDLK_F1 && ev.key.keysym.scancode == 20) {
-				event.type = Common::EVENT_KEYUP;
-				event.kbd.keycode = Common::KEYCODE_F5;
-				event.kbd.ascii = Common::ASCII_F5;
-				return true;
-			} else if (ev.key.keysym.sym == SDLK_F2 && ev.key.keysym.scancode == 21) {
-				event.type = Common::EVENT_KEYUP;
-				event.kbd.keycode = Common::KEYCODE_F7;
-				event.kbd.ascii = Common::ASCII_F7;
-				return true;
-			}
-			break;
-		}
-	}
-
-	return false;
-}
-
-#endif

Modified: scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/main.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/main.cpp	2010-06-25 03:48:28 UTC (rev 50257)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/main.cpp	2010-06-25 05:02:40 UTC (rev 50258)
@@ -34,16 +34,23 @@
 extern "C" int Game_Main(char *path, char *) {
 	chdir(path);
 
+	// Create OSystem instance
 	g_system = new OSystem_SDL_SamsungTV();
 	assert(g_system);
 
+	// Pre initialize the backend
+	((OSystem_SDL_SamsungTV *)g_system)->init();
+
 #ifdef DYNAMIC_MODULES
 	PluginManager::instance().addPluginProvider(new SDLPluginProvider());
 #endif
 
 	// Invoke the actual ScummVM main entry point:
 	int res = scummvm_main(0, 0);
-	((OSystem_SDL *)g_system)->deinit();
+
+	// Free OSystem
+	delete (OSystem_SDL_SamsungTV *)g_system;
+
 	return res;
 }
 

Modified: scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/module.mk
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/module.mk	2010-06-25 03:48:28 UTC (rev 50257)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/module.mk	2010-06-25 05:02:40 UTC (rev 50258)
@@ -1,7 +1,6 @@
 MODULE := backends/platform/samsungtv
 
 MODULE_OBJS := \
-	events.o \
 	main.o \
 	samsungtv.o
 

Modified: scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/samsungtv.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/samsungtv.cpp	2010-06-25 03:48:28 UTC (rev 50257)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/samsungtv.cpp	2010-06-25 05:02:40 UTC (rev 50258)
@@ -29,14 +29,14 @@
 
 bool OSystem_SDL_SamsungTV::hasFeature(Feature f) {
 	return
-		(f == kFeatureAspectRatioCorrection) ||
-		(f == kFeatureCursorHasPalette);
+		(f == OSystem::kFeatureAspectRatioCorrection) ||
+		(f == OSystem::kFeatureCursorHasPalette);
 }
 
 void OSystem_SDL_SamsungTV::setFeatureState(Feature f, bool enable) {
 	switch (f) {
-	case kFeatureAspectRatioCorrection:
-		setAspectRatioCorrection(enable);
+	case OSystem::kFeatureAspectRatioCorrection:
+		_graphicsManager->setFeatureState(f, enable);
 		break;
 	default:
 		break;
@@ -44,11 +44,9 @@
 }
 
 bool OSystem_SDL_SamsungTV::getFeatureState(Feature f) {
-	assert (_transactionMode == kTransactionNone);
-
 	switch (f) {
-	case kFeatureAspectRatioCorrection:
-		return _videoMode.aspectRatioCorrection;
+	case OSystem::kFeatureAspectRatioCorrection:
+		return _graphicsManager->getFeatureState(f);
 	default:
 		return false;
 	}

Modified: scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/samsungtv.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/samsungtv.h	2010-06-25 03:48:28 UTC (rev 50257)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/samsungtv/samsungtv.h	2010-06-25 05:02:40 UTC (rev 50258)
@@ -26,26 +26,15 @@
 #ifndef SDL_SAMSUNGTV_COMMON_H
 #define SDL_SAMSUNGTV_COMMON_H
 
-#include <SDL.h>
-
-#include "backends/base-backend.h"
-#include "backends/platform/sdl/sdl.h"
-
 #if defined(SAMSUNGTV)
 
-namespace Audio {
-	class MixerImpl;
-}
+#include "backends/platform/sdl/posix/posix.h"
 
 class OSystem_SDL_SamsungTV : public OSystem_SDL {
 public:
 	virtual bool hasFeature(Feature f);
 	virtual void setFeatureState(Feature f, bool enable);
 	virtual bool getFeatureState(Feature f);
-
-protected:
-
-	virtual bool remapKey(SDL_Event &ev, Common::Event &event);
 };
 
 #endif

Modified: scummvm/branches/gsoc2010-opengl/backends/platform/sdl/posix/posix-main.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/sdl/posix/posix-main.cpp	2010-06-25 03:48:28 UTC (rev 50257)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/sdl/posix/posix-main.cpp	2010-06-25 05:02:40 UTC (rev 50258)
@@ -23,7 +23,7 @@
  *
  */
 
-#if defined(UNIX) && !defined(MACOSX)
+#if defined(UNIX) && !defined(MACOSX) && !defined(SAMSUNGTV)
 
 #include "common/scummsys.h"
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list