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

This commit is contained in:
Nehon 2017-02-07 20:43:42 +01:00
parent 0610f703d7
commit 8dcc67a318
2 changed files with 5 additions and 5 deletions

View File

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

View File

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