v0.9.4: adjusted justResumed to not be blank and only trigger on android

This commit is contained in:
Evan Debenham 2021-06-25 15:55:33 -04:00
parent d610383717
commit 804f0bda2e

View File

@ -35,6 +35,7 @@ import com.watabou.input.PointerEvent;
import com.watabou.noosa.audio.Music; import com.watabou.noosa.audio.Music;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Callback; import com.watabou.utils.Callback;
import com.watabou.utils.DeviceCompat;
import com.watabou.utils.PlatformSupport; import com.watabou.utils.PlatformSupport;
import com.watabou.utils.Reflection; import com.watabou.utils.Reflection;
@ -89,11 +90,6 @@ public class Game implements ApplicationListener {
this.platform = platform; this.platform = platform;
} }
//FIXME this is a temporary workaround to improve start times on android (first frame is 'cheated' and only renders a black screen)
//this is partly to improve stats on google play, and partly to try and diagnose what the cause of slow loading times is
//ultimately once the cause is found it should be fixed and this should no longer be needed
private boolean justResumed = true;
@Override @Override
public void create() { public void create() {
density = Gdx.graphics.getDensity(); density = Gdx.graphics.getDensity();
@ -141,6 +137,11 @@ public class Game implements ApplicationListener {
} }
} }
//FIXME this is a temporary workaround to improve start times on android (first frame is 'cheated' and skips rendering)
//this is partly to improve stats on google play, and partly to try and diagnose what the cause of slow loading times is
//ultimately once the cause is found it should be fixed and this should no longer be needed
private boolean justResumed = true;
@Override @Override
public void render() { public void render() {
//prevents weird rare cases where the app is running twice //prevents weird rare cases where the app is running twice
@ -150,9 +151,8 @@ public class Game implements ApplicationListener {
} }
if (justResumed){ if (justResumed){
Gdx.gl.glClear(Gdx.gl.GL_COLOR_BUFFER_BIT);
justResumed = false; justResumed = false;
return; if (DeviceCompat.isAndroid()) return;
} }
NoosaScript.get().resetCamera(); NoosaScript.get().resetCamera();