From bf6984d8e28f7c4fd6f7554d77c3a47b4aeefb90 Mon Sep 17 00:00:00 2001 From: benfry Date: Fri, 29 Oct 2004 21:39:22 +0000 Subject: [PATCH] hack to fix loadImage() for now --- processing/core/PApplet.java | 13 ++++++++++--- processing/core/todo.txt | 4 ++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/processing/core/PApplet.java b/processing/core/PApplet.java index e77ca8340..575c2c1a8 100644 --- a/processing/core/PApplet.java +++ b/processing/core/PApplet.java @@ -1812,6 +1812,7 @@ public class PApplet extends Applet // IMAGE I/O + /* private Image gimmeImage(URL url, boolean force) { Toolkit tk = Toolkit.getDefaultToolkit(); @@ -1863,6 +1864,7 @@ public class PApplet extends Applet return null; } } + */ public PImage loadImage(String filename) { if (filename.toLowerCase().endsWith(".tga")) { @@ -1876,6 +1878,7 @@ public class PApplet extends Applet Image awtimage = null; //String randomizer = "?" + nf((int) (random()*10000), 4); + /* if (filename.startsWith("http://")) { try { URL url = new URL(filename); @@ -1907,6 +1910,10 @@ public class PApplet extends Applet } } } + */ + + awtimage = Toolkit.getDefaultToolkit().createImage(loadBytes(filename)); + if (awtimage == null) { System.err.println("could not load image " + filename); return null; @@ -4165,7 +4172,7 @@ public class PApplet extends Applet } - public void copy(int sx1, int sy1, int sx2, int sy2, + public void copy(int sx1, int sy1, int sx2, int sy2, int dx1, int dy1, int dx2, int dy2) { g.copy(sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2); } @@ -4192,13 +4199,13 @@ public class PApplet extends Applet } - public void blend(int sx1, int sy1, int sx2, int sy2, + public void blend(int sx1, int sy1, int sx2, int sy2, int dx1, int dy1, int dx2, int dy2, int mode) { g.blend(sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2, mode); } - public void blend(PImage src, int sx1, int sy1, int sx2, int sy2, + public void blend(PImage src, int sx1, int sy1, int sx2, int sy2, int dx1, int dy1, int dx2, int dy2, int mode) { g.blend(src, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2, mode); } diff --git a/processing/core/todo.txt b/processing/core/todo.txt index 3795a7c70..e8baf75ce 100644 --- a/processing/core/todo.txt +++ b/processing/core/todo.txt @@ -1,5 +1,9 @@ 0072 core X make m00, m01 etc public +X hack to make loadImage() work +X cache settings are ignored, may be slow as hell + +_ loadImage() is mostly broken _ go through and figure out what stuff to make public