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

fix-456
Nehon 8 years ago
parent 0610f703d7
commit 8dcc67a318
  1. 4
      jme3-core/src/main/java/com/jme3/post/DetailedProfiler.java
  2. 6
      jme3-core/src/main/java/com/jme3/post/DetailedProfilerState.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;

@ -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) {

Loading…
Cancel
Save