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

vgvgf at users.sourceforge.net vgvgf at users.sourceforge.net
Mon Jul 19 07:33:58 CEST 2010


Revision: 51015
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51015&view=rev
Author:   vgvgf
Date:     2010-07-19 05:33:58 +0000 (Mon, 19 Jul 2010)

Log Message:
-----------
SDL: Hack to handle special SDL events.

Modified Paths:
--------------
    scummvm/branches/gsoc2010-opengl/backends/events/sdl/sdl-events.cpp
    scummvm/branches/gsoc2010-opengl/backends/graphics/sdl/sdl-graphics.cpp
    scummvm/branches/gsoc2010-opengl/backends/platform/sdl/sdl.h

Modified: scummvm/branches/gsoc2010-opengl/backends/events/sdl/sdl-events.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/events/sdl/sdl-events.cpp	2010-07-19 05:30:40 UTC (rev 51014)
+++ scummvm/branches/gsoc2010-opengl/backends/events/sdl/sdl-events.cpp	2010-07-19 05:33:58 UTC (rev 51015)
@@ -238,6 +238,18 @@
 	case SDL_JOYAXISMOTION:
 		return handleJoyAxisMotion(ev, event);
 
+	case SDL_VIDEOEXPOSE:
+		// HACK: Send a fake event, handled by SdlGraphicsManager
+		event.type = (Common::EventType)OSystem_SDL::kSdlEventExpose;
+		return true;
+
+	case SDL_VIDEORESIZE:
+		// HACK: Send a fake event, handled by OpenGLSdlGraphicsManager
+		event.type = (Common::EventType)OSystem_SDL::kSdlEventResize;
+		event.mouse.x = ev.resize.w;
+		event.mouse.y = ev.resize.h;
+		return true;
+
 	case SDL_QUIT:
 		event.type = Common::EVENT_QUIT;
 		return true;

Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/sdl/sdl-graphics.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/sdl/sdl-graphics.cpp	2010-07-19 05:30:40 UTC (rev 51014)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/sdl/sdl-graphics.cpp	2010-07-19 05:33:58 UTC (rev 51015)
@@ -26,7 +26,8 @@
 #if defined(WIN32) || defined(UNIX) || defined(MACOSX)
 
 #include "backends/graphics/sdl/sdl-graphics.h"
-#include "common/system.h"
+#include "backends/events/sdl/sdl-events.h"
+#include "backends/platform/sdl/sdl.h"
 #include "common/config-manager.h"
 #include "common/mutex.h"
 #include "common/translation.h"
@@ -39,7 +40,6 @@
 #include "graphics/scaler.h"
 #include "graphics/scaler/aspect.h"
 #include "graphics/surface.h"
-#include "backends/events/sdl/sdl-events.h"
 
 static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
 	{"1x", _s("Normal (no scaling)"), GFX_NORMAL},
@@ -2122,7 +2122,7 @@
 }
 
 bool SdlGraphicsManager::notifyEvent(const Common::Event &event) {
-	switch (event.type) {
+	switch ((int)event.type) {
 	case Common::EVENT_KEYDOWN:
 		// Alt-Return and Alt-Enter toggle full screen mode
 		if (event.kbd.hasFlags(Common::KBD_ALT) &&
@@ -2172,9 +2172,11 @@
 	case Common::EVENT_MBUTTONUP:
 		adjustMouseEvent(event);
 		return !event.synthetic;
-	/*case SDL_VIDEOEXPOSE:
+
+	// HACK: Handle special SDL event
+	case OSystem_SDL::kSdlEventExpose:
 		_forceFull = true;
-		return false;*/
+		return false;
 	default:
 		break;
 	}

Modified: scummvm/branches/gsoc2010-opengl/backends/platform/sdl/sdl.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/sdl/sdl.h	2010-07-19 05:30:40 UTC (rev 51014)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/sdl/sdl.h	2010-07-19 05:33:58 UTC (rev 51015)
@@ -72,6 +72,12 @@
 	virtual void getTimeAndDate(TimeDate &td) const;
 	virtual Audio::Mixer *getMixer();
 
+	// HACK: Special SDL events types
+	enum SdlEvent {
+		kSdlEventExpose = 100,
+		kSdlEventResize = 101
+	};
+
 protected:
 	bool _inited;
 	bool _initedSDL;


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