1. Christian Fischer
  2. wiesel

Commits

Christian Fischer  committed 040825b

first touch index should be zero on all platforms

  • Participants
  • Parent commits e169ef0
  • Branches default

Comments (0)

Files changed (2)

File src/sdl/wiesel/sdl/video/sdl_video_driver.cpp

View file
  • Ignore whitespace
 	switch(event.type) {
 		case SDL_MOUSEBUTTONDOWN: {
 			vector2d location = convertScreenToWorld(vector2d(event.button.x, event.button.y));
-			getScreen()->getTouchHandler()->startTouch(event.button.button, location.x, location.y);
+			getScreen()->getTouchHandler()->startTouch(event.button.button - 1, location.x, location.y);
 			break;
 		}
 
 		case SDL_MOUSEMOTION: {
 			vector2d location = convertScreenToWorld(vector2d(event.motion.x, event.motion.y));
 
-			for(int button=0; button<5; button++) {
-				getScreen()->getTouchHandler()->updateTouchLocation(button, location.x, location.y);
+			for(int button=1; button<=5; button++) {
+				getScreen()->getTouchHandler()->updateTouchLocation(button - 1, location.x, location.y);
 			}
 
 			break;
 		}
 
 		case SDL_MOUSEBUTTONUP: {
-			getScreen()->getTouchHandler()->releaseTouch(event.button.button);
+			getScreen()->getTouchHandler()->releaseTouch(event.button.button - 1);
 			break;
 		}
 	}

File src/sdl2/wiesel/sdl2/video/sdl2_video_driver.cpp

View file
  • Ignore whitespace
 	switch(event.type) {
 		case SDL_MOUSEBUTTONDOWN: {
 			vector2d location = convertScreenToWorld(vector2d(event.button.x, event.button.y));
-			getScreen()->getTouchHandler()->startTouch(event.button.button, location.x, location.y);
+			getScreen()->getTouchHandler()->startTouch(event.button.button - 1, location.x, location.y);
 			break;
 		}
 
 		case SDL_MOUSEMOTION: {
 			vector2d location = convertScreenToWorld(vector2d(event.motion.x, event.motion.y));
 
-			for(int button=0; button<5; button++) {
-				getScreen()->getTouchHandler()->updateTouchLocation(button, location.x, location.y);
+			for(int button=1; button<=5; button++) {
+				getScreen()->getTouchHandler()->updateTouchLocation(button - 1, location.x, location.y);
 			}
 
 			break;
 		}
 
 		case SDL_MOUSEBUTTONUP: {
-			getScreen()->getTouchHandler()->releaseTouch(event.button.button);
+			getScreen()->getTouchHandler()->releaseTouch(event.button.button - 1);
 			break;
 		}
 	}