changeset 1267:fdc7ef6ecab4

Correctly manage mouse relative motion
author Patrice Mandin <patmandin@gmail.com>
date Wed, 25 Jan 2006 20:36:21 +0000
parents a7bea6db3c3e
children f098b247299d
files src/video/gem/SDL_gemevents.c src/video/gem/SDL_gemmouse.c
diffstat 2 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/gem/SDL_gemevents.c	Wed Jan 25 18:11:56 2006 +0000
+++ b/src/video/gem/SDL_gemevents.c	Wed Jan 25 20:36:21 2006 +0000
@@ -382,13 +382,13 @@
 	}
 
 	/* Mouse motion ? */
-	if ((prevmousex!=mx) || (prevmousey!=my)) {
-		if (GEM_mouse_relative) {
-			if ((SDL_AtariXbios_mousex!=0) || (SDL_AtariXbios_mousey!=0)) {
-				SDL_PrivateMouseMotion(0, 1, SDL_AtariXbios_mousex, SDL_AtariXbios_mousey);
-				SDL_AtariXbios_mousex = SDL_AtariXbios_mousey = 0;
-			}
-		} else {
+	if (GEM_mouse_relative) {
+		if (SDL_AtariXbios_mousex || SDL_AtariXbios_mousey) {
+			SDL_PrivateMouseMotion(0, 1, SDL_AtariXbios_mousex, SDL_AtariXbios_mousey);
+			SDL_AtariXbios_mousex = SDL_AtariXbios_mousey = 0;
+		}
+	} else {
+		if ((prevmousex!=mx) || (prevmousey!=my)) {
 			int posx, posy;
 
 			/* Give mouse position relative to window position */
--- a/src/video/gem/SDL_gemmouse.c	Wed Jan 25 18:11:56 2006 +0000
+++ b/src/video/gem/SDL_gemmouse.c	Wed Jan 25 20:36:21 2006 +0000
@@ -165,8 +165,8 @@
 void GEM_CheckMouseMode(_THIS)
 {
 	/* If the mouse is hidden and input is grabbed, we use relative mode */
-	if ( !(SDL_cursorstate & CURSOR_VISIBLE) &&
-		(this->input_grab != SDL_GRAB_OFF) &&
+	if ( (!(SDL_cursorstate & CURSOR_VISIBLE)) &&
+		/*(this->input_grab != SDL_GRAB_OFF) && */ /* Damn GEM can not grab */
              (SDL_GetAppState() & SDL_APPACTIVE) ) {
 		GEM_mouse_relative = SDL_TRUE;
 	} else {