Revision d425545a
Added by Leszek Koltunski almost 8 years ago
src/main/java/org/distorted/library/EffectQueue.java | ||
---|---|---|
22 | 22 |
import org.distorted.library.message.EffectListener; |
23 | 23 |
import org.distorted.library.message.EffectMessage; |
24 | 24 |
import org.distorted.library.type.Dynamic; |
25 |
import org.distorted.library.type.Dynamic2D; |
|
26 | 25 |
|
27 | 26 |
import java.util.Vector; |
28 | 27 |
|
... | ... | |
35 | 34 |
|
36 | 35 |
protected int[] mType; |
37 | 36 |
protected float[] mUniforms; |
38 |
protected Dynamic[] mInterP; // center of the effect |
|
39 |
protected Dynamic[] mInterI; // all other interpolated values |
|
37 |
protected Dynamic[][] mInter; // center of the effect |
|
40 | 38 |
protected long[] mCurrentDuration; |
41 | 39 |
protected byte[] mFreeIndexes; |
42 | 40 |
protected byte[] mIDIndex; |
... | ... | |
80 | 78 |
{ |
81 | 79 |
mType = new int[mMax[mMaxIndex]]; |
82 | 80 |
mUniforms = new float[numUniforms*mMax[mMaxIndex]]; |
83 |
mInterI = new Dynamic[mMax[mMaxIndex]]; |
|
84 |
mInterP = new Dynamic[mMax[mMaxIndex]]; |
|
81 |
mInter = new Dynamic[3][mMax[mMaxIndex]]; |
|
85 | 82 |
mCurrentDuration = new long[mMax[mMaxIndex]]; |
86 | 83 |
mID = new long[mMax[mMaxIndex]]; |
87 | 84 |
mIDIndex = new byte[mMax[mMaxIndex]]; |
... | ... | |
205 | 202 |
|
206 | 203 |
for(int i=0; i<ret; i++ ) |
207 | 204 |
{ |
208 |
mInterI[i] = null; |
|
209 |
mInterP[i] = null; |
|
205 |
mInter[0][i] = null; |
|
206 |
mInter[1][i] = null; |
|
207 |
mInter[2][i] = null; |
|
210 | 208 |
} |
211 | 209 |
|
212 | 210 |
mNumEffects= 0; |
... | ... | |
236 | 234 |
for(int j=effect; j<mNumEffects; j++ ) |
237 | 235 |
{ |
238 | 236 |
mType[j] = mType[j+1]; |
239 |
mInterI[j] = mInterI[j+1]; |
|
240 |
mInterP[j] = mInterP[j+1]; |
|
237 |
mInter[0][j] = mInter[0][j+1]; |
|
238 |
mInter[1][j] = mInter[1][j+1]; |
|
239 |
mInter[2][j] = mInter[2][j+1]; |
|
241 | 240 |
mCurrentDuration[j] = mCurrentDuration[j+1]; |
242 | 241 |
mID[j] = mID[j+1]; |
243 | 242 |
|
244 | 243 |
moveEffect(j); |
245 | 244 |
} |
246 | 245 |
|
247 |
mInterI[mNumEffects] = null; |
|
248 |
mInterP[mNumEffects] = null; |
|
249 |
|
|
246 |
mInter[0][mNumEffects] = null; |
|
247 |
mInter[1][mNumEffects] = null; |
|
248 |
mInter[2][mNumEffects] = null; |
|
249 |
|
|
250 | 250 |
for(int i=0; i<mNumListeners; i++) |
251 | 251 |
EffectMessageSender.newMessage( mListeners.elementAt(i), |
252 | 252 |
EffectMessage.EFFECT_REMOVED, |
... | ... | |
314 | 314 |
|
315 | 315 |
if( index>=0 ) |
316 | 316 |
{ |
317 |
boolean interI = mInterI[index]==null; |
|
318 |
boolean interP = mInterP[index]==null; |
|
319 |
|
|
320 |
android.util.Log.e("EffectQueue", "numEffects="+mNumEffects+" effect id="+id+" index="+index+" duration="+mCurrentDuration[index]+" interI null="+interI+" interP null="+interP); |
|
317 |
boolean inter0 = mInter[0][index]==null; |
|
318 |
boolean inter1 = mInter[1][index]==null; |
|
319 |
boolean inter2 = mInter[2][index]==null; |
|
320 |
|
|
321 |
android.util.Log.e("EffectQueue", "numEffects="+mNumEffects+" effect id="+id+" index="+index+ |
|
322 |
" duration="+mCurrentDuration[index]+" inter[0] null="+inter0+" inter[1] null="+inter1+" inter[2] null="+inter2); |
|
321 | 323 |
|
322 |
if( interI==false )
|
|
324 |
if( inter0==false )
|
|
323 | 325 |
{ |
324 |
android.util.Log.e("EffectQueue","interI: "+mInterI[index].print());
|
|
326 |
android.util.Log.e("EffectQueue","inter[0]: "+mInter[0][index].print());
|
|
325 | 327 |
} |
326 |
if( interP==false )
|
|
328 |
if( inter1==false )
|
|
327 | 329 |
{ |
328 |
android.util.Log.e("EffectQueue","interP: "+mInterP[index].print());
|
|
330 |
android.util.Log.e("EffectQueue","inter[1]: "+mInter[1][index].print());
|
|
329 | 331 |
} |
330 |
|
|
332 |
if( inter2==false ) |
|
333 |
{ |
|
334 |
android.util.Log.e("EffectQueue","inter[2]: "+mInter[2][index].print()); |
|
335 |
} |
|
336 |
|
|
331 | 337 |
return true; |
332 | 338 |
} |
333 | 339 |
|
Also available in: Unified diff
Some more progress with porting apps to new VERTEX API.