diff --git a/core/PApplet.java b/core/PApplet.java index cd102e009..ee0f274e0 100644 --- a/core/PApplet.java +++ b/core/PApplet.java @@ -1134,8 +1134,8 @@ public class PApplet extends Applet if (THREAD_DEBUG) println(Thread.currentThread().getName() + " 1b draw"); - boolean shapeRecorderNull = true; - boolean rawShapeRecorderNull = true; + boolean recorderNull = true; + boolean recorderRawNull = true; if (frameCount == 0) { try { @@ -1224,8 +1224,8 @@ public class PApplet extends Applet // as of draw().. this will prevent the recorder from being // reset if recordShape() is called in an event method, such // as mousePressed() - shapeRecorderNull = (recorder == null); - rawShapeRecorderNull = (g.rawShapeRecorder == null); + recorderNull = (recorder == null); + recorderRawNull = (g.recorderRaw == null); // dmouseX/Y is updated only once per frame dmouseX = mouseX; @@ -1251,16 +1251,16 @@ public class PApplet extends Applet } g.endFrame(); - if (!shapeRecorderNull) { + if (!recorderNull) { if (recorder != null) { recorder.endFrame(); recorder = null; } } - if (!rawShapeRecorderNull) { - if (g.rawShapeRecorder != null) { - g.rawShapeRecorder.endFrame(); - g.rawShapeRecorder = null; + if (!recorderRawNull) { + if (g.recorderRaw != null) { + g.recorderRaw.endFrame(); + g.recorderRaw = null; } } @@ -5715,44 +5715,12 @@ v PApplet.this.stop(); ////////////////////////////////////////////////////////////// - - public void recordShapes(PGraphics recorder) { + public void record(PGraphics recorder) { this.recorder = recorder; recorder.beginFrame(); } - //public void recordShapesRaw(PGraphics raw) { - //g.rawShapeRecorder = raw; - //raw.beginFrame(); - //} - - - /* - //recordShapes(recorder, "frame-" + nf(frameCount, 4)); - - public void recordShapes(PGraphics recorder, String filename) { - int first = filename.indexOf('#'); - int last = filename.lastIndexOf('#'); - - if (first != -1) { - String prefix = filename.substring(0, first); - int count = last - first + 1; - String suffix = filename.substring(last + 1); - filename = prefix + nf(frameCount, count) + suffix; - } - recordShapes(recorder, savePath(filename)); - } - - - public void recordShapes(PGraphics recorder, File file) { - this.recorder = recorder; - //recorder.record(frameCount, file); - recorder.beginFrame(); //frameCount, file); - } - */ - - ////////////////////////////////////////////////////////////// @@ -5762,17 +5730,6 @@ v PApplet.this.stop(); } - //public void updatePixels() { - // anything special here? - //g.updatePixels(); - //} - - - //public void updatePixels(int x1, int y1, int x2, int y2) { - //g.updatePixels(x1, y1, x2, y2); - //} - - ////////////////////////////////////////////////////////////// // everything below this line is automatically generated. no touch. @@ -6904,8 +6861,8 @@ v PApplet.this.stop(); } - public void recordShapesRaw(PGraphics rawShapeRecorder) { - if (recorder != null) recorder.recordShapesRaw(rawShapeRecorder); - g.recordShapesRaw(rawShapeRecorder); + public void recordRaw(PGraphics recorderRaw) { + if (recorder != null) recorder.recordRaw(recorderRaw); + g.recordRaw(recorderRaw); } } diff --git a/core/PGraphics.java b/core/PGraphics.java index 0389298d3..1b0d632df 100644 --- a/core/PGraphics.java +++ b/core/PGraphics.java @@ -66,8 +66,8 @@ public class PGraphics extends PImage implements PConstants { // ........................................................ - // used by recordShapesRaw() - public PGraphics rawShapeRecorder; + // used by recordRaw() + public PGraphics recorderRaw; // ........................................................ @@ -3529,8 +3529,8 @@ public class PGraphics extends PImage implements PConstants { ////////////////////////////////////////////////////////////// - public void recordShapesRaw(PGraphics rawShapeRecorder) { - throw new RuntimeException("recordShapesRaw() not supported " + + public void recordRaw(PGraphics recorderRaw) { + throw new RuntimeException("recordRaw() not supported " + "by this renderer."); } } diff --git a/core/PGraphics3.java b/core/PGraphics3.java index 7be8998ee..dd3550a51 100644 --- a/core/PGraphics3.java +++ b/core/PGraphics3.java @@ -1323,10 +1323,10 @@ public class PGraphics3 extends PGraphics { protected void render_triangles() { //System.out.println("rendering " + triangleCount + " triangles"); - if (rawShapeRecorder != null) { - rawShapeRecorder.colorMode(RGB, 1); - rawShapeRecorder.noStroke(); - rawShapeRecorder.beginShape(TRIANGLES); + if (recorderRaw != null) { + recorderRaw.colorMode(RGB, 1); + recorderRaw.noStroke(); + recorderRaw.beginShape(TRIANGLES); } for (int i = 0; i < triangleCount; i ++) { @@ -1375,18 +1375,18 @@ public class PGraphics3 extends PGraphics { triangle.setIndex(index); triangle.render(); - if (rawShapeRecorder != null) { - rawShapeRecorder.fill(ar, ag, ab, a[A]); - rawShapeRecorder.vertex(a[X], a[Y]); // a[X] and not a[VX] ? - rawShapeRecorder.fill(br, bg, bb, b[A]); - rawShapeRecorder.vertex(b[X], b[Y]); - rawShapeRecorder.fill(cr, cg, cb, c[A]); - rawShapeRecorder.vertex(c[X], c[Y]); + if (recorderRaw != null) { + recorderRaw.fill(ar, ag, ab, a[A]); + recorderRaw.vertex(a[X], a[Y]); // a[X] and not a[VX] ? + recorderRaw.fill(br, bg, bb, b[A]); + recorderRaw.vertex(b[X], b[Y]); + recorderRaw.fill(cr, cg, cb, c[A]); + recorderRaw.vertex(c[X], c[Y]); } } - if (rawShapeRecorder != null) { - rawShapeRecorder.endShape(); + if (recorderRaw != null) { + recorderRaw.endShape(); } } @@ -3800,9 +3800,9 @@ public class PGraphics3 extends PGraphics { // RAW SHAPE RECORDING - public void recordShapesRaw(PGraphics rawShapeRecorder) { - this.rawShapeRecorder = rawShapeRecorder; - rawShapeRecorder.beginFrame(); + public void recordRaw(PGraphics recorderRaw) { + this.recorderRaw = recorderRaw; + recorderRaw.beginFrame(); } diff --git a/core/todo.txt b/core/todo.txt index 9ab4c08b1..b3c2f570f 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -1,4 +1,5 @@ 0098 core +X change recordShapes() to just record() and recordRaw() _ width, height set to zero in static mode _ probably only set when resize() is called, and it's not happening @@ -10,8 +11,7 @@ _ PSound.play() won't play the sound a 2nd time _ (have to call stop() first) _ http://dev.processing.org/bugs/show_bug.cgi?id=209 -_ change recordShapes() to just record() and recordRaw() -_ make dxf writer that'll work with recordShapesRaw() +_ make dxf writer that'll work with recordRaw() _ enable PGraphicsPDF for inclusion _ write documentation on images (they suck) and fonts (use ttf) @@ -25,9 +25,15 @@ _ need to strip off past the file separator or something 0099 or later +threading issues +_ sketches often freeze when stop is hit on an HT machine +_ http://dev.processing.org/bugs/show_bug.cgi?id=232 _ sonia is locking up on load in rev 91 _ prolly something w/ the threading issues _ http://dev.processing.org/bugs/show_bug.cgi?id=46 +_ debug NumberFormat InterruptedException on dual proc machine +_ use notify() instead of interrupt()? +_ or Thread.currentThread() should be checked first? _ tint() and noTint() switching problem in P2D _ http://dev.processing.org/bugs/show_bug.cgi?id=222 @@ -36,10 +42,6 @@ _ display() as a function name is problematic _ causes nothing to show up.. either rename or mark it final _ http://dev.processing.org/bugs/show_bug.cgi?id=213 -_ debug NumberFormat InterruptedException on dual proc machine -_ use notify() instead of interrupt()? -_ or Thread.currentThread() should be checked first? - _ more image file i/o in java 1.4 _ add dynamic loading of the jpeg, png, and gif(?) encoder classes _ http://dev.processing.org/bugs/show_bug.cgi?id=165 diff --git a/opengl/PGraphicsGL.java b/opengl/PGraphicsGL.java index fffd8364e..85061c441 100644 --- a/opengl/PGraphicsGL.java +++ b/opengl/PGraphicsGL.java @@ -431,10 +431,10 @@ public class PGraphicsGL extends PGraphics3 { float cb = min(1, triangleColors[i][2][TRI_DIFFUSE_B] + triangleColors[i][2][TRI_SPECULAR_B]); - if (rawShapeRecorder != null) { - rawShapeRecorder.colorMode(RGB, 1); - rawShapeRecorder.noStroke(); - rawShapeRecorder.beginShape(TRIANGLES); + if (recorderRaw != null) { + recorderRaw.colorMode(RGB, 1); + recorderRaw.noStroke(); + recorderRaw.beginShape(TRIANGLES); } int textureIndex = triangles[i][TEXTURE_INDEX]; @@ -570,14 +570,14 @@ public class PGraphicsGL extends PGraphics3 { gl.glDisable(GL.GL_TEXTURE_2D); - if (rawShapeRecorder != null) { - rawShapeRecorder.texture(texture); - rawShapeRecorder.fill(ar, ag, ab, a[A]); - rawShapeRecorder.vertex(a[VX], a[VY], a[U] * uscale, a[V] * vscale); - rawShapeRecorder.fill(br, bg, bb, b[A]); - rawShapeRecorder.vertex(b[VX], b[VY], b[U] * uscale, b[V] * vscale); - rawShapeRecorder.fill(cr, cg, cb, c[A]); - rawShapeRecorder.vertex(c[VX], c[VY], c[U] * uscale, c[V] * vscale); + if (recorderRaw != null) { + recorderRaw.texture(texture); + recorderRaw.fill(ar, ag, ab, a[A]); + recorderRaw.vertex(a[VX], a[VY], a[U] * uscale, a[V] * vscale); + recorderRaw.fill(br, bg, bb, b[A]); + recorderRaw.vertex(b[VX], b[VY], b[U] * uscale, b[V] * vscale); + recorderRaw.fill(cr, cg, cb, c[A]); + recorderRaw.vertex(c[VX], c[VY], c[U] * uscale, c[V] * vscale); } } else { @@ -599,19 +599,19 @@ public class PGraphicsGL extends PGraphics3 { gl.glNormal3f(c[NX], c[NY], c[NZ]); gl.glVertex3f(c[VX], c[VY], c[VZ]); - if (rawShapeRecorder != null) { - rawShapeRecorder.fill(ar, ag, ab, a[A]); - rawShapeRecorder.vertex(a[VX], a[VY]); - rawShapeRecorder.fill(br, bg, bb, b[A]); - rawShapeRecorder.vertex(b[VX], b[VY]); - rawShapeRecorder.fill(cr, cg, cb, c[A]); - rawShapeRecorder.vertex(c[VX], c[VY]); + if (recorderRaw != null) { + recorderRaw.fill(ar, ag, ab, a[A]); + recorderRaw.vertex(a[VX], a[VY]); + recorderRaw.fill(br, bg, bb, b[A]); + recorderRaw.vertex(b[VX], b[VY]); + recorderRaw.fill(cr, cg, cb, c[A]); + recorderRaw.vertex(c[VX], c[VY]); } gl.glEnd(); } } - if (rawShapeRecorder != null) { - rawShapeRecorder.endShape(); + if (recorderRaw != null) { + recorderRaw.endShape(); } report("out of triangles"); } @@ -633,8 +633,8 @@ public class PGraphicsGL extends PGraphics3 { //report("render_lines 2 " + lines[i][STROKE_WEIGHT]); gl.glBegin(GL.GL_LINE_STRIP); - if (rawShapeRecorder != null) { - rawShapeRecorder.strokeWeight(sw); + if (recorderRaw != null) { + recorderRaw.strokeWeight(sw); } // always draw a first point @@ -643,12 +643,12 @@ public class PGraphicsGL extends PGraphics3 { gl.glVertex3f(a[VX], a[VY], a[VZ]); //System.out.println("First point: " + a[VX] +", "+ a[VY] +", "+ a[VZ]); - if (rawShapeRecorder != null) { + if (recorderRaw != null) { if (a[SA] > EPSILON) { // don't draw if transparent - rawShapeRecorder.colorMode(RGB, 1); - rawShapeRecorder.beginShape(LINE_STRIP); - rawShapeRecorder.stroke(a[SR], a[SG], a[SB], a[SA]); - rawShapeRecorder.vertex(a[VX], a[VY]); + recorderRaw.colorMode(RGB, 1); + recorderRaw.beginShape(LINE_STRIP); + recorderRaw.stroke(a[SR], a[SG], a[SB], a[SA]); + recorderRaw.vertex(a[VX], a[VY]); } } @@ -659,14 +659,14 @@ public class PGraphicsGL extends PGraphics3 { gl.glColor4f(b[SR], b[SG], b[SB], b[SA]); gl.glVertex3f(b[VX], b[VY], b[VZ]); - if (rawShapeRecorder != null) { - rawShapeRecorder.stroke(b[SR], b[SG], b[SB], b[SA]); - rawShapeRecorder.vertex(b[VX], b[VY]); + if (recorderRaw != null) { + recorderRaw.stroke(b[SR], b[SG], b[SB], b[SA]); + recorderRaw.vertex(b[VX], b[VY]); } i++; } - if (rawShapeRecorder != null) { - rawShapeRecorder.endShape(); + if (recorderRaw != null) { + recorderRaw.endShape(); } gl.glEnd(); }