changeset 3585:f8816ffa210b

Initial band-aids on SDL_GetMouseState() API breakage. More work to come. Fixes Bugzilla #758.
author Ryan C. Gordon <icculus@icculus.org>
date Wed, 16 Dec 2009 19:50:51 +0000
parents 41d01d70659c
children b6758aee0dd4
files include/SDL_mouse.h src/SDL_compat.c src/events/SDL_mouse.c test/testalpha.c test/testgl.c
diffstat 5 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/include/SDL_mouse.h	Wed Dec 16 16:42:04 2009 +0000
+++ b/include/SDL_mouse.h	Wed Dec 16 19:50:51 2009 +0000
@@ -111,7 +111,7 @@
  *  mouse cursor position relative to the focus window for the currently
  *  selected mouse.  You can pass NULL for either x or y.
  */
-extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int index, int *x, int *y);
+extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y);
 
 /**
  *  \brief Retrieve the state of the specified mouse.
--- a/src/SDL_compat.c	Wed Dec 16 16:42:04 2009 +0000
+++ b/src/SDL_compat.c	Wed Dec 16 19:50:51 2009 +0000
@@ -285,7 +285,7 @@
             }
 
             selected = SDL_SelectMouse(event->wheel.which);
-            SDL_GetMouseState(selected, &x, &y);
+            SDL_GetMouseState(&x, &y);
             SDL_SelectMouse(selected);
 
             if (event->wheel.y > 0) {
--- a/src/events/SDL_mouse.c	Wed Dec 16 16:42:04 2009 +0000
+++ b/src/events/SDL_mouse.c	Wed Dec 16 19:50:51 2009 +0000
@@ -252,9 +252,9 @@
 }
 
 Uint8
-SDL_GetMouseState(int index, int *x, int *y)
+SDL_GetMouseState(int *x, int *y)
 {
-    SDL_Mouse *mouse = SDL_GetMouse(index);
+    SDL_Mouse *mouse = SDL_GetMouse(SDL_current_mouse);
 
     if (!mouse) {
         if (x) {
--- a/test/testalpha.c	Wed Dec 16 16:42:04 2009 +0000
+++ b/test/testalpha.c	Wed Dec 16 19:50:51 2009 +0000
@@ -291,7 +291,7 @@
     if (light != NULL) {
         int x, y;
 
-        SDL_GetMouseState(0, &x, &y);
+        SDL_GetMouseState(&x, &y);
         FlashLight(screen, light, x, y);
     }
 
--- a/test/testgl.c	Wed Dec 16 16:42:04 2009 +0000
+++ b/test/testgl.c	Wed Dec 16 19:50:51 2009 +0000
@@ -270,7 +270,7 @@
     }
 
     /* Move the image around */
-    SDL_GetMouseState(0, &x, &y);
+    SDL_GetMouseState(&x, &y);
     x -= w / 2;
     y -= h / 2;