[Scummvm-cvs-logs] SF.net SVN: scummvm:[49866] scummvm/trunk

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Tue Jun 15 18:58:03 CEST 2010


Revision: 49866
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49866&view=rev
Author:   m_kiewitz
Date:     2010-06-15 16:58:03 +0000 (Tue, 15 Jun 2010)

Log Message:
-----------
SDL: only change mouse cursor, when mouse is currently within our window, also enable mouse position changing again for SCI

Modified Paths:
--------------
    scummvm/trunk/backends/platform/sdl/graphics.cpp
    scummvm/trunk/engines/sci/graphics/cursor.cpp

Modified: scummvm/trunk/backends/platform/sdl/graphics.cpp
===================================================================
--- scummvm/trunk/backends/platform/sdl/graphics.cpp	2010-06-15 16:56:23 UTC (rev 49865)
+++ scummvm/trunk/backends/platform/sdl/graphics.cpp	2010-06-15 16:58:03 UTC (rev 49866)
@@ -1377,6 +1377,10 @@
 void OSystem_SDL::warpMouse(int x, int y) {
 	int y1 = y;
 
+	// Don't change mouse position, when mouse is outside of our window (in case of windowed mode)
+	if (!(SDL_GetAppState( ) & SDL_APPMOUSEFOCUS))
+		return;
+
 	if (_videoMode.aspectRatioCorrection && !_overlayVisible)
 		y1 = real2Aspect(y);
 

Modified: scummvm/trunk/engines/sci/graphics/cursor.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/cursor.cpp	2010-06-15 16:56:23 UTC (rev 49865)
+++ scummvm/trunk/engines/sci/graphics/cursor.cpp	2010-06-15 16:58:03 UTC (rev 49866)
@@ -219,6 +219,7 @@
 	// TODO: What about the 2000 resources? Inventory items? How to handle?
 	// TODO: What games does this work for? At least it does for KQ6.
 	// TODO: Stop asking rhetorical questions.
+	// TODO: It was fred all along!
 
 	Resource *resource = _resMan->findResource(ResourceId(kResourceTypeCursor, 1000 + celNum), false);
 
@@ -258,16 +259,12 @@
 }
 
 void GfxCursor::setPosition(Common::Point pos) {
-	// This code has been disabled because it's annoying in windowed mode. The engine shouldn't move
-	// the mouse cursor whenever it wants, it interferes with other programs
-#if 0
 	if (!_upscaledHires) {
 		g_system->warpMouse(pos.x, pos.y);
 	} else {
 		_screen->adjustToUpscaledCoordinates(pos.y, pos.x);
 		g_system->warpMouse(pos.x, pos.y);
 	}
-#endif
 }
 
 Common::Point GfxCursor::getPosition() {
@@ -293,9 +290,6 @@
 }
 
 void GfxCursor::refreshPosition() {
-	// This code has been disabled because it's annoying in windowed mode. The engine shouldn't move
-	// the mouse cursor whenever it wants, it interferes with other programs
-#if 0
 	bool clipped = false;
 	Common::Point mousePoint = getPosition();
 
@@ -318,7 +312,6 @@
 	// FIXME: Do this only when mouse is grabbed?
 	if (clipped)
 		setPosition(mousePoint);
-#endif
 }
 
 void GfxCursor::kernelSetMoveZone(Common::Rect zone) {


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