From: Mark Slee Date: Sat, 9 Nov 2013 02:53:05 +0000 (-0800) Subject: Stop wasting time in ColorFucker when sharpness is off X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ef7118ad30ec90ed1a3e6d3f5d9fdb0a21a03fe9;p=SugarCubes.git Stop wasting time in ColorFucker when sharpness is off --- diff --git a/MarkSlee.pde b/MarkSlee.pde index 59798c5..88759da 100644 --- a/MarkSlee.pde +++ b/MarkSlee.pde @@ -1411,7 +1411,7 @@ class ColorFuckerEffect extends SCEffect { float bMod = level.getValuef(); float sMod = 1 - desat.getValuef(); float hMod = hueShift.getValuef(); - float fSharp = 1/(1.0001-sharp.getValuef()); + float fSharp = sharp.getValuef(); float fSoft = soft.getValuef(); boolean mon = mono.getValuef() > 0.5; boolean ivt = invert.getValuef() > 0.5; @@ -1425,6 +1425,7 @@ class ColorFuckerEffect extends SCEffect { hsb[2] = 1 - hsb[2]; } if (fSharp > 0) { + fSharp = 1/(1-fSharp); hsb[2] = hsb[2] < .5 ? pow(hsb[2],fSharp) : 1-pow(1-hsb[2],fSharp); } if (fSoft > 0) { 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) { diff --git a/code/HeronLX.jar b/code/HeronLX.jar index 437f8e1..04fa7fd 100755 Binary files a/code/HeronLX.jar and b/code/HeronLX.jar differ