Peformance tweaking, new library builds
[SugarCubes.git] / ArjunBanker.pde
index dcd5faec4f3a5660c6bd969fcfc7209c1bd846b1..12ce5b6c8c48ab373618a370d533f8c60e72d81e 100644 (file)
@@ -13,7 +13,7 @@ class TelevisionStatic extends SCPattern {
     addParameter(hueParameter);
   }
 
- void run(int deltaMs) {
+ void run(double deltaMs) {
     boolean d = direction.getValuef() > 5.0;
     for (Point p : model.points) {             
       colors[p.index] = color((lx.getBaseHuef() + random(hueParameter.getValuef() * 360))%360, random(saturationParameter.getValuef() * 100), random(brightParameter.getValuef() * 100));
@@ -37,10 +37,10 @@ class AbstractPainting extends SCPattern {
     img.loadPixels();    
   } 
  
-  void run(int deltaMs) {    
+  void run(double deltaMs) {    
     for (Point p : model.points) {
       color c = img.get((int)((p.x / model.xMax) * img.width), img.height - (int)((p.y / model.yMax) * img.height));
-      colors[p.index] = color(hue(c) + colorMod.getValuef()%360, saturation(c), brightness(c) - ((p.fz - brightMod.getValuef())/p.fz));
+      colors[p.index] = color(hue(c) + colorMod.getValuef()%360, saturation(c), brightness(c) - ((p.z - brightMod.getValuef())/p.z));
     }    
   }       
 }
@@ -60,13 +60,13 @@ class Spirality extends SCPattern {
     }
   }
     
-  public void run(int deltaMs) {
+  public void run(double deltaMs) {
     angle += deltaMs * 0.007;
     rad += deltaMs * .025 * direction;
     float x = model.xMax / 2 + cos(angle) * rad;
     float y = model.yMax / 2 + sin(angle) * rad;
     for (Point p : model.points) {    
-      float b = dist(x,y,p.fx,p.fy);
+      float b = dist(x,y,p.x,p.y);
       if (b < 90) {
         colors[p.index] = blendColor(
           colors[p.index],