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:
Evan Debenham 2022-01-04 18:37:03 -05:00
parent c4d0017ff7
commit db74efea10
2 changed files with 2 additions and 2 deletions

View File

@ -23,6 +23,7 @@ package com.watabou.utils;
import com.badlogic.gdx.utils.JsonReader;
import com.badlogic.gdx.utils.JsonValue;
import com.badlogic.gdx.utils.JsonWriter;
import com.watabou.noosa.Game;
import java.io.BufferedInputStream;
@ -452,7 +453,7 @@ public class Bundle {
if (compressed) writer = new BufferedWriter( new OutputStreamWriter( new GZIPOutputStream(stream, GZIP_BUFFER ) ) );
else writer = new BufferedWriter( new OutputStreamWriter( stream ) );
writer.write( bundle.toString() );
bundle.data.prettyPrint(JsonWriter.OutputType.json, writer);
writer.close();
return true;

View File

@ -627,7 +627,6 @@ public class GameScene extends PixelScene {
@Override
public synchronized void onPause() {
try {
if (Dungeon.hero != null && !Dungeon.hero.ready) waitForActorThread(500, false);
Dungeon.saveAll();
Badges.saveGlobal();
Journal.saveGlobal();