src/video/cocoa/SDL_cocoawindow.m
changeset 6951 7833f01322b3
parent 6950 1ddb72193079
child 6953 b83579d7d19a
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Sat Mar 02 20:44:16 2013 -0800
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Sun Mar 03 01:01:33 2013 -0800
     1.3 @@ -408,27 +408,14 @@
     1.4      enumerator = [touches objectEnumerator];
     1.5      touch = (NSTouch*)[enumerator nextObject];
     1.6      while (touch) {
     1.7 -        const SDL_TouchID touchId = (SDL_TouchID) ((size_t) [touch device]);
     1.8 +        const SDL_TouchID touchId = (SDL_TouchID)[touch device];
     1.9          if (!SDL_GetTouch(touchId)) {
    1.10 -            SDL_Touch touch;
    1.11 -
    1.12 -            touch.id = touchId;
    1.13 -            touch.x_min = 0;
    1.14 -            touch.x_max = 1;
    1.15 -            touch.native_xres = touch.x_max - touch.x_min;
    1.16 -            touch.y_min = 0;
    1.17 -            touch.y_max = 1;
    1.18 -            touch.native_yres = touch.y_max - touch.y_min;
    1.19 -            touch.pressure_min = 0;
    1.20 -            touch.pressure_max = 1;
    1.21 -            touch.native_pressureres = touch.pressure_max - touch.pressure_min;
    1.22 -            
    1.23 -            if (SDL_AddTouch(&touch, "") < 0) {
    1.24 +            if (SDL_AddTouch(touchId, "") < 0) {
    1.25                  return;
    1.26              }
    1.27          } 
    1.28  
    1.29 -        const SDL_FingerID fingerId = (SDL_FingerID) ((size_t) [touch identity]);
    1.30 +        const SDL_FingerID fingerId = (SDL_FingerID)[touch identity];
    1.31          float x = [touch normalizedPosition].x;
    1.32          float y = [touch normalizedPosition].y;
    1.33          /* Make the origin the upper left instead of the lower left */
    1.34 @@ -436,17 +423,17 @@
    1.35  
    1.36          switch (type) {
    1.37          case COCOA_TOUCH_DOWN:
    1.38 -            SDL_SendFingerDown(touchId, fingerId, SDL_TRUE, x, y, 1);
    1.39 +            SDL_SendTouch(touchId, fingerId, SDL_TRUE, x, y, 1.0f);
    1.40              break;
    1.41          case COCOA_TOUCH_UP:
    1.42          case COCOA_TOUCH_CANCELLED:
    1.43 -            SDL_SendFingerDown(touchId, fingerId, SDL_FALSE, x, y, 1);
    1.44 +            SDL_SendTouch(touchId, fingerId, SDL_FALSE, x, y, 1.0f);
    1.45              break;
    1.46          case COCOA_TOUCH_MOVE:
    1.47 -            SDL_SendTouchMotion(touchId, fingerId, SDL_FALSE, x, y, 1);
    1.48 +            SDL_SendTouchMotion(touchId, fingerId, x, y, 1.0f);
    1.49              break;
    1.50          }
    1.51 -        
    1.52 +
    1.53          touch = (NSTouch*)[enumerator nextObject];
    1.54      }
    1.55  #endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 */