Navigation Menu

Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed compiler warnings. "leftFingerDown" doesn't need to be an SDL_F…
Browse files Browse the repository at this point in the history
…ingerID.
  • Loading branch information
icculus committed Apr 3, 2013
1 parent bde4399 commit 2c85502
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/video/uikit/SDL_uikitview.h
Expand Up @@ -37,7 +37,7 @@
#endif

SDL_TouchID touchId;
SDL_FingerID leftFingerDown;
UITouch *leftFingerDown;
#ifndef IPHONE_TOUCH_EFFICIENT_DANGEROUS
UITouch *finger[MAX_SIMULTANEOUS_TOUCHES];
#endif
Expand Down
10 changes: 5 additions & 5 deletions src/video/uikit/SDL_uikitview.m
Expand Up @@ -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;
Expand All @@ -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];
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 2c85502

Please sign in to comment.