Merging changes in core

This commit is contained in:
codeanticode
2012-05-10 00:19:05 +00:00
parent d22af52c68
commit 6c76a58801
4 changed files with 66 additions and 111 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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");
}

View File

@@ -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();
}
}
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .