diff options
Diffstat (limited to 'backends/platform/iphone')
-rw-r--r-- | backends/platform/iphone/blit.cpp | 3 | ||||
-rw-r--r-- | backends/platform/iphone/blit_arm.h | 3 | ||||
-rw-r--r-- | backends/platform/iphone/blit_arm.s | 3 | ||||
-rw-r--r-- | backends/platform/iphone/iphone_common.h | 3 | ||||
-rw-r--r-- | backends/platform/iphone/iphone_keyboard.h | 3 | ||||
-rw-r--r-- | backends/platform/iphone/iphone_keyboard.m | 3 | ||||
-rw-r--r-- | backends/platform/iphone/iphone_main.m | 3 | ||||
-rw-r--r-- | backends/platform/iphone/iphone_video.h | 3 | ||||
-rw-r--r-- | backends/platform/iphone/iphone_video.m | 20 | ||||
-rw-r--r-- | backends/platform/iphone/osys_events.cpp | 25 | ||||
-rw-r--r-- | backends/platform/iphone/osys_main.cpp | 9 | ||||
-rw-r--r-- | backends/platform/iphone/osys_main.h | 5 | ||||
-rw-r--r-- | backends/platform/iphone/osys_sound.cpp | 3 | ||||
-rw-r--r-- | backends/platform/iphone/osys_video.cpp | 3 |
14 files changed, 23 insertions, 66 deletions
diff --git a/backends/platform/iphone/blit.cpp b/backends/platform/iphone/blit.cpp index c28f931983..58de22bf75 100644 --- a/backends/platform/iphone/blit.cpp +++ b/backends/platform/iphone/blit.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/backends/platform/iphone/blit_arm.h b/backends/platform/iphone/blit_arm.h index 2a363630d8..77bb3578ab 100644 --- a/backends/platform/iphone/blit_arm.h +++ b/backends/platform/iphone/blit_arm.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ extern "C" void blitLandscapeScreenRect16bpp(uint16 *dst, uint16 *src, diff --git a/backends/platform/iphone/blit_arm.s b/backends/platform/iphone/blit_arm.s index 417f3741cf..04f9a87614 100644 --- a/backends/platform/iphone/blit_arm.s +++ b/backends/platform/iphone/blit_arm.s @@ -18,9 +18,6 @@ @ along with this program@ if not, write to the Free Software @ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @ -@ $URL$ -@ $Id$ -@ @ @author Robin Watts (robin@wss.co.uk) .text diff --git a/backends/platform/iphone/iphone_common.h b/backends/platform/iphone/iphone_common.h index 7c7770f443..0cbcb77bcb 100644 --- a/backends/platform/iphone/iphone_common.h +++ b/backends/platform/iphone/iphone_common.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ diff --git a/backends/platform/iphone/iphone_keyboard.h b/backends/platform/iphone/iphone_keyboard.h index 5c17cc34b8..eecad09398 100644 --- a/backends/platform/iphone/iphone_keyboard.h +++ b/backends/platform/iphone/iphone_keyboard.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #import <UIKit/UIKit.h> diff --git a/backends/platform/iphone/iphone_keyboard.m b/backends/platform/iphone/iphone_keyboard.m index 53c7376745..1624d02977 100644 --- a/backends/platform/iphone/iphone_keyboard.m +++ b/backends/platform/iphone/iphone_keyboard.m @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #import "iphone_keyboard.h" diff --git a/backends/platform/iphone/iphone_main.m b/backends/platform/iphone/iphone_main.m index 1fb2cc3788..7bb5f0c317 100644 --- a/backends/platform/iphone/iphone_main.m +++ b/backends/platform/iphone/iphone_main.m @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #import <UIKit/UIKit.h> diff --git a/backends/platform/iphone/iphone_video.h b/backends/platform/iphone/iphone_video.h index aed15ecfd5..8e0ffc19cb 100644 --- a/backends/platform/iphone/iphone_video.h +++ b/backends/platform/iphone/iphone_video.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef _IPHONE_VIDEO__H diff --git a/backends/platform/iphone/iphone_video.m b/backends/platform/iphone/iphone_video.m index 821d3de634..006603df64 100644 --- a/backends/platform/iphone/iphone_video.m +++ b/backends/platform/iphone/iphone_video.m @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "iphone_video.h" @@ -178,13 +175,18 @@ const char* iPhone_getDocumentsDir() { } bool getLocalMouseCoords(CGPoint *point) { - if (point->x < _screenRect.origin.x || point->x >= _screenRect.origin.x + _screenRect.size.width || - point->y < _screenRect.origin.y || point->y >= _screenRect.origin.y + _screenRect.size.height) { - return false; - } + if (_overlayIsEnabled) { + point->x = point->x / _overlayHeight; + point->y = point->y / _overlayWidth; + } else { + if (point->x < _screenRect.origin.x || point->x >= _screenRect.origin.x + _screenRect.size.width || + point->y < _screenRect.origin.y || point->y >= _screenRect.origin.y + _screenRect.size.height) { + return false; + } - point->x = (point->x - _screenRect.origin.x) / _screenRect.size.width; - point->y = (point->y - _screenRect.origin.y) / _screenRect.size.height; + point->x = (point->x - _screenRect.origin.x) / _screenRect.size.width; + point->y = (point->y - _screenRect.origin.y) / _screenRect.size.height; + } return true; } diff --git a/backends/platform/iphone/osys_events.cpp b/backends/platform/iphone/osys_events.cpp index c30e34dd05..6e2a4b7e1e 100644 --- a/backends/platform/iphone/osys_events.cpp +++ b/backends/platform/iphone/osys_events.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. @@ -31,6 +28,7 @@ #include "osys_main.h" +static const int kQueuedInputEventDelay = 50; bool OSystem_IPHONE::pollEvent(Common::Event &event) { //printf("pollEvent()\n"); @@ -42,14 +40,7 @@ bool OSystem_IPHONE::pollEvent(Common::Event &event) { _timerCallbackNext = curTime + _timerCallbackTimer; } - if (_needEventRestPeriod) { - // Workaround: Some engines can't handle mouse-down and mouse-up events - // appearing right after each other, without a call returning no input in between. - _needEventRestPeriod = false; - return false; - } - - if (_queuedInputEvent.type != (Common::EventType)0) { + if (_queuedInputEvent.type != (Common::EventType)0 && curTime >= _queuedEventTime) { event = _queuedInputEvent; _queuedInputEvent.type = (Common::EventType)0; return true; @@ -194,7 +185,7 @@ bool OSystem_IPHONE::handleEvent_mouseUp(Common::Event &event, int x, int y) { _queuedInputEvent.mouse.x = _mouseX; _queuedInputEvent.mouse.y = _mouseY; _lastMouseTap = getMillis(); - _needEventRestPeriod = true; + _queuedEventTime = _lastMouseTap + kQueuedInputEventDelay; } else return false; } @@ -235,7 +226,7 @@ bool OSystem_IPHONE::handleEvent_secondMouseUp(Common::Event &event, int x, int event.kbd.flags = _queuedInputEvent.kbd.flags = 0; event.kbd.keycode = _queuedInputEvent.kbd.keycode = Common::KEYCODE_ESCAPE; event.kbd.ascii = _queuedInputEvent.kbd.ascii = Common::ASCII_ESCAPE; - _needEventRestPeriod = true; + _queuedEventTime = curTime + kQueuedInputEventDelay; _lastSecondaryTap = 0; } else if (!_mouseClickAndDragEnabled) { //printf("Rightclick!\n"); @@ -246,7 +237,7 @@ bool OSystem_IPHONE::handleEvent_secondMouseUp(Common::Event &event, int x, int _queuedInputEvent.mouse.x = _mouseX; _queuedInputEvent.mouse.y = _mouseY; _lastSecondaryTap = curTime; - _needEventRestPeriod = true; + _queuedEventTime = curTime + kQueuedInputEventDelay; } else { //printf("Right nothing!\n"); return false; @@ -334,7 +325,7 @@ bool OSystem_IPHONE::handleEvent_mouseSecondDragged(Common::Event &event, int x, event.kbd.flags = _queuedInputEvent.kbd.flags = 0; event.kbd.keycode = _queuedInputEvent.kbd.keycode = Common::KEYCODE_F5; event.kbd.ascii = _queuedInputEvent.kbd.ascii = Common::ASCII_F5; - _needEventRestPeriod = true; + _queuedEventTime = getMillis() + kQueuedInputEventDelay; return true; } @@ -463,7 +454,7 @@ void OSystem_IPHONE::handleEvent_keyPressed(Common::Event &event, int keyPresse event.kbd.flags = _queuedInputEvent.kbd.flags = 0; event.kbd.keycode = _queuedInputEvent.kbd.keycode = (Common::KeyCode)keyPressed; event.kbd.ascii = _queuedInputEvent.kbd.ascii = ascii; - _needEventRestPeriod = true; + _queuedEventTime = getMillis() + kQueuedInputEventDelay; } bool OSystem_IPHONE::handleEvent_swipe(Common::Event &event, int direction) { @@ -530,7 +521,7 @@ bool OSystem_IPHONE::handleEvent_swipe(Common::Event &event, int direction) { event.type = Common::EVENT_KEYDOWN; _queuedInputEvent.type = Common::EVENT_KEYUP; event.kbd.flags = _queuedInputEvent.kbd.flags = 0; - _needEventRestPeriod = true; + _queuedEventTime = getMillis() + kQueuedInputEventDelay; return true; } diff --git a/backends/platform/iphone/osys_main.cpp b/backends/platform/iphone/osys_main.cpp index 813adfbc43..12317ad935 100644 --- a/backends/platform/iphone/osys_main.cpp +++ b/backends/platform/iphone/osys_main.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. @@ -58,9 +55,9 @@ void *OSystem_IPHONE::s_soundParam = NULL; OSystem_IPHONE::OSystem_IPHONE() : _savefile(NULL), _mixer(NULL), _timer(NULL), _offscreen(NULL), _overlayVisible(false), _fullscreen(NULL), - _mouseHeight(0), _mouseWidth(0), _mouseBuf(NULL), _lastMouseTap(0), - _secondaryTapped(false), _lastSecondaryTap(0), _screenOrientation(kScreenOrientationFlippedLandscape), - _needEventRestPeriod(false), _mouseClickAndDragEnabled(false), + _mouseHeight(0), _mouseWidth(0), _mouseBuf(NULL), _lastMouseTap(0), _queuedEventTime(0), + _secondaryTapped(false), _lastSecondaryTap(0), + _screenOrientation(kScreenOrientationFlippedLandscape), _mouseClickAndDragEnabled(false), _gestureStartX(-1), _gestureStartY(-1), _fullScreenIsDirty(false), _fullScreenOverlayIsDirty(false), _mouseDirty(false), _timeSuspended(0), _lastDragPosX(-1), _lastDragPosY(-1), _screenChangeCount(0), _overlayHeight(0), _overlayWidth(0), _overlayBuffer(0) diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h index 79f596632f..1ff87967a1 100644 --- a/backends/platform/iphone/osys_main.h +++ b/backends/platform/iphone/osys_main.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "graphics/surface.h" @@ -89,9 +86,9 @@ protected: bool _mouseDirty; long _lastMouseDown; long _lastMouseTap; + long _queuedEventTime; Common::Rect _lastDrawnMouseRect; Common::Event _queuedInputEvent; - bool _needEventRestPeriod; bool _secondaryTapped; long _lastSecondaryDown; long _lastSecondaryTap; diff --git a/backends/platform/iphone/osys_sound.cpp b/backends/platform/iphone/osys_sound.cpp index cd364f57ac..405543e380 100644 --- a/backends/platform/iphone/osys_sound.cpp +++ b/backends/platform/iphone/osys_sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. diff --git a/backends/platform/iphone/osys_video.cpp b/backends/platform/iphone/osys_video.cpp index a10efeff40..263cbd2bcc 100644 --- a/backends/platform/iphone/osys_video.cpp +++ b/backends/platform/iphone/osys_video.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ // Disable symbol overrides so that we can use system headers. |