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 3585f8816ffa210b
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
     1.1 --- a/include/SDL_mouse.h	Wed Dec 16 16:42:04 2009 +0000
     1.2 +++ b/include/SDL_mouse.h	Wed Dec 16 19:50:51 2009 +0000
     1.3 @@ -111,7 +111,7 @@
     1.4   *  mouse cursor position relative to the focus window for the currently
     1.5   *  selected mouse.  You can pass NULL for either x or y.
     1.6   */
     1.7 -extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int index, int *x, int *y);
     1.8 +extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y);
     1.9  
    1.10  /**
    1.11   *  \brief Retrieve the state of the specified mouse.
     2.1 --- a/src/SDL_compat.c	Wed Dec 16 16:42:04 2009 +0000
     2.2 +++ b/src/SDL_compat.c	Wed Dec 16 19:50:51 2009 +0000
     2.3 @@ -285,7 +285,7 @@
     2.4              }
     2.5  
     2.6              selected = SDL_SelectMouse(event->wheel.which);
     2.7 -            SDL_GetMouseState(selected, &x, &y);
     2.8 +            SDL_GetMouseState(&x, &y);
     2.9              SDL_SelectMouse(selected);
    2.10  
    2.11              if (event->wheel.y > 0) {
     3.1 --- a/src/events/SDL_mouse.c	Wed Dec 16 16:42:04 2009 +0000
     3.2 +++ b/src/events/SDL_mouse.c	Wed Dec 16 19:50:51 2009 +0000
     3.3 @@ -252,9 +252,9 @@
     3.4  }
     3.5  
     3.6  Uint8
     3.7 -SDL_GetMouseState(int index, int *x, int *y)
     3.8 +SDL_GetMouseState(int *x, int *y)
     3.9  {
    3.10 -    SDL_Mouse *mouse = SDL_GetMouse(index);
    3.11 +    SDL_Mouse *mouse = SDL_GetMouse(SDL_current_mouse);
    3.12  
    3.13      if (!mouse) {
    3.14          if (x) {
     4.1 --- a/test/testalpha.c	Wed Dec 16 16:42:04 2009 +0000
     4.2 +++ b/test/testalpha.c	Wed Dec 16 19:50:51 2009 +0000
     4.3 @@ -291,7 +291,7 @@
     4.4      if (light != NULL) {
     4.5          int x, y;
     4.6  
     4.7 -        SDL_GetMouseState(0, &x, &y);
     4.8 +        SDL_GetMouseState(&x, &y);
     4.9          FlashLight(screen, light, x, y);
    4.10      }
    4.11  
     5.1 --- a/test/testgl.c	Wed Dec 16 16:42:04 2009 +0000
     5.2 +++ b/test/testgl.c	Wed Dec 16 19:50:51 2009 +0000
     5.3 @@ -270,7 +270,7 @@
     5.4      }
     5.5  
     5.6      /* Move the image around */
     5.7 -    SDL_GetMouseState(0, &x, &y);
     5.8 +    SDL_GetMouseState(&x, &y);
     5.9      x -= w / 2;
    5.10      y -= h / 2;
    5.11