Revision e8c81a8e
Added by Leszek Koltunski almost 8 years ago
src/main/java/org/distorted/library/EffectQueue.java | ||
---|---|---|
32 | 32 |
protected byte mNumEffects; // number of effects at the moment |
33 | 33 |
protected long mTotalEffects; // total number of effects ever created |
34 | 34 |
|
35 |
protected int[] mType;
|
|
35 |
protected int[] mName;
|
|
36 | 36 |
protected float[] mUniforms; |
37 | 37 |
protected Dynamic[][] mInter; // center of the effect |
38 | 38 |
protected long[] mCurrentDuration; |
... | ... | |
76 | 76 |
|
77 | 77 |
if( mMax[mMaxIndex]>0 ) |
78 | 78 |
{ |
79 |
mType = new int[mMax[mMaxIndex]];
|
|
79 |
mName = new int[mMax[mMaxIndex]];
|
|
80 | 80 |
mUniforms = new float[numUniforms*mMax[mMaxIndex]]; |
81 | 81 |
mInter = new Dynamic[3][mMax[mMaxIndex]]; |
82 | 82 |
mCurrentDuration = new long[mMax[mMaxIndex]]; |
... | ... | |
175 | 175 |
|
176 | 176 |
for(int i=0; i<mNumEffects; i++) |
177 | 177 |
{ |
178 |
if( mType[i]==ord )
|
|
178 |
if( mName[i]==ord )
|
|
179 | 179 |
{ |
180 | 180 |
remove(i); |
181 | 181 |
i--; |
... | ... | |
202 | 202 |
{ |
203 | 203 |
int ret = mNumEffects; |
204 | 204 |
long removedID; |
205 |
int removedType;
|
|
205 |
int removedName;
|
|
206 | 206 |
|
207 | 207 |
for(int i=0; i<ret; i++ ) |
208 | 208 |
{ |
... | ... | |
213 | 213 |
if( notify ) |
214 | 214 |
{ |
215 | 215 |
removedID = mID[i]; |
216 |
removedType= mType[i];
|
|
216 |
removedName= mName[i];
|
|
217 | 217 |
|
218 | 218 |
for(int j=0; j<mNumListeners; j++) |
219 | 219 |
EffectMessageSender.newMessage( mListeners.elementAt(j), |
220 | 220 |
EffectMessage.EFFECT_REMOVED, |
221 |
(removedID<<EffectTypes.LENGTH)+EffectNames.getType(removedType).type,
|
|
222 |
removedType,
|
|
221 |
(removedID<<EffectTypes.LENGTH)+EffectNames.getType(removedName).type,
|
|
222 |
removedName,
|
|
223 | 223 |
mBitmapID, |
224 | 224 |
null); |
225 | 225 |
} |
... | ... | |
242 | 242 |
mFreeIndexes[mNumEffects] = removedIndex; |
243 | 243 |
|
244 | 244 |
long removedID = mID[effect]; |
245 |
int removedType= mType[effect];
|
|
245 |
int removedName= mName[effect];
|
|
246 | 246 |
|
247 | 247 |
for(int j=0; j<mMax[mMaxIndex]; j++) |
248 | 248 |
{ |
... | ... | |
251 | 251 |
|
252 | 252 |
for(int j=effect; j<mNumEffects; j++ ) |
253 | 253 |
{ |
254 |
mType[j] = mType[j+1];
|
|
254 |
mName[j] = mName[j+1];
|
|
255 | 255 |
mInter[0][j] = mInter[0][j+1]; |
256 | 256 |
mInter[1][j] = mInter[1][j+1]; |
257 | 257 |
mInter[2][j] = mInter[2][j+1]; |
... | ... | |
268 | 268 |
for(int i=0; i<mNumListeners; i++) |
269 | 269 |
EffectMessageSender.newMessage( mListeners.elementAt(i), |
270 | 270 |
EffectMessage.EFFECT_REMOVED, |
271 |
(removedID<<EffectTypes.LENGTH)+EffectNames.getType(removedType).type,
|
|
272 |
removedType,
|
|
271 |
(removedID<<EffectTypes.LENGTH)+EffectNames.getType(removedName).type,
|
|
272 |
removedName,
|
|
273 | 273 |
mBitmapID, |
274 | 274 |
null); |
275 | 275 |
} |
276 | 276 |
|
277 | 277 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
278 | 278 |
|
279 |
protected long addBase(EffectNames eln)
|
|
279 |
protected long addBase(EffectNames name)
|
|
280 | 280 |
{ |
281 |
mType[mNumEffects] = eln.ordinal();
|
|
281 |
mName[mNumEffects] = name.ordinal();
|
|
282 | 282 |
mCurrentDuration[mNumEffects] = 0; |
283 | 283 |
|
284 | 284 |
int index = mFreeIndexes[mNumEffects]; |
... | ... | |
289 | 289 |
mNumEffects++; |
290 | 290 |
mTotalEffects++; |
291 | 291 |
|
292 |
return (id<<EffectTypes.LENGTH)+eln.getType().type;
|
|
292 |
return (id<<EffectTypes.LENGTH)+name.getType().type;
|
|
293 | 293 |
} |
294 | 294 |
|
295 | 295 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Cleanup, consistent variable names, minor details.