aboutsummaryrefslogtreecommitdiff
path: root/engine/src/core/com/jme3/app/Application.java
diff options
context:
space:
mode:
Diffstat (limited to 'engine/src/core/com/jme3/app/Application.java')
-rw-r--r--engine/src/core/com/jme3/app/Application.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/engine/src/core/com/jme3/app/Application.java b/engine/src/core/com/jme3/app/Application.java
index 517ec61..5100725 100644
--- a/engine/src/core/com/jme3/app/Application.java
+++ b/engine/src/core/com/jme3/app/Application.java
@@ -290,6 +290,10 @@ public class Application implements SystemListener {
private void initStateManager(){
stateManager = new AppStateManager(this);
+
+ // Always register a ResetStatsState to make sure
+ // that the stats are cleared every frame
+ stateManager.attach(new ResetStatsState());
}
/**
@@ -580,6 +584,17 @@ public class Application implements SystemListener {
}
task.invoke();
} while (((task = taskQueue.poll()) != null));
+
+ /* I think the above is really just doing this:
+ AppTask<?> task;
+ while( (task = taskQueue.poll()) != null ) {
+ if (!task.isCancelled()) {
+ task.invoke();
+ }
+ }
+ //...but it's hard to say for sure. It's so twisted
+ //up that I don't trust my eyes. -pspeed
+ */
if (speed == 0 || paused)
return;