X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=_Internals.pde;h=47166220ca84ae722f3392f707575a2a42377e85;hb=ef7118ad30ec90ed1a3e6d3f5d9fdb0a21a03fe9;hp=3497afc02f53fef905f033ecd1d18b0c00c5de6f;hpb=67847b063620910be4ee68874f007a732446461c;p=SugarCubes.git diff --git a/_Internals.pde b/_Internals.pde index 3497afc..4716622 100644 --- a/_Internals.pde +++ b/_Internals.pde @@ -266,11 +266,11 @@ void draw() { long drawNanos = System.nanoTime() - drawStart; if (diagnosticsOn) { - drawDiagnostics(lx.drawNanos(), drawNanos, simulationNanos, uiNanos, gammaNanos, sendNanos); + drawDiagnostics(drawNanos, simulationNanos, uiNanos, gammaNanos, sendNanos); } } -void drawDiagnostics(long lxNanos, long drawNanos, long simulationNanos, long uiNanos, long gammaNanos, long sendNanos) { +void drawDiagnostics(long drawNanos, long simulationNanos, long uiNanos, long gammaNanos, long sendNanos) { float ws = 4 / 1000000.; int thirtyfps = 1000000000 / 30; int sixtyfps = 1000000000 / 60; @@ -283,7 +283,7 @@ void drawDiagnostics(long lxNanos, long drawNanos, long simulationNanos, long ui noStroke(); int xp = x; float hv = 0; - for (long val : new long[] {lxNanos, simulationNanos, uiNanos, gammaNanos, sendNanos }) { + for (long val : new long[] {lx.timer.drawNanos, simulationNanos, uiNanos, gammaNanos, sendNanos }) { fill(lx.hsb(hv % 360, 100, 80)); rect(xp, y, val * ws, h-1); hv += 140; @@ -292,6 +292,23 @@ void drawDiagnostics(long lxNanos, long drawNanos, long simulationNanos, long ui noFill(); stroke(#333333); line(x+sixtyfps*ws, y+1, x+sixtyfps*ws, y+h-1); + + y = y - 14; + xp = x; + float tw = thirtyfps * ws; + noFill(); + stroke(#999999); + rect(x, y, tw, h); + noStroke(); + for (long val : new long[] { + lx.engine.timer.deckNanos, + lx.engine.timer.fxNanos}) { + float amt = val / (float) lx.timer.drawNanos; + fill(lx.hsb(hv % 360, 100, 80)); + rect(xp, y, amt * tw, h-1); + hv += 140; + xp += amt * tw; + } } void drawSimulation(color[] simulationColors) {