borrow AsyncTask stuff from libgdx

- for html backend async tasks are just put on Queue and run on next main-loop iteration
This commit is contained in:
Hannes Janetzek
2013-07-26 23:35:05 +02:00
parent 8787ac7b48
commit 5b16f6b085
11 changed files with 422 additions and 26 deletions

View File

@@ -24,6 +24,8 @@ import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.input.GestureDetector;
import com.badlogic.gdx.input.GestureDetector.GestureListener;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Timer;
import com.badlogic.gdx.utils.Timer.Task;
public class GdxMap implements ApplicationListener {
@@ -66,13 +68,24 @@ public class GdxMap implements ApplicationListener {
}
@Override
public boolean postRunnable(Runnable runnable) {
public boolean post(Runnable runnable) {
Gdx.app.postRunnable(runnable);
return true;
}
@Override
public boolean postDelayed(final Runnable action, long delay) {
Timer.schedule(new Task(){
@Override
public void run() {
action.run();
}}, delay / 1000f);
return true;
}
};
mMapRenderer = new GLRenderer(mMapView);
}
// Stage ui;