aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/iphone
diff options
context:
space:
mode:
authorJohannes Schickel2012-03-05 20:46:45 +0100
committerJohannes Schickel2012-03-05 20:46:45 +0100
commit323899d70baaf76a9ad51713f9c0f36f5c8d3def (patch)
tree90379e49100d4e3441edfc4be22ba8e412d14d24 /backends/platform/iphone
parentdec6082590a16e1b440f66a78724521cc85c6cf4 (diff)
downloadscummvm-rg350-323899d70baaf76a9ad51713f9c0f36f5c8d3def.tar.gz
scummvm-rg350-323899d70baaf76a9ad51713f9c0f36f5c8d3def.tar.bz2
scummvm-rg350-323899d70baaf76a9ad51713f9c0f36f5c8d3def.zip
IPOHNE: Move touch related global variables to iPhoneView.
Diffstat (limited to 'backends/platform/iphone')
-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;