src/events/SDL_mouse.c
branchgsoc2008_manymouse
changeset 3776 a9c2a7071874
parent 3774 8b5b67000dc0
child 3777 54d08ecec1cb
     1.1 --- a/src/events/SDL_mouse.c	Tue Aug 05 14:18:40 2008 +0000
     1.2 +++ b/src/events/SDL_mouse.c	Wed Aug 06 08:48:43 2008 +0000
     1.3 @@ -174,9 +174,9 @@
     1.4  }
     1.5  
     1.6  SDL_WindowID
     1.7 -SDL_GetMouseFocusWindow()
     1.8 +SDL_GetMouseFocusWindow(int index)
     1.9  {
    1.10 -    SDL_Mouse *mouse = SDL_GetMouse(SDL_current_mouse);
    1.11 +    SDL_Mouse *mouse = SDL_GetMouse(index);
    1.12  
    1.13      if (!mouse) {
    1.14          return 0;
    1.15 @@ -196,7 +196,7 @@
    1.16  }
    1.17  
    1.18  int
    1.19 -SDL_SetRelativeMouseMode(SDL_bool enabled, int index)
    1.20 +SDL_SetRelativeMouseMode(int index, SDL_bool enabled)
    1.21  {
    1.22      SDL_Mouse *mouse = SDL_GetMouse(index);
    1.23  
    1.24 @@ -224,9 +224,9 @@
    1.25  }
    1.26  
    1.27  SDL_bool
    1.28 -SDL_GetRelativeMouseMode()
    1.29 +SDL_GetRelativeMouseMode(int index)
    1.30  {
    1.31 -    SDL_Mouse *mouse = SDL_GetMouse(SDL_current_mouse);
    1.32 +    SDL_Mouse *mouse = SDL_GetMouse(index);
    1.33  
    1.34      if (!mouse) {
    1.35          return SDL_FALSE;
    1.36 @@ -235,9 +235,9 @@
    1.37  }
    1.38  
    1.39  Uint8
    1.40 -SDL_GetMouseState(int *x, int *y)
    1.41 +SDL_GetMouseState(int index, int *x, int *y)
    1.42  {
    1.43 -    SDL_Mouse *mouse = SDL_GetMouse(SDL_current_mouse);
    1.44 +    SDL_Mouse *mouse = SDL_GetMouse(index);
    1.45  
    1.46      if (!mouse) {
    1.47          if (x) {
    1.48 @@ -259,9 +259,9 @@
    1.49  }
    1.50  
    1.51  Uint8
    1.52 -SDL_GetRelativeMouseState(int *x, int *y)
    1.53 +SDL_GetRelativeMouseState(int index, int *x, int *y)
    1.54  {
    1.55 -    SDL_Mouse *mouse = SDL_GetMouse(SDL_current_mouse);
    1.56 +    SDL_Mouse *mouse = SDL_GetMouse(index);
    1.57  
    1.58      if (!mouse) {
    1.59          if (x) {
    1.60 @@ -494,10 +494,6 @@
    1.61          mouse->buttonstate |= SDL_BUTTON(button);
    1.62          break;
    1.63      case SDL_RELEASED:
    1.64 -        //if (!(mouse->buttonstate & SDL_BUTTON(button))) {
    1.65 -        //    /* Ignore this event, no state change */
    1.66 -        //    return 0;
    1.67 -        //}*/
    1.68          type = SDL_MOUSEBUTTONUP;
    1.69          mouse->buttonstate &= ~SDL_BUTTON(button);
    1.70          break;
    1.71 @@ -809,15 +805,22 @@
    1.72  
    1.73  int SDL_GetCursorsNumber(int index)
    1.74  {
    1.75 -	if(index>=SDL_num_mice)
    1.76 -	{
    1.77 -		return -1;
    1.78 -	}
    1.79 -	if(SDL_mice[index]==NULL)
    1.80 -	{
    1.81 -		return -1;
    1.82 -	}
    1.83 -	return SDL_mice[index]->total_ends;
    1.84 +	SDL_Mouse* mouse = SDL_GetMouse(index);
    1.85 +    if(!mouse)
    1.86 +    {
    1.87 +        return -1;
    1.88 +    }
    1.89 +	return mouse->total_ends;
    1.90 +}
    1.91 +
    1.92 +int SDL_GetCurrentCursor(int index)
    1.93 +{
    1.94 +    SDL_Mouse* mouse = SDL_GetMouse(index);
    1.95 +    if(!mouse)
    1.96 +    {
    1.97 +        return -1;
    1.98 +    }
    1.99 +    return mouse->current_end;
   1.100  }
   1.101  /* vi: set ts=4 sw=4 expandtab: */
   1.102