[Commits] SDL: SDL_ResetMouse was using a bogus mouse button, causing a "<...

libsdl.org revision control commits-owner at libsdl.org
Wed May 31 21:39:22 PDT 2017


details:   https://hg.libsdl.org/SDL/rev/1138bf8c009a
changeset: 11056:1138bf8c009a
user:      Ryan C. Gordon <icculus at icculus.org>
date:      Thu Jun 01 00:39:07 2017 -0400
description:
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.

diffstat:

 src/events/SDL_mouse.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r f318f6a4882f -r 1138bf8c009a src/events/SDL_mouse.c
--- a/src/events/SDL_mouse.c	Mon Apr 03 13:33:29 2017 -0700
+++ b/src/events/SDL_mouse.c	Thu Jun 01 00:39:07 2017 -0400
@@ -62,7 +62,7 @@
 void SDL_ResetMouse(void)
 {
 	Uint8 i;
-	for ( i = 0; i < sizeof(SDL_ButtonState)*8; ++i ) {
+	for ( i = 1; i < sizeof(SDL_ButtonState)*8; ++i ) {
 		if ( SDL_ButtonState & SDL_BUTTON(i) ) {
 			SDL_PrivateMouseButton(SDL_RELEASED, i, 0, 0);
 		}


More information about the commits mailing list