aboutsummaryrefslogtreecommitdiff
path: root/backends/platform
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform')
-rw-r--r--backends/platform/iphone/iphone_video.h3
-rw-r--r--backends/platform/iphone/iphone_video.mm14
2 files changed, 10 insertions, 7 deletions
diff --git a/backends/platform/iphone/iphone_video.h b/backends/platform/iphone/iphone_video.h
index 55a4acb7c7..1405fe35f1 100644
--- a/backends/platform/iphone/iphone_video.h
+++ b/backends/platform/iphone/iphone_video.h
@@ -67,6 +67,9 @@
GLfloat _mouseScaleX, _mouseScaleY;
int _scaledShakeOffsetY;
+
+ UITouch *_firstTouch;
+ UITouch *_secondTouch;
}
- (id)initWithFrame:(struct CGRect)frame;
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;