summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/Texture.java
blob: 4d68b7f17e15a4c5297212d1f5650fa4116758d4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/*     */ 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
 */