From: adam Date: Wed, 29 Dec 2004 07:26:03 +0000 (+0000) Subject: switched from builtin.jar to using util.Encode X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=commitdiff_plain;h=439e58899c718846994d6389ece66ee73a9045ed switched from builtin.jar to using util.Encode darcs-hash:20041229072603-5007d-5919ae281d55c4e20b7f5aa2765b153a3c0fa895.gz --- diff --git a/src/org/ibex/core/Main.java b/src/org/ibex/core/Main.java index 0a4ff91..ceb7efa 100644 --- a/src/org/ibex/core/Main.java +++ b/src/org/ibex/core/Main.java @@ -8,6 +8,7 @@ import org.ibex.js.*; import org.ibex.util.*; import org.ibex.plat.*; import org.ibex.graphics.*; +import org.ibex.core.builtin.*; /** Entry point for the Ibex Engine; handles splash screen, initial xwar loading, and argument processing */ public class Main { @@ -94,7 +95,7 @@ public class Main { final Ibex ibex = new Ibex(rr); org.ibex.graphics.Surface.scarImage = - Picture.load(Main.builtin.get(JS.S("org/ibex/core/builtin/scar.png")), + Picture.load(new Stream.FromInputStream(Encode.JavaSourceCode.decode(Scar.data)), new Task() { public void perform() throws JSExn, UnknownHostException { if (Log.on) Log.info(Main.class, "invoking initial template"); ibex.resolveString(startupTemplate, false).call(new Box(), null, null, null, 1); diff --git a/src/org/ibex/core/Stream.java b/src/org/ibex/core/Stream.java index 60afa46..a17c9b8 100644 --- a/src/org/ibex/core/Stream.java +++ b/src/org/ibex/core/Stream.java @@ -109,6 +109,14 @@ public abstract class Stream extends JS.O implements JS.Cloneable { public InputStream getInputStream() throws IOException { return Platform.getBuiltinInputStream(); } } + /** the Builtin resource */ + public static class FromInputStream extends Stream { + private final InputStream is; + public FromInputStream(InputStream is) { this.is = is; } + public String getCacheKey() throws NotCacheableException { throw new NotCacheableException(); } + public InputStream getInputStream() throws IOException { return is; } + } + /** shadow resource which replaces the graft */ public static class ProgressWatcher extends Stream { final Stream watchee;