v0.9.1b: added some logic to improve (measured) loading times on Android

This commit is contained in:
Evan Debenham 2021-01-01 17:40:44 -05:00
parent d7be6686d9
commit 17ccce9e6a

View File

@ -85,12 +85,11 @@ public class Game implements ApplicationListener {
instance = this; instance = this;
this.platform = platform; this.platform = platform;
} }
private boolean paused; //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
public boolean isPaused(){ //ultimately once the cause is found it should be fixed and this should no longer be needed
return paused; private boolean justResumed = false;
}
@Override @Override
public void create() { public void create() {
@ -147,6 +146,12 @@ public class Game implements ApplicationListener {
return; return;
} }
if (justResumed){
Gdx.gl.glClear(Gdx.gl.GL_COLOR_BUFFER_BIT);
justResumed = false;
return;
}
NoosaScript.get().resetCamera(); NoosaScript.get().resetCamera();
NoosaScriptNoLighting.get().resetCamera(); NoosaScriptNoLighting.get().resetCamera();
Gdx.gl.glDisable(Gdx.gl.GL_SCISSOR_TEST); Gdx.gl.glDisable(Gdx.gl.GL_SCISSOR_TEST);
@ -160,8 +165,6 @@ public class Game implements ApplicationListener {
@Override @Override
public void pause() { public void pause() {
paused = true;
PointerEvent.clearPointerEvents(); PointerEvent.clearPointerEvents();
if (scene != null) { if (scene != null) {
@ -173,7 +176,7 @@ public class Game implements ApplicationListener {
@Override @Override
public void resume() { public void resume() {
paused = false; justResumed = true;
} }
public void finish(){ public void finish(){