src/events/SDL_mouse.c
branchgsoc2008_manymouse
changeset 3777 54d08ecec1cb
parent 3776 a9c2a7071874
child 3778 a9370b995ded
     1.1 --- a/src/events/SDL_mouse.c	Wed Aug 06 08:48:43 2008 +0000
     1.2 +++ b/src/events/SDL_mouse.c	Wed Aug 06 09:29:32 2008 +0000
     1.3 @@ -338,6 +338,7 @@
     1.4  SDL_SendProximity(int id, int x, int y, int type)
     1.5  {
     1.6      int index=SDL_GetIndexById(id);
     1.7 +    SDL_Mouse* mouse=SDL_GetMouse(index);
     1.8      int posted=0;
     1.9  	last_x=x;
    1.10  	last_y=y;
    1.11 @@ -347,23 +348,24 @@
    1.12          event.proximity.which=(Uint8)index;
    1.13          event.proximity.x=x;
    1.14          event.proximity.y=y;
    1.15 +        event.proximity.cursor=mouse->current_end;
    1.16          event.type=type;
    1.17          event.proximity.type=type;
    1.18          posted = (SDL_PushEvent(&event) > 0);
    1.19          if(type==SDL_PROXIMITYIN)
    1.20          {
    1.21 -            SDL_mice[index]->proximity=SDL_TRUE;
    1.22 +            mouse->proximity=SDL_TRUE;
    1.23          }
    1.24          else
    1.25          {
    1.26 -            SDL_mice[index]->proximity=SDL_FALSE;
    1.27 +            mouse->proximity=SDL_FALSE;
    1.28          }
    1.29      }
    1.30      return posted;
    1.31  }
    1.32  
    1.33  int
    1.34 -SDL_SendMouseMotion(int id, int relative, int x, int y,int z)
    1.35 +SDL_SendMouseMotion(int id, int relative, int x, int y,int pressure)
    1.36  {
    1.37      int index=SDL_GetIndexById(id);
    1.38      SDL_Mouse *mouse = SDL_GetMouse(index);
    1.39 @@ -440,7 +442,7 @@
    1.40      }
    1.41      mouse->xdelta += xrel;
    1.42      mouse->ydelta += yrel;
    1.43 -    mouse->pressure=z;
    1.44 +    mouse->pressure=pressure;
    1.45  
    1.46      /* Move the mouse cursor, if needed */
    1.47      if (mouse->cursor_shown && !mouse->relative_mode &&
    1.48 @@ -450,7 +452,8 @@
    1.49  
    1.50      /* Post the event, if desired */
    1.51      posted = 0;
    1.52 -    if (SDL_ProcessEvents[SDL_MOUSEMOTION] == SDL_ENABLE && SDL_mice[index]->proximity==SDL_TRUE) {
    1.53 +    if (SDL_ProcessEvents[SDL_MOUSEMOTION] == SDL_ENABLE && \
    1.54 +            mouse->proximity==SDL_TRUE) {
    1.55          SDL_Event event;
    1.56          event.motion.type = SDL_MOUSEMOTION;
    1.57  		event.motion.which = (Uint8) index;