/* */ package NET.worlds.scape; /* */ /* */ import NET.worlds.console.Console; /* */ import NET.worlds.network.URL; /* */ import java.io.IOException; /* */ import java.util.Hashtable; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class ScapePicMovie /* */ implements Persister /* */ { /* */ static {} /* */ /* */ public ScapePicMovie() {} /* */ /* */ public ScapePicMovie(String localName, URL url) /* */ { /* 54 */ this.localName = localName; /* 55 */ this.url = url; /* 56 */ this.movie = getAll(); /* */ } /* */ /* */ /* */ public static native void nativeInit(); /* */ /* */ /* */ public int getW() /* */ { /* 65 */ return this.width; /* */ } /* */ /* */ public int getH() /* */ { /* 70 */ return this.height; /* */ } /* */ /* */ public int length() /* */ { /* 75 */ return this.frameCount; /* */ } /* */ /* */ public URL getURL() /* */ { /* 80 */ return this.url; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ public ScapePicTexture getTexture(int frameNumber) /* */ { /* 90 */ ScapePicTexture ret = null; /* 91 */ if (this.movie != null) { /* 92 */ ret = this.movie[frameNumber]; /* 93 */ this.movie[frameNumber] = null; /* */ /* */ /* */ /* */ /* 98 */ for (int i = 0; i < this.frameCount; i++) /* 99 */ if (this.movie[i] != null) /* */ break; /* 101 */ if (i == this.frameCount) /* 102 */ this.movie = null; /* */ } /* 104 */ return ret; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ public ScapePicTexture[] getTextures() /* */ { /* 113 */ ScapePicTexture[] ret = this.movie; /* 114 */ this.movie = null; /* 115 */ return ret; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 127 */ private static Hashtable movieDict = new Hashtable(); /* */ private ScapePicTexture[] movie; /* */ private String localName; /* */ private URL url; /* */ private int frameCount; /* */ private int width; /* */ private int height; /* */ /* */ private synchronized ScapePicTexture[] getAll() /* */ { /* 137 */ String name = this.url.getAbsolute(); /* */ /* */ /* */ /* 141 */ ScapePicMovie proto = (ScapePicMovie)movieDict.get(name); /* 142 */ ScapePicTexture[] a = null; /* 143 */ if (proto != null) { /* 144 */ this.frameCount = proto.length(); /* 145 */ this.width = proto.getW(); /* 146 */ this.height = proto.getH(); /* */ /* */ /* */ /* 150 */ a = lookupTextures(name, this.frameCount, this.width, this.height); /* */ } /* */ /* 153 */ if (a == null) /* */ { /* */ /* 156 */ a = makeTextures(this.localName, name); /* */ /* */ /* */ /* 160 */ if ((a != null) && (proto == null)) { /* 161 */ this.frameCount = a.length; /* 162 */ this.width = a[0].getW(); /* 163 */ this.height = a[0].getH(); /* 164 */ movieDict.put(name, this); /* */ } /* */ } /* 167 */ return a; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private native ScapePicTexture[] lookupTextures(String paramString, int paramInt1, int paramInt2, int paramInt3); /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private native ScapePicTexture[] makeTextures(String paramString1, String paramString2); /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 221 */ private static Object classCookie = new Object(); /* */ /* */ public void saveState(Saver s) throws IOException { /* 224 */ Console.println(Console.message("Obs-ScapePicMov") + this.url); /* 225 */ s.saveVersion(2, classCookie); /* 226 */ this.url.save(s); /* */ } /* */ /* */ public void restoreState(Restorer r) throws IOException, TooNewException { /* 230 */ switch (r.restoreVersion(classCookie)) { /* */ case 2: /* 232 */ this.url = URL.restore(r); /* 233 */ this.localName = this.url.unalias(); /* 234 */ break; /* */ case 1: /* 236 */ this.localName = r.restoreString(); /* 237 */ this.url = URL.make(this.localName); /* 238 */ break; /* */ case 0: /* 240 */ this.localName = r.restoreString(); /* 241 */ this.url = URL.make(this.localName); /* 242 */ r.restoreBoolean(); /* 243 */ break; /* */ default: /* 245 */ throw new TooNewException(); /* */ } /* 247 */ this.movie = getAll(); /* */ } /* */ /* */ /* */ public void postRestore(int version) {} /* */ /* */ public String toString() /* */ { /* 255 */ return this.url.getAbsolute(); /* */ } /* */ } /* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\ScapePicMovie.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */