[Scummvm-cvs-logs] scummvm master -> 2fe303ce3fff008a58e9750c66e707ec4e7c93d8

lordhoto lordhoto at gmail.com
Fri Jan 24 00:23:46 CET 2014


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

Summary:
2df57c17e5 BUILD: Enable RTTI again.
1fc5d52e90 DEVTOOLS: Enable RTTI in create_project generated project files.
281672e171 SDL: Let SdlGraphicsManager inherit from GraphicsManager.
ea6d38d5f3 SDL: Make activateManager/deactivateManager SdlGraphicsManager specific.
cfa6b1b4ae SDL: Further small cleanup related to manager switching.
a7f94591b0 BUILD: Enable RTTI on Android.
2fe303ce3f Merge pull request #409 from lordhoto/rtti


Commit: 2df57c17e51d6bef5331297599b4a93411d41fec
    https://github.com/scummvm/scummvm/commit/2df57c17e51d6bef5331297599b4a93411d41fec
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2013-10-23T14:45:29-07:00

Commit Message:
BUILD: Enable RTTI again.

Changed paths:
    Makefile



diff --git a/Makefile b/Makefile
index 09c38b2..1856464 100644
--- a/Makefile
+++ b/Makefile
@@ -33,8 +33,9 @@ ifeq "$(HAVE_GCC)" "1"
 	#CXXFLAGS+= -Wmissing-format-attribute
 
 ifneq "$(BACKEND)" "tizen"
-	# Disable RTTI and exceptions. These settings cause tizen apps to crash
-	CXXFLAGS+= -fno-rtti -fno-exceptions
+	# Disable exceptions. This setting causes tizen apps to crash
+	# TODO: Does this still apply after enabling RTTI again?
+	CXXFLAGS+= -fno-exceptions
 endif
 
 ifneq "$(HAVE_CLANG)" "1"


Commit: 1fc5d52e906186bdde6e5c46e84268b9c958691c
    https://github.com/scummvm/scummvm/commit/1fc5d52e906186bdde6e5c46e84268b9c958691c
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2013-10-23T14:45:58-07:00

Commit Message:
DEVTOOLS: Enable RTTI in create_project generated project files.

Changed paths:
    devtools/create_project/config.h



diff --git a/devtools/create_project/config.h b/devtools/create_project/config.h
index 1a66edf..a8313a3 100644
--- a/devtools/create_project/config.h
+++ b/devtools/create_project/config.h
@@ -32,6 +32,6 @@
 #define DISABLE_EDIT_AND_CONTINUE "tinsel,tony,scummvm"     // Comma separated list of projects that need Edit&Continue to be disabled for co-routine support (the main project is automatically added)
 
 //#define ADDITIONAL_LIBRARY ""            // Add a single library to the list of externally linked libraries
-#define NEEDS_RTTI 0                     // Enable RTTI globally
+#define NEEDS_RTTI 1                     // Enable RTTI globally
 
 #endif // TOOLS_CREATE_PROJECT_CONFIG_H


Commit: 281672e1718d5f960061b714f79924125922e1e5
    https://github.com/scummvm/scummvm/commit/281672e1718d5f960061b714f79924125922e1e5
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2013-10-23T15:03:09-07:00

Commit Message:
SDL: Let SdlGraphicsManager inherit from GraphicsManager.

Changed paths:
    backends/graphics/opengl/opengl-graphics.h
    backends/graphics/sdl/sdl-graphics.h
    backends/graphics/surfacesdl/surfacesdl-graphics.h



diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h
index d2d0358..93c0c5b 100644
--- a/backends/graphics/opengl/opengl-graphics.h
+++ b/backends/graphics/opengl/opengl-graphics.h
@@ -47,7 +47,7 @@ enum {
 	GFX_NEAREST = 1
 };
 
-class OpenGLGraphicsManager : public GraphicsManager {
+class OpenGLGraphicsManager : virtual public GraphicsManager {
 public:
 	OpenGLGraphicsManager();
 	virtual ~OpenGLGraphicsManager();
diff --git a/backends/graphics/sdl/sdl-graphics.h b/backends/graphics/sdl/sdl-graphics.h
index 4d4338a..ebf8078 100644
--- a/backends/graphics/sdl/sdl-graphics.h
+++ b/backends/graphics/sdl/sdl-graphics.h
@@ -23,6 +23,8 @@
 #ifndef BACKENDS_GRAPHICS_SDL_SDLGRAPHICS_H
 #define BACKENDS_GRAPHICS_SDL_SDLGRAPHICS_H
 
+#include "backends/graphics/graphics.h"
+
 #include "common/rect.h"
 
 class SdlEventSource;
@@ -31,11 +33,8 @@ class SdlEventSource;
  * Base class for a SDL based graphics manager.
  *
  * It features a few extra a few extra features required by SdlEventSource.
- * FIXME/HACK:
- * Note it does not inherit from GraphicsManager to avoid a diamond inheritance
- * in the current OpenGLSdlGraphicsManager.
  */
-class SdlGraphicsManager {
+class SdlGraphicsManager : virtual public GraphicsManager {
 public:
 	SdlGraphicsManager(SdlEventSource *source);
 	virtual ~SdlGraphicsManager();
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.h b/backends/graphics/surfacesdl/surfacesdl-graphics.h
index 00c05ff..22b7780 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.h
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.h
@@ -75,7 +75,7 @@ public:
 /**
  * SDL graphics manager
  */
-class SurfaceSdlGraphicsManager : public GraphicsManager, public SdlGraphicsManager, public Common::EventObserver {
+class SurfaceSdlGraphicsManager : public SdlGraphicsManager, public Common::EventObserver {
 public:
 	SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSource);
 	virtual ~SurfaceSdlGraphicsManager();


Commit: ea6d38d5f3b123b765e5bf8e2dc4f957e4b43eb6
    https://github.com/scummvm/scummvm/commit/ea6d38d5f3b123b765e5bf8e2dc4f957e4b43eb6
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2013-10-23T15:06:32-07:00

Commit Message:
SDL: Make activateManager/deactivateManager SdlGraphicsManager specific.

We can do this now that we can use virtual inheritance and dynamic_cast
because we enabled RTTI.

Changed paths:
    backends/graphics/graphics.h
    backends/graphics/openglsdl/openglsdl-graphics.cpp
    backends/graphics/sdl/sdl-graphics.h
    backends/graphics/surfacesdl/surfacesdl-graphics.cpp
    backends/platform/sdl/sdl.cpp



diff --git a/backends/graphics/graphics.h b/backends/graphics/graphics.h
index 74258b8..2439722 100644
--- a/backends/graphics/graphics.h
+++ b/backends/graphics/graphics.h
@@ -37,27 +37,6 @@ class GraphicsManager : public PaletteManager {
 public:
 	virtual ~GraphicsManager() {}
 
-	/**
-	 * Makes this graphics manager active. That means it should be ready to
-	 * process inputs now. However, even without being active it should be
-	 * able to query the supported modes and other bits.
-	 *
-	 * HACK: Actually this is specific to SdlGraphicsManager subclasses.
-	 * But sadly we cannot cast from GraphicsManager to SdlGraphicsManager
-	 * because there is no relation between these two.
-	 */
-	virtual void activateManager() {}
-
-	/**
-	 * Makes this graphics manager inactive. This should allow another
-	 * graphics manager to become active again.
-	 *
-	 * HACK: Actually this is specific to SdlGraphicsManager subclasses.
-	 * But sadly we cannot cast from GraphicsManager to SdlGraphicsManager
-	 * because there is no relation between these two.
-	 */
-	virtual void deactivateManager() {}
-
 	virtual bool hasFeature(OSystem::Feature f) = 0;
 	virtual void setFeatureState(OSystem::Feature f, bool enable) = 0;
 	virtual bool getFeatureState(OSystem::Feature f) = 0;
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index e39cd35..f76d7b2 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -73,7 +73,7 @@ OpenGLSdlGraphicsManager::~OpenGLSdlGraphicsManager() {
 }
 
 void OpenGLSdlGraphicsManager::activateManager() {
-	OpenGLGraphicsManager::activateManager();
+	SdlGraphicsManager::activateManager();
 	initEventSource();
 
 	// Register the graphics manager as a event observer
@@ -87,7 +87,7 @@ void OpenGLSdlGraphicsManager::deactivateManager() {
 	}
 
 	deinitEventSource();
-	OpenGLGraphicsManager::deactivateManager();
+	SdlGraphicsManager::deactivateManager();
 }
 
 bool OpenGLSdlGraphicsManager::hasFeature(OSystem::Feature f) {
diff --git a/backends/graphics/sdl/sdl-graphics.h b/backends/graphics/sdl/sdl-graphics.h
index ebf8078..fea743b 100644
--- a/backends/graphics/sdl/sdl-graphics.h
+++ b/backends/graphics/sdl/sdl-graphics.h
@@ -40,6 +40,19 @@ public:
 	virtual ~SdlGraphicsManager();
 
 	/**
+	 * Makes this graphics manager active. That means it should be ready to
+	 * process inputs now. However, even without being active it should be
+	 * able to query the supported modes and other bits.
+	 */
+	virtual void activateManager() {}
+
+	/**
+	 * Makes this graphics manager inactive. This should allow another
+	 * graphics manager to become active again.
+	 */
+	virtual void deactivateManager() {}
+
+	/**
 	 * Notify the graphics manager that the graphics needs to be redrawn, since
 	 * the application window was modified.
 	 *
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index c946b8e..15193e2 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -198,7 +198,7 @@ SurfaceSdlGraphicsManager::~SurfaceSdlGraphicsManager() {
 }
 
 void SurfaceSdlGraphicsManager::activateManager() {
-	GraphicsManager::activateManager();
+	SdlGraphicsManager::activateManager();
 	initEventSource();
 
 	// Register the graphics manager as a event observer
@@ -212,7 +212,7 @@ void SurfaceSdlGraphicsManager::deactivateManager() {
 	}
 
 	deinitEventSource();
-	GraphicsManager::deactivateManager();
+	SdlGraphicsManager::deactivateManager();
 }
 
 bool SurfaceSdlGraphicsManager::hasFeature(OSystem::Feature f) {
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index c240727..6175f07 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -91,7 +91,7 @@ OSystem_SDL::~OSystem_SDL() {
 	delete _savefileManager;
 	_savefileManager = 0;
 	if (_graphicsManager) {
-		_graphicsManager->deactivateManager();
+		dynamic_cast<SdlGraphicsManager *>(_graphicsManager)->deactivateManager();
 	}
 	delete _graphicsManager;
 	_graphicsManager = 0;
@@ -240,7 +240,7 @@ void OSystem_SDL::initBackend() {
 	// so the virtual keyboard can be initialized, but we have to add the
 	// graphics manager as an event observer after initializing the event
 	// manager.
-	_graphicsManager->activateManager();
+	dynamic_cast<SdlGraphicsManager *>(_graphicsManager)->activateManager();
 }
 
 #if defined(USE_TASKBAR)
@@ -585,14 +585,14 @@ bool OSystem_SDL::setGraphicsMode(int mode) {
 	// manager, delete and create the new mode graphics manager
 	if (_graphicsMode >= _firstGLMode && mode < _firstGLMode) {
 		debug(1, "switching to plain SDL graphics");
-		_graphicsManager->deactivateManager();
+		dynamic_cast<SdlGraphicsManager *>(_graphicsManager)->deactivateManager();
 		delete _graphicsManager;
 		_graphicsManager = new SurfaceSdlGraphicsManager(_eventSource);
 
 		switchedManager = true;
 	} else if (_graphicsMode < _firstGLMode && mode >= _firstGLMode) {
 		debug(1, "switching to OpenGL graphics");
-		_graphicsManager->deactivateManager();
+		dynamic_cast<SdlGraphicsManager *>(_graphicsManager)->deactivateManager();
 		delete _graphicsManager;
 		_graphicsManager = new OpenGLSdlGraphicsManager(_desktopWidth, _desktopHeight, _eventSource);
 
@@ -602,7 +602,7 @@ bool OSystem_SDL::setGraphicsMode(int mode) {
 	_graphicsMode = mode;
 
 	if (switchedManager) {
-		_graphicsManager->activateManager();
+		dynamic_cast<SdlGraphicsManager *>(_graphicsManager)->activateManager();
 
 		_graphicsManager->beginGFXTransaction();
 #ifdef USE_RGB_COLOR


Commit: cfa6b1b4ae690a6712ef9b2fa6a5f21ff3c2173b
    https://github.com/scummvm/scummvm/commit/cfa6b1b4ae690a6712ef9b2fa6a5f21ff3c2173b
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2013-10-23T15:09:17-07:00

Commit Message:
SDL: Further small cleanup related to manager switching.

Changed paths:
    backends/graphics/openglsdl/openglsdl-graphics.cpp
    backends/graphics/sdl/sdl-graphics.cpp
    backends/graphics/sdl/sdl-graphics.h
    backends/graphics/surfacesdl/surfacesdl-graphics.cpp



diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index f76d7b2..3f9fc1f 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -74,7 +74,6 @@ OpenGLSdlGraphicsManager::~OpenGLSdlGraphicsManager() {
 
 void OpenGLSdlGraphicsManager::activateManager() {
 	SdlGraphicsManager::activateManager();
-	initEventSource();
 
 	// Register the graphics manager as a event observer
 	g_system->getEventManager()->getEventDispatcher()->registerObserver(this, 10, false);
@@ -86,7 +85,6 @@ void OpenGLSdlGraphicsManager::deactivateManager() {
 		g_system->getEventManager()->getEventDispatcher()->unregisterObserver(this);
 	}
 
-	deinitEventSource();
 	SdlGraphicsManager::deactivateManager();
 }
 
diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp
index 417f4fa..40b97b2 100644
--- a/backends/graphics/sdl/sdl-graphics.cpp
+++ b/backends/graphics/sdl/sdl-graphics.cpp
@@ -31,10 +31,10 @@ SdlGraphicsManager::SdlGraphicsManager(SdlEventSource *source)
 SdlGraphicsManager::~SdlGraphicsManager() {
 }
 
-void SdlGraphicsManager::initEventSource() {
+void SdlGraphicsManager::activateManager() {
 	_eventSource->setGraphicsManager(this);
 }
 
-void SdlGraphicsManager::deinitEventSource() {
+void SdlGraphicsManager::deactivateManager() {
 	_eventSource->setGraphicsManager(0);
 }
diff --git a/backends/graphics/sdl/sdl-graphics.h b/backends/graphics/sdl/sdl-graphics.h
index fea743b..3791961 100644
--- a/backends/graphics/sdl/sdl-graphics.h
+++ b/backends/graphics/sdl/sdl-graphics.h
@@ -44,13 +44,13 @@ public:
 	 * process inputs now. However, even without being active it should be
 	 * able to query the supported modes and other bits.
 	 */
-	virtual void activateManager() {}
+	virtual void activateManager();
 
 	/**
 	 * Makes this graphics manager inactive. This should allow another
 	 * graphics manager to become active again.
 	 */
-	virtual void deactivateManager() {}
+	virtual void deactivateManager();
 
 	/**
 	 * Notify the graphics manager that the graphics needs to be redrawn, since
@@ -92,9 +92,6 @@ public:
 	virtual void notifyMousePos(Common::Point mouse) = 0;
 
 protected:
-	void initEventSource();
-	void deinitEventSource();
-
 	SdlEventSource *_eventSource;
 };
 
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index 15193e2..d15fd6d 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -199,7 +199,6 @@ SurfaceSdlGraphicsManager::~SurfaceSdlGraphicsManager() {
 
 void SurfaceSdlGraphicsManager::activateManager() {
 	SdlGraphicsManager::activateManager();
-	initEventSource();
 
 	// Register the graphics manager as a event observer
 	g_system->getEventManager()->getEventDispatcher()->registerObserver(this, 10, false);
@@ -211,7 +210,6 @@ void SurfaceSdlGraphicsManager::deactivateManager() {
 		g_system->getEventManager()->getEventDispatcher()->unregisterObserver(this);
 	}
 
-	deinitEventSource();
 	SdlGraphicsManager::deactivateManager();
 }
 


Commit: a7f94591b03984978b77bad069a2456417b55df9
    https://github.com/scummvm/scummvm/commit/a7f94591b03984978b77bad069a2456417b55df9
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2014-01-23T15:22:14-08:00

Commit Message:
BUILD: Enable RTTI on Android.

Thanks to fuzzie for these changes.

Changed paths:
    configure



diff --git a/configure b/configure
index cb0b890..bcb3b17 100755
--- a/configure
+++ b/configure
@@ -2044,18 +2044,21 @@ case $_host_os in
 				CXXFLAGS="$CXXFLAGS -march=armv5te"
 				CXXFLAGS="$CXXFLAGS -mtune=xscale"
 				CXXFLAGS="$CXXFLAGS -msoft-float"
+				ABI="armeabi"
 				;;
 			android-v7a)
 				CXXFLAGS="$CXXFLAGS -march=armv7-a"
 				CXXFLAGS="$CXXFLAGS -mfloat-abi=softfp"
 				CXXFLAGS="$CXXFLAGS -mfpu=vfp"
 				LDFLAGS="$LDFLAGS -Wl,--fix-cortex-a8"
+				ABI="armeabi-v7a"
 				;;
 			ouya)
 				CXXFLAGS="$CXXFLAGS -march=armv7-a"
 				CXXFLAGS="$CXXFLAGS -mtune=cortex-a9"
 				CXXFLAGS="$CXXFLAGS -mfloat-abi=softfp"
 				CXXFLAGS="$CXXFLAGS -mfpu=neon"
+				ABI="armeabi-v7a"
 				;;
 		esac
 		CXXFLAGS="$CXXFLAGS --sysroot=$ANDROID_NDK/platforms/android-4/arch-arm"
@@ -2081,6 +2084,8 @@ case $_host_os in
 		CXXFLAGS="$CXXFLAGS -Wno-psabi"
 		LDFLAGS="$LDFLAGS --sysroot=$ANDROID_NDK/platforms/android-4/arch-arm"
 		LDFLAGS="$LDFLAGS -mthumb-interwork"
+		LDFLAGS="$LDFLAGS -L$ANDROID_NDK/sources/cxx-stl/gnu-libstdc++/`$CXX -dumpversion`/libs/$ABI/"
+		LIBS="$LIBS -lsupc++"
 		add_line_to_config_mk "ANDROID_SDK = $ANDROID_SDK"
 		_seq_midi=no
 		;;


Commit: 2fe303ce3fff008a58e9750c66e707ec4e7c93d8
    https://github.com/scummvm/scummvm/commit/2fe303ce3fff008a58e9750c66e707ec4e7c93d8
Author: Johannes Schickel (lordhoto at gmail.com)
Date: 2014-01-23T15:23:12-08:00

Commit Message:
Merge pull request #409 from lordhoto/rtti

Enable RTTI and clean up the code by exploiting the availability of dynamic_cast.

Changed paths:
    Makefile
    backends/graphics/graphics.h
    backends/graphics/opengl/opengl-graphics.h
    backends/graphics/openglsdl/openglsdl-graphics.cpp
    backends/graphics/sdl/sdl-graphics.cpp
    backends/graphics/sdl/sdl-graphics.h
    backends/graphics/surfacesdl/surfacesdl-graphics.cpp
    backends/graphics/surfacesdl/surfacesdl-graphics.h
    backends/platform/sdl/sdl.cpp
    configure
    devtools/create_project/config.h









More information about the Scummvm-git-logs mailing list