diff --git a/sdk/jme3-core/src/com/jme3/gde/core/scene/FakeApplication.java b/sdk/jme3-core/src/com/jme3/gde/core/scene/FakeApplication.java index e930fb8f2..5c698b27e 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/scene/FakeApplication.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/scene/FakeApplication.java @@ -431,6 +431,28 @@ public class FakeApplication extends SimpleApplication { } } + public boolean runQueuedFake() { + Future fut = fakeAppThread.submit(new Callable() { + public Void call() throws Exception { + runQueuedTasks(); + return null; + } + }); + try { + fut.get(1, TimeUnit.MINUTES); + } catch (InterruptedException ex) { + Exceptions.printStackTrace(ex); + } catch (ExecutionException ex) { + DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message("Exception in queued Tasks.")); + return false; + } catch (TimeoutException ex) { + fut.cancel(true); + DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message("Update loop was blocked for too long, task execution halted.")); + return false; + } + return true; + } + public boolean updateFake(final float tpf) { Future fut = fakeAppThread.submit(new Callable() { public Void call() throws Exception { diff --git a/sdk/jme3-core/src/com/jme3/gde/core/scene/SceneApplication.java b/sdk/jme3-core/src/com/jme3/gde/core/scene/SceneApplication.java index c6f63f1c2..1aa70f8a9 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/scene/SceneApplication.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/scene/SceneApplication.java @@ -266,6 +266,9 @@ public class SceneApplication extends Application implements LookupProvider { try { super.update(); FakeApplication fakap = fakeApp; + if (fakap != null) { + fakap.runQueuedFake(); + } float tpf = timer.getTimePerFrame(); camLight.setPosition(cam.getLocation()); secondCounter += tpf;