From fae79955e5ce6e215dcf457059c5744a85c76a80 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Fri, 11 Dec 2015 15:25:48 +0100 Subject: IOS: Better emulation of the right mouse button --- backends/platform/ios7/ios7_osys_main.cpp | 9 +++------ backends/platform/ios7/ios7_video.mm | 10 ++++++++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/backends/platform/ios7/ios7_osys_main.cpp b/backends/platform/ios7/ios7_osys_main.cpp index cb712b9c38..cd62148ca9 100644 --- a/backends/platform/ios7/ios7_osys_main.cpp +++ b/backends/platform/ios7/ios7_osys_main.cpp @@ -28,6 +28,7 @@ #include #include +#include #include "common/scummsys.h" #include "common/util.h" @@ -196,12 +197,8 @@ void OSystem_iOS7::suspendLoop() { } uint32 OSystem_iOS7::getMillis(bool skipRecord) { - //printf("getMillis()\n"); - - struct timeval currentTime; - gettimeofday(¤tTime, NULL); - return (uint32)(((currentTime.tv_sec - _startTime.tv_sec) * 1000) + - ((currentTime.tv_usec - _startTime.tv_usec) / 1000)) - _timeSuspended; + CFTimeInterval timeInSeconds = CACurrentMediaTime(); + return (uint32) (timeInSeconds * 1000.0); } void OSystem_iOS7::delayMillis(uint msecs) { diff --git a/backends/platform/ios7/ios7_video.mm b/backends/platform/ios7/ios7_video.mm index 3a3feafcf8..e3c3edf06b 100644 --- a/backends/platform/ios7/ios7_video.mm +++ b/backends/platform/ios7/ios7_video.mm @@ -340,22 +340,32 @@ uint getSizeNextPOT(uint size) { UISwipeGestureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(twoFingersSwipeRight:)]; swipeRight.direction = UISwipeGestureRecognizerDirectionRight; swipeRight.numberOfTouchesRequired = 2; + swipeRight.delaysTouchesBegan = NO; + swipeRight.delaysTouchesEnded = NO; UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(twoFingersSwipeLeft:)]; swipeLeft.direction = UISwipeGestureRecognizerDirectionLeft; swipeLeft.numberOfTouchesRequired = 2; + swipeLeft.delaysTouchesBegan = NO; + swipeLeft.delaysTouchesEnded = NO; UISwipeGestureRecognizer *swipeUp = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(twoFingersSwipeUp:)]; swipeUp.direction = UISwipeGestureRecognizerDirectionUp; swipeUp.numberOfTouchesRequired = 2; + swipeUp.delaysTouchesBegan = NO; + swipeUp.delaysTouchesEnded = NO; UISwipeGestureRecognizer *swipeDown = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(twoFingersSwipeDown:)]; swipeDown.direction = UISwipeGestureRecognizerDirectionDown; swipeDown.numberOfTouchesRequired = 2; + swipeDown.delaysTouchesBegan = NO; + swipeDown.delaysTouchesEnded = NO; UITapGestureRecognizer *doubleTapTwoFingers = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(twoFingersDoubleTap:)]; doubleTapTwoFingers.numberOfTapsRequired = 2; doubleTapTwoFingers.numberOfTouchesRequired = 2; + doubleTapTwoFingers.delaysTouchesBegan = NO; + doubleTapTwoFingers.delaysTouchesEnded = NO; [self addGestureRecognizer:swipeRight]; [self addGestureRecognizer:swipeLeft]; -- cgit v1.2.3