Browse Source

Fixed an issue in DetailedProfiler where time would become negative with low fps

Nehon 8 năm trước cách đây
mục cha
commit
8dcc67a318

+ 2 - 2
jme3-core/src/main/java/com/jme3/post/DetailedProfiler.java

@@ -215,8 +215,8 @@ public class DetailedProfiler implements AppProfiler {
         private int startCursor = 0;
         private int cpuCursor = 0;
         private int gpuCursor = 0;
-        private int cpuSum = 0;
-        private int gpuSum = 0;
+        private long cpuSum = 0;
+        private long gpuSum = 0;
         private long lastValue = 0;
         private int nbFramesCpu;
         private int nbFramesGpu;

+ 3 - 3
jme3-core/src/main/java/com/jme3/post/DetailedProfilerState.java

@@ -263,10 +263,10 @@ public class DetailedProfilerState extends BaseAppState {
         boolean dimmed = isParent && expended;
         boolean insignificant = false;
 
-        if (value > 1000000000.0 / 60.0) {
-            t.setColor(dimmed ? dimmedOrange : ColorRGBA.Orange);
-        } else if (value > 1000000000f / 30f) {
+        if (value > 1000000000.0 / 30.0) {
             t.setColor(dimmed ? dimmedRed : ColorRGBA.Red);
+        } else if (value > 1000000000.0 / 60.0) {
+            t.setColor(dimmed ? dimmedOrange : ColorRGBA.Orange);
         } else if (value > totalTime / 3) {
             t.setColor(dimmed ? dimmedGreen : ColorRGBA.Green);
         } else if (value < 30000) {