Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fixed compiler warnings. "leftFingerDown" doesn't need to be an SDL_F…

…ingerID.
  • Loading branch information
icculus committed Apr 3, 2013
1 parent bde4399 commit 2c85502ccb26bff62531cb96d78acd9003d3cd0b
Showing with 6 additions and 6 deletions.
  1. +1 −1 src/video/uikit/SDL_uikitview.h
  2. +5 −5 src/video/uikit/SDL_uikitview.m
@@ -37,7 +37,7 @@
#endif

SDL_TouchID touchId;
SDL_FingerID leftFingerDown;
UITouch *leftFingerDown;
#ifndef IPHONE_TOUCH_EFFICIENT_DANGEROUS
UITouch *finger[MAX_SIMULTANEOUS_TOUCHES];
#endif
@@ -94,15 +94,15 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
/* send mouse down event */
SDL_SendMouseButton(NULL, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT);

leftFingerDown = (SDL_FingerID)touch;
leftFingerDown = touch;
}

CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
#ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS
// FIXME: TODO: Using touch as the fingerId is potentially dangerous
// It is also much more efficient than storing the UITouch pointer
// and comparing it to the incoming event.
SDL_SendTouch(touchId, (SDL_FingerID)touch,
SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch),
SDL_TRUE, locationInView.x, locationInView.y, 1.0f);
#else
int i;
@@ -125,10 +125,10 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
UITouch *touch = (UITouch*)[enumerator nextObject];

while(touch) {
if ((SDL_FingerID)touch == leftFingerDown) {
if (touch == leftFingerDown) {
/* send mouse up */
SDL_SendMouseButton(NULL, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT);
leftFingerDown = 0;
leftFingerDown = nil;
}

CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
@@ -166,7 +166,7 @@ - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
UITouch *touch = (UITouch*)[enumerator nextObject];

while (touch) {
if ((SDL_FingerID)touch == leftFingerDown) {
if (touch == leftFingerDown) {
CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];

/* send moved event */

0 comments on commit 2c85502

Please sign in to comment.