mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-10 04:43:26 +00:00
ANDROID: Save the game when the process is paused
The OS can kill the activity at will after onPause() or onStop() to free up memory for other application. Provide a parachute when the engine allows it.
This commit is contained in:
parent
42c6a785c7
commit
1f90d232e3
@ -631,7 +631,13 @@ void JNI::setPause(JNIEnv *env, jobject self, jboolean value) {
|
||||
|
||||
if (g_engine) {
|
||||
LOGD("pauseEngine: %d", value);
|
||||
|
||||
g_engine->pauseEngine(value);
|
||||
|
||||
if (value &&
|
||||
g_engine->hasFeature(Engine::kSupportsSavingDuringRuntime) &&
|
||||
g_engine->canSaveGameStateCurrently())
|
||||
g_engine->saveGameState(0, "Android parachute");
|
||||
}
|
||||
|
||||
pause = value;
|
||||
|
Loading…
x
Reference in New Issue
Block a user