# HG changeset patch # User Szymon Wilczek # Date 1218014972 0 # Node ID 54d08ecec1cbb8e05a441465647277b69c8a9e88 # Parent a9c2a7071874e230f8e4bcad0e528410bcf3dfad Sharpened code looks and a minor events upgrade diff -r a9c2a7071874 -r 54d08ecec1cb include/SDL_events.h --- a/include/SDL_events.h Wed Aug 06 08:48:43 2008 +0000 +++ b/include/SDL_events.h Wed Aug 06 09:29:32 2008 +0000 @@ -331,6 +331,7 @@ { Uint8 which; Uint8 type; + int cursor; int x; int y; } SDL_ProximityEvent; diff -r a9c2a7071874 -r 54d08ecec1cb src/events/SDL_mouse.c --- a/src/events/SDL_mouse.c Wed Aug 06 08:48:43 2008 +0000 +++ b/src/events/SDL_mouse.c Wed Aug 06 09:29:32 2008 +0000 @@ -338,6 +338,7 @@ SDL_SendProximity(int id, int x, int y, int type) { int index=SDL_GetIndexById(id); + SDL_Mouse* mouse=SDL_GetMouse(index); int posted=0; last_x=x; last_y=y; @@ -347,23 +348,24 @@ event.proximity.which=(Uint8)index; event.proximity.x=x; event.proximity.y=y; + event.proximity.cursor=mouse->current_end; event.type=type; event.proximity.type=type; posted = (SDL_PushEvent(&event) > 0); if(type==SDL_PROXIMITYIN) { - SDL_mice[index]->proximity=SDL_TRUE; + mouse->proximity=SDL_TRUE; } else { - SDL_mice[index]->proximity=SDL_FALSE; + mouse->proximity=SDL_FALSE; } } return posted; } int -SDL_SendMouseMotion(int id, int relative, int x, int y,int z) +SDL_SendMouseMotion(int id, int relative, int x, int y,int pressure) { int index=SDL_GetIndexById(id); SDL_Mouse *mouse = SDL_GetMouse(index); @@ -440,7 +442,7 @@ } mouse->xdelta += xrel; mouse->ydelta += yrel; - mouse->pressure=z; + mouse->pressure=pressure; /* Move the mouse cursor, if needed */ if (mouse->cursor_shown && !mouse->relative_mode && @@ -450,7 +452,8 @@ /* Post the event, if desired */ posted = 0; - if (SDL_ProcessEvents[SDL_MOUSEMOTION] == SDL_ENABLE && SDL_mice[index]->proximity==SDL_TRUE) { + if (SDL_ProcessEvents[SDL_MOUSEMOTION] == SDL_ENABLE && \ + mouse->proximity==SDL_TRUE) { SDL_Event event; event.motion.type = SDL_MOUSEMOTION; event.motion.which = (Uint8) index; diff -r a9c2a7071874 -r 54d08ecec1cb src/video/x11/SDL_x11mouse.c --- a/src/video/x11/SDL_x11mouse.c Wed Aug 06 08:48:43 2008 +0000 +++ b/src/video/x11/SDL_x11mouse.c Wed Aug 06 09:29:32 2008 +0000 @@ -59,7 +59,7 @@ if(!newDevices) { SDL_OutOfMemory(); - return -1; + return; } SDL_XDevices=newDevices; SDL_XDevices[index]=XOpenDevice(data->display,DevList[i].id);