v1.1.2: removed waiting on pause and improved bundle saving efficiency
This will hopefully address save corruption errors for Pixel phones on Android 12
This commit is contained in:
@@ -23,6 +23,7 @@ package com.watabou.utils;
|
|||||||
|
|
||||||
import com.badlogic.gdx.utils.JsonReader;
|
import com.badlogic.gdx.utils.JsonReader;
|
||||||
import com.badlogic.gdx.utils.JsonValue;
|
import com.badlogic.gdx.utils.JsonValue;
|
||||||
|
import com.badlogic.gdx.utils.JsonWriter;
|
||||||
import com.watabou.noosa.Game;
|
import com.watabou.noosa.Game;
|
||||||
|
|
||||||
import java.io.BufferedInputStream;
|
import java.io.BufferedInputStream;
|
||||||
@@ -452,7 +453,7 @@ public class Bundle {
|
|||||||
if (compressed) writer = new BufferedWriter( new OutputStreamWriter( new GZIPOutputStream(stream, GZIP_BUFFER ) ) );
|
if (compressed) writer = new BufferedWriter( new OutputStreamWriter( new GZIPOutputStream(stream, GZIP_BUFFER ) ) );
|
||||||
else writer = new BufferedWriter( new OutputStreamWriter( stream ) );
|
else writer = new BufferedWriter( new OutputStreamWriter( stream ) );
|
||||||
|
|
||||||
writer.write( bundle.toString() );
|
bundle.data.prettyPrint(JsonWriter.OutputType.json, writer);
|
||||||
writer.close();
|
writer.close();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -627,7 +627,6 @@ public class GameScene extends PixelScene {
|
|||||||
@Override
|
@Override
|
||||||
public synchronized void onPause() {
|
public synchronized void onPause() {
|
||||||
try {
|
try {
|
||||||
if (Dungeon.hero != null && !Dungeon.hero.ready) waitForActorThread(500, false);
|
|
||||||
Dungeon.saveAll();
|
Dungeon.saveAll();
|
||||||
Badges.saveGlobal();
|
Badges.saveGlobal();
|
||||||
Journal.saveGlobal();
|
Journal.saveGlobal();
|
||||||
|
|||||||
Reference in New Issue
Block a user