diff options
author | Eugene Sandulenko | 2016-11-12 12:20:17 +0100 |
---|---|---|
committer | GitHub | 2016-11-12 12:20:17 +0100 |
commit | 6da591df88181a0edfc88973e959acb4abb6b856 (patch) | |
tree | 7b9c601f0fc6b60107fd6a1b5cc711349e675fdc /backends/platform | |
parent | 915c6bff2ef21fe791be8df6e0b1932213335f75 (diff) | |
parent | 4a9446490af0b8018b4999c8fa11a6d5ec4ea980 (diff) | |
download | scummvm-rg350-6da591df88181a0edfc88973e959acb4abb6b856.tar.gz scummvm-rg350-6da591df88181a0edfc88973e959acb4abb6b856.tar.bz2 scummvm-rg350-6da591df88181a0edfc88973e959acb4abb6b856.zip |
Merge pull request #853 from criezy/ios-no-sleep
IOS: Disable idle timer while an engine is running
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/ios7/ios7_osys_main.h | 3 | ||||
-rw-r--r-- | backends/platform/ios7/ios7_osys_video.mm | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/backends/platform/ios7/ios7_osys_main.h b/backends/platform/ios7/ios7_osys_main.h index 174c160bd6..0f89cf7aa5 100644 --- a/backends/platform/ios7/ios7_osys_main.h +++ b/backends/platform/ios7/ios7_osys_main.h @@ -123,6 +123,9 @@ public: static OSystem_iOS7 *sharedInstance(); virtual void initBackend(); + + virtual void engineInit(); + virtual void engineDone(); virtual bool hasFeature(Feature f); virtual void setFeatureState(Feature f, bool enable); diff --git a/backends/platform/ios7/ios7_osys_video.mm b/backends/platform/ios7/ios7_osys_video.mm index 456796137e..1ec0defd7e 100644 --- a/backends/platform/ios7/ios7_osys_video.mm +++ b/backends/platform/ios7/ios7_osys_video.mm @@ -61,6 +61,18 @@ void OSystem_iOS7::fatalError() { } } +void OSystem_iOS7::engineInit() { + EventsBaseBackend::engineInit(); + // Prevent the device going to sleep during game play (and in particular cut scenes) + [[UIApplication sharedApplication] setIdleTimerDisabled:YES]; +} + +void OSystem_iOS7::engineDone() { + EventsBaseBackend::engineDone(); + // Allow the device going to sleep if idle while in the Launcher + [[UIApplication sharedApplication] setIdleTimerDisabled:NO]; +} + void OSystem_iOS7::initVideoContext() { _videoContext = [[iOS7AppDelegate iPhoneView] getVideoContext]; } |