SDL_ResetMouse was using a bogus mouse button, causing a "<< -1" shift. SDL-1.2
authorRyan C. Gordon <icculus@icculus.org>
Thu, 01 Jun 2017 00:39:07 -0400
branchSDL-1.2
changeset 110561138bf8c009a
parent 10962 f318f6a4882f
child 11362 464908ca2d22
SDL_ResetMouse was using a bogus mouse button, causing a "<< -1" shift.

Note that we got rid of SDL_ResetMouse() entirely for SDL 2.0, but for 1.2,
this is a small fix that doesn't otherwise alter behavior in any serious way.

Fixes Bugzilla #3593.
src/events/SDL_mouse.c
     1.1 --- a/src/events/SDL_mouse.c	Mon Apr 03 13:33:29 2017 -0700
     1.2 +++ b/src/events/SDL_mouse.c	Thu Jun 01 00:39:07 2017 -0400
     1.3 @@ -62,7 +62,7 @@
     1.4  void SDL_ResetMouse(void)
     1.5  {
     1.6  	Uint8 i;
     1.7 -	for ( i = 0; i < sizeof(SDL_ButtonState)*8; ++i ) {
     1.8 +	for ( i = 1; i < sizeof(SDL_ButtonState)*8; ++i ) {
     1.9  		if ( SDL_ButtonState & SDL_BUTTON(i) ) {
    1.10  			SDL_PrivateMouseButton(SDL_RELEASED, i, 0, 0);
    1.11  		}