From f0bc1863e58d1a4569f3d84763921b35d2ea3d00 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 16 Dec 2009 19:50:51 +0000 Subject: [PATCH] Initial band-aids on SDL_GetMouseState() API breakage. More work to come. Fixes Bugzilla #758. --- include/SDL_mouse.h | 2 +- src/SDL_compat.c | 2 +- src/events/SDL_mouse.c | 4 ++-- test/testalpha.c | 2 +- test/testgl.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/SDL_mouse.h b/include/SDL_mouse.h index 26f485182..388de9cc2 100644 --- a/include/SDL_mouse.h +++ b/include/SDL_mouse.h @@ -111,7 +111,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(int index); * 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 --git a/src/SDL_compat.c b/src/SDL_compat.c index 5e0f48744..1dcd35a55 100644 --- a/src/SDL_compat.c +++ b/src/SDL_compat.c @@ -285,7 +285,7 @@ SDL_CompatEventFilter(void *userdata, SDL_Event * event) } selected = SDL_SelectMouse(event->wheel.which); - SDL_GetMouseState(selected, &x, &y); + SDL_GetMouseState(&x, &y); SDL_SelectMouse(selected); if (event->wheel.y > 0) { diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index 25c3e9478..13ef7cadc 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -252,9 +252,9 @@ SDL_GetRelativeMouseMode(int index) } 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 --git a/test/testalpha.c b/test/testalpha.c index e48e0b227..fc3617b9a 100644 --- a/test/testalpha.c +++ b/test/testalpha.c @@ -291,7 +291,7 @@ MoveSprite(SDL_Surface * screen, SDL_Surface * light) if (light != NULL) { int x, y; - SDL_GetMouseState(0, &x, &y); + SDL_GetMouseState(&x, &y); FlashLight(screen, light, x, y); } diff --git a/test/testgl.c b/test/testgl.c index bf315fff7..ccdf48584 100644 --- a/test/testgl.c +++ b/test/testgl.c @@ -270,7 +270,7 @@ DrawLogoCursor(void) } /* Move the image around */ - SDL_GetMouseState(0, &x, &y); + SDL_GetMouseState(&x, &y); x -= w / 2; y -= h / 2;