From 323899d70baaf76a9ad51713f9c0f36f5c8d3def Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 5 Mar 2012 20:46:45 +0100 Subject: IPOHNE: Move touch related global variables to iPhoneView. --- backends/platform/iphone/iphone_video.mm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'backends/platform/iphone/iphone_video.mm') diff --git a/backends/platform/iphone/iphone_video.mm b/backends/platform/iphone/iphone_video.mm index 1c86a208b8..5b8d28e819 100644 --- a/backends/platform/iphone/iphone_video.mm +++ b/backends/platform/iphone/iphone_video.mm @@ -33,9 +33,6 @@ static int g_fullHeight; static int g_needsScreenUpdate = 0; -static UITouch *g_firstTouch = NULL; -static UITouch *g_secondTouch = NULL; - #if 0 static long g_lastTick = 0; static int g_frames = 0; @@ -197,6 +194,9 @@ const char *iPhone_getDocumentsDir() { _scaledShakeOffsetY = 0; + _firstTouch = NULL; + _secondTouch = NULL; + _gameScreenVertCoords[0] = _gameScreenVertCoords[1] = _gameScreenVertCoords[2] = _gameScreenVertCoords[3] = _gameScreenVertCoords[4] = _gameScreenVertCoords[5] = @@ -685,7 +685,7 @@ const char *iPhone_getDocumentsDir() { if (![self getMouseCoords:point eventX:&x eventY:&y]) return; - g_firstTouch = touch; + _firstTouch = touch; [self addEvent: [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt:kInputMouseDown], @"type", @@ -703,7 +703,7 @@ const char *iPhone_getDocumentsDir() { if (![self getMouseCoords:point eventX:&x eventY:&y]) return; - g_secondTouch = touch; + _secondTouch = touch; [self addEvent: [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt:kInputMouseSecondDown], @"type", @@ -722,7 +722,7 @@ const char *iPhone_getDocumentsDir() { int x, y; for (UITouch *touch in touches) { - if (touch == g_firstTouch) { + if (touch == _firstTouch) { CGPoint point = [touch locationInView:self]; if (![self getMouseCoords:point eventX:&x eventY:&y]) return; @@ -735,7 +735,7 @@ const char *iPhone_getDocumentsDir() { nil ] ]; - } else if (touch == g_secondTouch) { + } else if (touch == _secondTouch) { CGPoint point = [touch locationInView:self]; if (![self getMouseCoords:point eventX:&x eventY:&y]) return; -- cgit v1.2.3