diff options
author | Thierry Crozat | 2016-10-20 22:38:14 +0100 |
---|---|---|
committer | Thierry Crozat | 2016-10-20 22:38:14 +0100 |
commit | 4a9446490af0b8018b4999c8fa11a6d5ec4ea980 (patch) | |
tree | 453bbb48fcd634e9081306153bd6324fe874b708 /backends/platform | |
parent | 6c13a4d0001a91e352dc99d768f528ac9fe7bd3e (diff) | |
download | scummvm-rg350-4a9446490af0b8018b4999c8fa11a6d5ec4ea980.tar.gz scummvm-rg350-4a9446490af0b8018b4999c8fa11a6d5ec4ea980.tar.bz2 scummvm-rg350-4a9446490af0b8018b4999c8fa11a6d5ec4ea980.zip |
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 6784cf46f5..5370ef02dd 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]; } |