diff options
author | Vincent Bénony | 2015-12-07 14:12:16 +0100 |
---|---|---|
committer | Vincent Bénony | 2016-01-06 16:17:35 +0100 |
commit | e9378ccf3e07fc564daafd5099f95439d7b612a3 (patch) | |
tree | 2e5e264800cebb7653d8719273aabffedff45324 /backends/platform/ios7/ios7_osys_events.cpp | |
parent | 5b15f06b9299a27be5df028855ee6b592361bdf3 (diff) | |
download | scummvm-rg350-e9378ccf3e07fc564daafd5099f95439d7b612a3.tar.gz scummvm-rg350-e9378ccf3e07fc564daafd5099f95439d7b612a3.tar.bz2 scummvm-rg350-e9378ccf3e07fc564daafd5099f95439d7b612a3.zip |
IOS: Avoid subclassing UIApplication, and handle multitasking
Diffstat (limited to 'backends/platform/ios7/ios7_osys_events.cpp')
-rw-r--r-- | backends/platform/ios7/ios7_osys_events.cpp | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/backends/platform/ios7/ios7_osys_events.cpp b/backends/platform/ios7/ios7_osys_events.cpp index da44983b03..7e805f34b7 100644 --- a/backends/platform/ios7/ios7_osys_events.cpp +++ b/backends/platform/ios7/ios7_osys_events.cpp @@ -68,12 +68,14 @@ bool OSystem_iOS7::pollEvent(Common::Event &event) { case kInputOrientationChanged: handleEvent_orientationChanged(internalEvent.value1); return false; - break; case kInputApplicationSuspended: - suspendLoop(); + handleEvent_applicationSuspended(); + return false; + + case kInputApplicationResumed: + handleEvent_applicationResumed(); return false; - break; case kInputMouseSecondDragged: if (!handleEvent_mouseSecondDragged(event, internalEvent.value1, internalEvent.value2)) @@ -353,16 +355,28 @@ void OSystem_iOS7::handleEvent_orientationChanged(int orientation) { return; } - if (_screenOrientation != newOrientation) { _screenOrientation = newOrientation; - updateOutputSurface(); + rebuildSurface(); + } +} - dirtyFullScreen(); - if (_videoContext->overlayVisible) +void OSystem_iOS7::rebuildSurface() { + updateOutputSurface(); + + dirtyFullScreen(); + if (_videoContext->overlayVisible) { dirtyFullOverlayScreen(); - updateScreen(); - } + } + updateScreen(); +} + +void OSystem_iOS7::handleEvent_applicationSuspended() { + suspendLoop(); +} + +void OSystem_iOS7::handleEvent_applicationResumed() { + rebuildSurface(); } void OSystem_iOS7::handleEvent_keyPressed(Common::Event &event, int keyPressed) { |