v0.9.1b: added some logic to improve (measured) loading times on Android
This commit is contained in:
parent
d7be6686d9
commit
17ccce9e6a
|
@ -86,11 +86,10 @@ public class Game implements ApplicationListener {
|
||||||
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(){
|
||||||
|
|
Loading…
Reference in New Issue
Block a user