diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index fea5697cb..3a7e4e5d4 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -926,7 +926,7 @@ public class PApplet extends Applet * when moving between pages), though. */ public void destroy() { - ((PApplet) this).dispose(); + this.dispose(); } @@ -4054,7 +4054,7 @@ public class PApplet extends Applet * @see PApplet#ceil(float) */ static public final int round(float what) { - return (int) Math.round(what); + return Math.round(what); } @@ -4365,9 +4365,9 @@ public class PApplet extends Applet if (z<0) z=-z; int xi=(int)x, yi=(int)y, zi=(int)z; - float xf = (float)(x-xi); - float yf = (float)(y-yi); - float zf = (float)(z-zi); + float xf = x - xi; + float yf = y - yi; + float zf = z - zi; float rxf, ryf; float r=0; @@ -7512,7 +7512,7 @@ public class PApplet extends Applet } String[][] matches = new String[results.size()][count]; for (int i = 0; i < matches.length; i++) { - matches[i] = (String[]) results.get(i); + matches[i] = results.get(i); } return matches; } @@ -7897,7 +7897,7 @@ public class PApplet extends Applet * Java's rules for upgrading values. */ static final public float parseFloat(int what) { // also handles byte - return (float)what; + return what; } static final public float parseFloat(String what) { diff --git a/core/src/processing/core/PGraphics.java b/core/src/processing/core/PGraphics.java index 5ccd5ee3d..cb75c51ff 100644 --- a/core/src/processing/core/PGraphics.java +++ b/core/src/processing/core/PGraphics.java @@ -1338,8 +1338,8 @@ public class PGraphics extends PImage implements PConstants { "using u and v coordinates with vertex()"); } if (textureMode == IMAGE) { - u /= (float) textureImage.width; - v /= (float) textureImage.height; + u /= textureImage.width; + v /= textureImage.height; } textureU = u; @@ -6615,10 +6615,10 @@ public class PGraphics extends PImage implements PConstants { calcRi = (argb >> 16) & 0xff; calcGi = (argb >> 8) & 0xff; calcBi = argb & 0xff; - calcA = (float)calcAi / 255.0f; - calcR = (float)calcRi / 255.0f; - calcG = (float)calcGi / 255.0f; - calcB = (float)calcBi / 255.0f; + calcA = calcAi / 255.0f; + calcR = calcRi / 255.0f; + calcG = calcGi / 255.0f; + calcB = calcBi / 255.0f; calcAlpha = (calcAi != 255); } diff --git a/core/src/processing/core/PImage.java b/core/src/processing/core/PImage.java index d669617f0..1c10a07e0 100644 --- a/core/src/processing/core/PImage.java +++ b/core/src/processing/core/PImage.java @@ -1839,8 +1839,8 @@ public class PImage implements PConstants, Cloneable { int dx = (int) (srcW / (float) destW * PRECISIONF); int dy = (int) (srcH / (float) destH * PRECISIONF); - srcXOffset = (int) (destX1 < 0 ? -destX1 * dx : srcX1 * PRECISIONF); - srcYOffset = (int) (destY1 < 0 ? -destY1 * dy : srcY1 * PRECISIONF); + srcXOffset = destX1 < 0 ? -destX1 * dx : srcX1 * PRECISIONF; + srcYOffset = destY1 < 0 ? -destY1 * dy : srcY1 * PRECISIONF; if (destX1 < 0) { destW += destX1; diff --git a/core/src/processing/core/PShape.java b/core/src/processing/core/PShape.java index 0fda5d236..4a65065c7 100644 --- a/core/src/processing/core/PShape.java +++ b/core/src/processing/core/PShape.java @@ -1220,7 +1220,7 @@ public class PShape implements PConstants { if (source instanceof PMatrix2D) { applyMatrix((PMatrix2D) source); } else if (source instanceof PMatrix3D) { - applyMatrix((PMatrix3D) source); + applyMatrix(source); } } diff --git a/core/src/processing/core/PShapeSVG.java b/core/src/processing/core/PShapeSVG.java index be19faa94..f6c432d88 100644 --- a/core/src/processing/core/PShapeSVG.java +++ b/core/src/processing/core/PShapeSVG.java @@ -1696,7 +1696,7 @@ public class PShapeSVG extends PShape { // 1) scale by the 1.0/unitsPerEm // 2) scale up by a font size g.pushMatrix(); - float s = size / (float) face.unitsPerEm; + float s = size / face.unitsPerEm; //System.out.println("scale is " + s); // swap y coord at the same time, since fonts have y=0 at baseline g.translate(x, y); @@ -1704,7 +1704,7 @@ public class PShapeSVG extends PShape { char[] c = str.toCharArray(); for (int i = 0; i < c.length; i++) { // call draw on each char (pulling it w/ the unicode table) - FontGlyph fg = (FontGlyph) unicodeGlyphs.get(new Character(c[i])); + FontGlyph fg = unicodeGlyphs.get(new Character(c[i])); if (fg != null) { fg.draw(g); // add horizAdvX/unitsPerEm to the x coordinate along the way @@ -1719,10 +1719,10 @@ public class PShapeSVG extends PShape { public void drawChar(PGraphics g, char c, float x, float y, float size) { g.pushMatrix(); - float s = size / (float) face.unitsPerEm; + float s = size / face.unitsPerEm; g.translate(x, y); g.scale(s, -s); - FontGlyph fg = (FontGlyph) unicodeGlyphs.get(new Character(c)); + FontGlyph fg = unicodeGlyphs.get(new Character(c)); if (fg != null) g.shape(fg); g.popMatrix(); } @@ -1733,7 +1733,7 @@ public class PShapeSVG extends PShape { char[] c = str.toCharArray(); for (int i = 0; i < c.length; i++) { // call draw on each char (pulling it w/ the unicode table) - FontGlyph fg = (FontGlyph) unicodeGlyphs.get(new Character(c[i])); + FontGlyph fg = unicodeGlyphs.get(new Character(c[i])); if (fg != null) { w += (float) fg.horizAdvX / face.unitsPerEm; } diff --git a/core/src/processing/core/Table.java b/core/src/processing/core/Table.java index 57db651ac..b3a472536 100644 --- a/core/src/processing/core/Table.java +++ b/core/src/processing/core/Table.java @@ -809,7 +809,7 @@ public class Table implements Iterable { columnIndices.put(columnTitles[col], col); } } - Integer index = (Integer) columnIndices.get(name); + Integer index = columnIndices.get(name); if (index == null) { if (report) { System.err.println("No column named '" + name + "' was found."); diff --git a/core/src/processing/core/XML.java b/core/src/processing/core/XML.java index 6e4a5b041..f0ca2b955 100644 --- a/core/src/processing/core/XML.java +++ b/core/src/processing/core/XML.java @@ -353,7 +353,7 @@ public class XML implements Serializable { if (offset == items.length-1) { return getChildren(items[offset]); } - XML[] matches = (XML[]) getChildren(items[offset]); + XML[] matches = getChildren(items[offset]); XML[] outgoing = new XML[0]; for (int i = 0; i < matches.length; i++) { XML[] kidMatches = matches[i].getChildrenRecursive(items, offset+1); diff --git a/core/todo.txt b/core/todo.txt index bdf619589..5c72f2386 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -2,6 +2,15 @@ X remove textMode(SCREEN) X added expand(long) and expand(double) because of Table +_ boolean sketchFullscreen() ? +_ for more options, just integrate the fs library? +_ http://www.superduper.org/processing/fullscreen_api/ +_ https://github.com/kritzikratzi/jAppleMenuBar/blob/master/src/native/jAppleMenuBar.m + +_ update wiki re: PNode... also include notes about the changes +_ add note about textMode(SCREEN) to the wiki +SCREEN was a super fast/efficient way of rendering text with P2D and P3D, but since they're going bye-bye and it's actually slower in the remaining renderers, it's going away. + _ PImage.save() with full path raises exception _ http://code.google.com/p/processing/issues/detail?id=808 _ if save() returns boolean, does saveFrame()? diff --git a/todo.txt b/todo.txt index 967c93f05..b327ad393 100644 --- a/todo.txt +++ b/todo.txt @@ -4,6 +4,9 @@ X re-upload with new version to include javac X HTML escapes for < and > not working properly X http://code.google.com/p/processing/issues/detail?id=771 +_ --bgcolor shouldn't be in main() unless 'present' is turned on +_ also add option for FSEM or not + _ library imports failing for libs that define the same packages in 1.5.1 _ http://code.google.com/p/processing/issues/detail?id=725