comparison src/events/SDL_mouse.c @ 2727:76c2fc9696ea

Fixed crash when tablet isn't detected properly
author Sam Lantinga <slouken@libsdl.org>
date Tue, 26 Aug 2008 07:34:23 +0000
parents 6ce6d56b63bf
children f55c87ae336b
comparison
equal deleted inserted replaced
2726:f23ebf1ddac4 2727:76c2fc9696ea
372 SDL_SendProximity(int id, int x, int y, int type) 372 SDL_SendProximity(int id, int x, int y, int type)
373 { 373 {
374 int index = SDL_GetMouseIndexId(id); 374 int index = SDL_GetMouseIndexId(id);
375 SDL_Mouse *mouse = SDL_GetMouse(index); 375 SDL_Mouse *mouse = SDL_GetMouse(index);
376 int posted = 0; 376 int posted = 0;
377
378 if (!mouse) {
379 return 0;
380 }
381
377 last_x = x; 382 last_x = x;
378 last_y = y; 383 last_y = y;
379 if (SDL_ProcessEvents[type] == SDL_ENABLE) { 384 if (SDL_ProcessEvents[type] == SDL_ENABLE) {
380 SDL_Event event; 385 SDL_Event event;
381 event.proximity.which = (Uint8) index; 386 event.proximity.which = (Uint8) index;