# HG changeset patch # User Ryan C. Gordon # Date 1260993051 0 # Node ID f8816ffa210bbe01d156021010fda75447fbf7ca # Parent 41d01d70659c4f245c77636eb0eec4a945af3ff9 Initial band-aids on SDL_GetMouseState() API breakage. More work to come. Fixes Bugzilla #758. diff -r 41d01d70659c -r f8816ffa210b include/SDL_mouse.h --- 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. diff -r 41d01d70659c -r f8816ffa210b src/SDL_compat.c --- 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) { diff -r 41d01d70659c -r f8816ffa210b src/events/SDL_mouse.c --- 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) { diff -r 41d01d70659c -r f8816ffa210b test/testalpha.c --- 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); } diff -r 41d01d70659c -r f8816ffa210b test/testgl.c --- 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;