/* */ package NET.worlds.scape; /* */ /* */ import NET.worlds.network.URL; /* */ import java.io.IOException; /* */ import java.net.MalformedURLException; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public abstract class Texture /* */ implements Persister /* */ { /* 30 */ protected int textureID = 0; /* 31 */ int refs = 1; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ static /* */ { /* 44 */ nativeInit(); /* */ } /* */ /* */ public static native void nativeInit(); /* */ /* */ private static native int nativeGetW(int paramInt); /* */ /* 51 */ public int getW() { return nativeGetW(this.textureID); } /* */ /* */ /* */ private static native int nativeGetH(int paramInt); /* */ /* */ public int getH() /* */ { /* 58 */ return nativeGetH(this.textureID); /* */ } /* */ /* 61 */ private static Object classCookie = new Object(); /* */ /* */ public URL getURL() /* */ { /* 65 */ URL u = null; /* 66 */ String s = getName(); /* 67 */ if (s != null) { /* */ try { /* 69 */ u = new URL(URL.getCurDir(), s); /* */ } /* */ catch (MalformedURLException localMalformedURLException) {} /* */ } /* 73 */ return u; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ public void incRef() /* */ { /* 82 */ assert (this.refs > 0); /* */ /* 84 */ if (this.textureID != 0) { /* 85 */ this.refs += 1; /* */ } /* */ } /* */ /* */ /* */ public void copyFrom(int dc, int x1, int x2, int y1, int y2) /* */ { /* 92 */ assert (this.textureID != 0); /* 93 */ nativeCopyFrom(this.textureID, dc, x1, x2, y1, y2); /* */ } /* */ /* */ /* */ /* */ private static native void nativeCopyFrom(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6); /* */ /* */ /* */ private static native void nativeRelease(int paramInt); /* */ /* */ /* */ public synchronized void decRef() /* */ { /* 106 */ if (--this.refs <= 0) /* */ { /* */ /* 109 */ if (this.textureID != 0) { /* 110 */ nativeRelease(this.textureID); /* 111 */ this.textureID = 0; /* */ } /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ protected void finalize() /* */ { /* 121 */ if (this.refs > 0) { /* 122 */ this.refs = 1; /* 123 */ decRef(); /* */ /* */ /* 126 */ this.refs = 1000000; /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ protected String getName() /* */ { /* 135 */ return null; /* */ } /* */ /* */ public void saveState(Saver s) throws IOException { /* 139 */ s.saveVersion(0, classCookie); /* */ } /* */ /* */ public void restoreState(Restorer r) /* */ throws IOException, TooNewException /* */ { /* 145 */ switch (r.restoreVersion(classCookie)) /* */ { /* */ case 0: /* */ break; /* */ /* */ default: /* 151 */ throw new TooNewException(); /* */ } /* */ } /* */ /* */ public void postRestore(int version) {} /* */ } /* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\Texture.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */