aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java
diff options
context:
space:
mode:
authordhewg2011-03-02 20:25:47 +0100
committerdhewg2011-03-02 23:18:35 +0100
commit25ef065a4172443eebdd1031c8a387f30f930ec4 (patch)
treec1c2a5db309e94469449d4c449b814ad4e58df8f /backends/platform/android/org/inodes/gus/scummvm/ScummVM.java
parentccfe427eb542235070e8576b4cc47217d92046fd (diff)
downloadscummvm-rg350-25ef065a4172443eebdd1031c8a387f30f930ec4.tar.gz
scummvm-rg350-25ef065a4172443eebdd1031c8a387f30f930ec4.tar.bz2
scummvm-rg350-25ef065a4172443eebdd1031c8a387f30f930ec4.zip
ANDROID: Implement pause/resume
Don't just kill the whole process when the Activity is stopped. Instead, use its events to pause or resume audio and the running engine (if any). Of course not every engines implements that... but at least an incoming call doesn't kill the game now (lol).
Diffstat (limited to 'backends/platform/android/org/inodes/gus/scummvm/ScummVM.java')
-rw-r--r--backends/platform/android/org/inodes/gus/scummvm/ScummVM.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java b/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java
index 75407c66cc..ffb0109e6c 100644
--- a/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java
+++ b/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java
@@ -44,6 +44,7 @@ public abstract class ScummVM implements SurfaceHolder.Callback, Runnable {
final private native void destroy();
final private native void setSurface(int width, int height);
final private native int main(String[] args);
+ final private native void pauseEngine(boolean pause);
// Set scummvm config options
final public native void enableZoning(boolean enable);
@@ -134,12 +135,14 @@ public abstract class ScummVM implements SurfaceHolder.Callback, Runnable {
System.exit(res);
}
- public void pause() {
- // TODO
- }
+ public void pause(boolean pause) {
+ if (audio_track != null && !pause)
+ audio_track.play();
+
+ pauseEngine(pause);
- public void resume() {
- // TODO
+ if (audio_track != null && pause)
+ audio_track.stop();
}
final private void initEGL() throws Exception {