switched from builtin.jar to using util.Encode
authoradam <adam@megacz.com>
Wed, 29 Dec 2004 07:26:03 +0000 (07:26 +0000)
committeradam <adam@megacz.com>
Wed, 29 Dec 2004 07:26:03 +0000 (07:26 +0000)
darcs-hash:20041229072603-5007d-5919ae281d55c4e20b7f5aa2765b153a3c0fa895.gz

src/org/ibex/core/Main.java
src/org/ibex/core/Stream.java

index 0a4ff91..ceb7efa 100644 (file)
@@ -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);
index 60afa46..a17c9b8 100644 (file)
@@ -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;