Browse Source

Added profile tracking to AppStateManager for render and post render. (#1485)

Trevor Flynn 4 năm trước cách đây
mục cha
commit
73cf6c32fb

+ 6 - 0
jme3-core/src/main/java/com/jme3/app/state/AppStateManager.java

@@ -365,6 +365,9 @@ public class AppStateManager {
         AppState[] array = getStates();
         for (AppState state : array){
             if (state.isEnabled()) {
+                if (app.getAppProfiler() != null) {
+                    app.getAppProfiler().appSubStep(state.getClass().getSimpleName());
+                }
                 state.render(rm);
             }
         }
@@ -377,6 +380,9 @@ public class AppStateManager {
         AppState[] array = getStates();
         for (AppState state : array){
             if (state.isEnabled()) {
+                if (app.getAppProfiler() != null) {
+                    app.getAppProfiler().appSubStep(state.getClass().getSimpleName());
+                }
                 state.postRender();
             }
         }