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