From 6c76a58801602cc5bb3fb74ae8000e08dcf0176f Mon Sep 17 00:00:00 2001 From: codeanticode Date: Thu, 10 May 2012 00:19:05 +0000 Subject: [PATCH] Merging changes in core --- core/src/processing/core/PApplet.java | 65 +----------------- core/src/processing/core/PConstants.java | 8 --- core/src/processing/core/PGraphics.java | 19 ++++-- core/src/processing/core/PShape.java | 85 ++++++++++++++---------- 4 files changed, 66 insertions(+), 111 deletions(-) diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index 18eece265..dc4ae8d33 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -5198,8 +5198,6 @@ public class PApplet extends Applet // SHAPE I/O - protected String[] loadShapeFormats; - /** * ( begin auto-generated from loadShape.xml ) @@ -5230,14 +5228,6 @@ public class PApplet extends Applet * @see PGraphics#shapeMode(int) */ public PShape loadShape(String filename) { - return loadShape(filename, null); - } - - - /** - * @nowebref - */ - public PShape loadShape(String filename, Object params) { String extension; String lower = filename.toLowerCase(); @@ -5268,72 +5258,21 @@ public class PApplet extends Applet } else { // Loading the formats supported by the renderer. - loadShapeFormats = g.getSupportedShapeFormats(); + String[] loadShapeFormats = g.getSupportedShapeFormats(); if (loadShapeFormats != null) { for (int i = 0; i < loadShapeFormats.length; i++) { if (extension.equals(loadShapeFormats[i])) { - return g.loadShape(filename, params); + return g.loadShape(filename); } } } - } return null; } - /** - * Creates an empty shape, with the specified size and parameters. - * The actual type will depend on the renderer. - */ - /* - public PShape createShape(int size, Object params) { - return g.createShape(size, params); - } - */ - - - /* - public PShape createGroup(String name) { - PShape shape = new PShape(PShape.GROUP); - shape.setName(name); - shape.g = g; - return shape; - } - - public PShape createPrimitive(String name, int type) { - PShape shape = new PShape(); - shape.family = PShape.PRIMITIVE; - shape.primitive = type; - shape.setName(name); - shape.g = g; - return shape; - } - - public PShape createShapePath(String name) { - PShape shape = new PShape(); - shape.family = PShape.PATH; - shape.setName(name); - shape.g = g; - shape.vertexInit(); - return shape; - } - - public PShape createGeometry(String name, int type) { - PShape shape = new PShape(); - shape.family = PShape.GEOMETRY; - shape.primitive = type; - shape.setName(name); - shape.g = g; - shape.vertexInit(); - return shape; - } - */ - - - ////////////////////////////////////////////////////////////// // DATA I/O diff --git a/core/src/processing/core/PConstants.java b/core/src/processing/core/PConstants.java index 992013b1d..1c6f07ae2 100644 --- a/core/src/processing/core/PConstants.java +++ b/core/src/processing/core/PConstants.java @@ -449,14 +449,6 @@ public interface PConstants { /** This constant identifies the repeat wrapping mode */ public static final int REPEAT = 1; - - // shape objects - - /** Static shapes (vertices won't be updated after creation). */ - public static final int STATIC = 0; - /** Dynamic shapes (vertices will be updated after creation). */ - public static final int DYNAMIC = 1; - // shaders diff --git a/core/src/processing/core/PGraphics.java b/core/src/processing/core/PGraphics.java index 9c1295fb5..ac2f646e0 100644 --- a/core/src/processing/core/PGraphics.java +++ b/core/src/processing/core/PGraphics.java @@ -7288,6 +7288,15 @@ public class PGraphics extends PImage implements PConstants { } } + + public boolean haveRaw() { // ignore + return raw != null; + } + + + public PGraphics getRaw() { // ignore + return raw; + } ////////////////////////////////////////////////////////////// @@ -7457,17 +7466,17 @@ public class PGraphics extends PImage implements PConstants { showMissingWarning("createShape"); return null; } + + public PShape loadShape(String filename) { // ignore + showMissingWarning("loadShape"); + return null; + } protected String[] getSupportedShapeFormats() { showMissingWarning("getSupportedShapeFormats"); return null; } - protected PShape loadShape(String filename, Object params) { - showMissingWarning("loadShape"); - return null; - } - public void blendMode(int mode) { showMissingWarning("blendMode"); } diff --git a/core/src/processing/core/PShape.java b/core/src/processing/core/PShape.java index d37461583..2ddcd4b44 100644 --- a/core/src/processing/core/PShape.java +++ b/core/src/processing/core/PShape.java @@ -95,9 +95,6 @@ public class PShape implements PConstants { /** ELLIPSE, LINE, QUAD; TRIANGLE_FAN, QUAD_STRIP; etc. */ protected int kind; - - /** STATIC, DYNAMIC */ - protected int mode; protected PMatrix matrix; @@ -209,8 +206,6 @@ public class PShape implements PConstants { /** True if colorMode(RGB, 255) */ boolean colorModeDefault; // = true; - /** To mark the shape dirty upon changes in its geometry **/ - public boolean modified; // should this be called vertices (consistent with PGraphics internals) // or does that hurt flexibility? @@ -264,11 +259,6 @@ public class PShape implements PConstants { } - public void setMode(int mode) { - this.mode = mode; - } - - public void setName(String name) { this.name = name; } @@ -551,6 +541,53 @@ public class PShape implements PConstants { public void tint(float x, float y, float z, float alpha) { } + ////////////////////////////////////////////////////////////// + + // Ambient set/update + + public void ambient(int rgb) { + } + + public void ambient(float gray) { + } + + public void ambient(float x, float y, float z) { + } + + ////////////////////////////////////////////////////////////// + + // Specular set/update + + public void specular(int rgb) { + } + + public void specular(float gray) { + } + + public void specular(float x, float y, float z) { + } + + + ////////////////////////////////////////////////////////////// + + // Emissive set/update + + public void emissive(int rgb) { + } + + public void emissive(float gray) { + } + + public void emissive(float x, float y, float z) { + } + + ////////////////////////////////////////////////////////////// + + // Shininess set/update + + public void shininess(float shine) { + } + /////////////////////////////////////////////////////////// // @@ -1140,34 +1177,12 @@ public class PShape implements PConstants { public void updateRoot(PShape root) { } - - protected void modified() { - modified = true; - if (parent != null) { - parent.modified(); - } + + public PShape getTessellation() { + return null; } - // TODO: finish implementing partial updates in PShape3D - protected void modified(int i0, int i1) { - modified = true; - // firstModified = i0; - // lastModified = i1; - if (parent != null) { - parent.modified(i0, i1); - } - } - - - protected void notModified() { - modified = false; - for (int i = 0; i < childCount; i++) { - children[i].notModified(); - } - } - - // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .