From 90649938d2d70115967c45cdd1cbb8dab1635794 Mon Sep 17 00:00:00 2001 From: Oystein Eftevaag Date: Thu, 3 Jun 2010 03:22:10 +0000 Subject: We'll now default to non-touchpad mode on the iPad svn-id: r49403 --- backends/platform/iphone/iphone_common.h | 1 + backends/platform/iphone/iphone_video.h | 2 -- backends/platform/iphone/iphone_video.m | 6 ++++++ backends/platform/iphone/osys_main.cpp | 3 ++- 4 files changed, 9 insertions(+), 3 deletions(-) (limited to 'backends/platform') diff --git a/backends/platform/iphone/iphone_common.h b/backends/platform/iphone/iphone_common.h index 9f7e3e808f..1f5ed01982 100644 --- a/backends/platform/iphone/iphone_common.h +++ b/backends/platform/iphone/iphone_common.h @@ -72,6 +72,7 @@ void iPhone_updateScreenRect(unsigned short* screen, int x1, int y1, int x2, int void iPhone_initSurface(int width, int height); bool iPhone_fetchEvent(int *outEvent, float *outX, float *outY); const char* iPhone_getDocumentsDir(); +bool iPhone_isHighResDevice(); #ifdef __cplusplus } diff --git a/backends/platform/iphone/iphone_video.h b/backends/platform/iphone/iphone_video.h index daa5e1d18e..1060a2a223 100644 --- a/backends/platform/iphone/iphone_video.h +++ b/backends/platform/iphone/iphone_video.h @@ -43,8 +43,6 @@ SoftKeyboard* _keyboardView; CALayer* _screenLayer; - int _fullWidth; - int _fullHeight; int _widthOffset; int _heightOffset; diff --git a/backends/platform/iphone/iphone_video.m b/backends/platform/iphone/iphone_video.m index e8977be2f2..faa0719b6c 100644 --- a/backends/platform/iphone/iphone_video.m +++ b/backends/platform/iphone/iphone_video.m @@ -29,6 +29,8 @@ static iPhoneView *sharedInstance = nil; static int _width = 0; static int _height = 0; +static int _fullWidth; +static int _fullHeight; static CGRect _screenRect; static char* _textureBuffer = 0; static int _textureWidth = 0; @@ -42,6 +44,10 @@ static UITouch* _secondTouch = NULL; // static long lastTick = 0; // static int frames = 0; +bool iPhone_isHighResDevice() { + return _fullHeight > 480; +} + void iPhone_updateScreen() { if (!_needsScreenUpdate) { _needsScreenUpdate = 1; diff --git a/backends/platform/iphone/osys_main.cpp b/backends/platform/iphone/osys_main.cpp index b151688e4e..6c26b6ca8d 100644 --- a/backends/platform/iphone/osys_main.cpp +++ b/backends/platform/iphone/osys_main.cpp @@ -57,7 +57,7 @@ OSystem_IPHONE::OSystem_IPHONE() : _overlayVisible(false), _overlayBuffer(NULL), _fullscreen(NULL), _mouseHeight(0), _mouseWidth(0), _mouseBuf(NULL), _lastMouseTap(0), _secondaryTapped(false), _lastSecondaryTap(0), _screenOrientation(kScreenOrientationFlippedLandscape), - _needEventRestPeriod(false), _mouseClickAndDragEnabled(false), _touchpadModeEnabled(true), + _needEventRestPeriod(false), _mouseClickAndDragEnabled(false), _gestureStartX(-1), _gestureStartY(-1), _fullScreenIsDirty(false), _fullScreenOverlayIsDirty(false), _mouseDirty(false), _timeSuspended(0), _lastDragPosX(-1), _lastDragPosY(-1), _screenChangeCount(0) @@ -65,6 +65,7 @@ OSystem_IPHONE::OSystem_IPHONE() : _queuedInputEvent.type = (Common::EventType)0; _lastDrawnMouseRect = Common::Rect(0, 0, 0, 0); + _touchpadModeEnabled = !iPhone_isHighResDevice(); _fsFactory = new POSIXFilesystemFactory(); } -- cgit v1.2.3