comparison src/events/SDL_mouse.c @ 2718:abacf2555bb4

Removed unneccesary code lines. Fixed mousename bug. Added lacking code in mousebutton
author Szymon Wilczek <kazeuser@gmail.com>
date Mon, 25 Aug 2008 18:02:14 +0000
parents c4e697245676
children 6ce6d56b63bf
comparison
equal deleted inserted replaced
2717:50bc882455e5 2718:abacf2555bb4
114 *SDL_mice[index] = *mouse; 114 *SDL_mice[index] = *mouse;
115 115
116 /* we're setting the mouse properties */ 116 /* we're setting the mouse properties */
117 length = 0; 117 length = 0;
118 length = SDL_strlen(name); 118 length = SDL_strlen(name);
119 SDL_mice[index]->name = SDL_malloc((length + 1) * sizeof(char)); 119 SDL_mice[index]->name = SDL_malloc((length + 2) * sizeof(char));
120 SDL_strlcpy(SDL_mice[index]->name, name, length); 120 SDL_strlcpy(SDL_mice[index]->name, name, length+1);
121 SDL_mice[index]->pressure_max = pressure_max; 121 SDL_mice[index]->pressure_max = pressure_max;
122 SDL_mice[index]->pressure_min = pressure_min; 122 SDL_mice[index]->pressure_min = pressure_min;
123 SDL_mice[index]->cursor_shown = SDL_TRUE; 123 SDL_mice[index]->cursor_shown = SDL_TRUE;
124 selected_mouse = SDL_SelectMouse(index); 124 selected_mouse = SDL_SelectMouse(index);
125 SDL_mice[index]->cur_cursor = NULL; 125 SDL_mice[index]->cur_cursor = NULL;
510 } 510 }
511 type = SDL_MOUSEBUTTONDOWN; 511 type = SDL_MOUSEBUTTONDOWN;
512 mouse->buttonstate |= SDL_BUTTON(button); 512 mouse->buttonstate |= SDL_BUTTON(button);
513 break; 513 break;
514 case SDL_RELEASED: 514 case SDL_RELEASED:
515 if(!(mouse->buttonstate & SDL_BUTTON(button))) {
516 /* Ignore this event, no state change */
517 return 0;
518 }
515 type = SDL_MOUSEBUTTONUP; 519 type = SDL_MOUSEBUTTONUP;
516 mouse->buttonstate &= ~SDL_BUTTON(button); 520 mouse->buttonstate &= ~SDL_BUTTON(button);
517 break; 521 break;
518 default: 522 default:
519 /* Invalid state -- bail */ 523 /* Invalid state -- bail */