Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Initial band-aids on SDL_GetMouseState() API breakage. More work to c…
Browse files Browse the repository at this point in the history
…ome.

 Fixes Bugzilla #758.
  • Loading branch information
icculus committed Dec 16, 2009
1 parent a202aef commit f0bc186
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/SDL_mouse.h
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/SDL_compat.c
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/events/SDL_mouse.c
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion test/testalpha.c
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion test/testgl.c
Expand Up @@ -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;

Expand Down

0 comments on commit f0bc186

Please sign in to comment.