Initial band-aids on SDL_GetMouseState() API breakage. More work to come.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 16 Dec 2009 19:50:51 +0000
changeset 3585 f8816ffa210b
parent 3584 41d01d70659c
child 3586 b6758aee0dd4
Initial band-aids on SDL_GetMouseState() API breakage. More work to come. Fixes Bugzilla #758.
include/SDL_mouse.h
src/SDL_compat.c
src/events/SDL_mouse.c
test/testalpha.c
test/testgl.c
--- 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;