Revision d558d9bd
Added by Leszek Koltunski about 8 years ago
src/main/java/org/distorted/library/DistortedTexture.java | ||
---|---|---|
37 | 37 |
float mHalfX, mHalfY, mHalfZ; // halves of the above |
38 | 38 |
|
39 | 39 |
private long mID; |
40 |
private long mBitmapID=0; |
|
40 | 41 |
|
41 | 42 |
private Bitmap[] mBmp= null; // |
42 | 43 |
int[] mTextureDataH; // have to be shared among all the cloned Objects |
... | ... | |
96 | 97 |
|
97 | 98 |
long getBitmapID() |
98 | 99 |
{ |
99 |
return mBmp==null ? 0 : mBmp.hashCode(); |
|
100 |
if( mBmp!=null && mBitmapID==0 ) mBitmapID = mBmp.hashCode(); |
|
101 |
|
|
102 |
return mBitmapID; |
|
100 | 103 |
} |
101 | 104 |
|
105 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
106 |
|
|
107 |
long getID() |
|
108 |
{ |
|
109 |
return mID; |
|
110 |
} |
|
111 |
|
|
102 | 112 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
103 | 113 |
|
104 | 114 |
static synchronized void reset() |
... | ... | |
156 | 166 |
* |
157 | 167 |
* @param dt Source object to create our object from |
158 | 168 |
* @param flags A bitmask of values specifying what to copy. |
159 |
* For example, CLONE_BITMAP.
|
|
169 |
* Only possibilities: CLONE_BITMAP or CLONE_NOTHING.
|
|
160 | 170 |
*/ |
171 |
|
|
161 | 172 |
public DistortedTexture(DistortedTexture dt, int flags) |
162 | 173 |
{ |
163 | 174 |
mID = mNextID++; |
... | ... | |
189 | 200 |
} |
190 | 201 |
} |
191 | 202 |
|
192 |
|
|
193 | 203 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
194 | 204 |
/** |
195 | 205 |
* Releases all resources. |
... | ... | |
259 | 269 |
return mSizeZ; |
260 | 270 |
} |
261 | 271 |
|
262 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
263 |
/** |
|
264 |
* Returns unique ID of this instance. |
|
265 |
* |
|
266 |
* @return ID of the object. |
|
267 |
*/ |
|
268 |
public long getID() |
|
269 |
{ |
|
270 |
return mID; |
|
271 |
} |
|
272 |
|
|
273 | 272 |
} |
Also available in: Unified diff
Minor improvements in DistortedTexture.