Revision d425545a
Added by Leszek Koltunski almost 8 years ago
src/main/java/org/distorted/library/EffectQueueFragment.java | ||
---|---|---|
27 | 27 |
import org.distorted.library.type.Dynamic1D; |
28 | 28 |
import org.distorted.library.type.Dynamic4D; |
29 | 29 |
import org.distorted.library.type.Static1D; |
30 |
import org.distorted.library.type.Static2D; |
|
31 | 30 |
import org.distorted.library.type.Static3D; |
32 | 31 |
import org.distorted.library.type.Static4D; |
33 |
import org.distorted.library.type.Dynamic; |
|
34 |
import org.distorted.library.type.Dynamic2D; |
|
35 | 32 |
|
36 | 33 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
37 | 34 |
|
... | ... | |
75 | 72 |
|
76 | 73 |
for(int i=0; i<mNumEffects; i++) |
77 | 74 |
{ |
78 |
if( mInterI[i]==null ) continue;
|
|
75 |
if( mInter[0][i]==null ) continue;
|
|
79 | 76 |
|
80 |
if( mInterP[i]!=null ) mInterP[i].interpolateMain(mBuf, 4*i, mCurrentDuration[i]);
|
|
77 |
if( mInter[1][i]!=null ) mInter[1][i].interpolateMain(mBuf, 4*i, mCurrentDuration[i]);
|
|
81 | 78 |
|
82 |
if( mInterI[i].interpolateMain(mUniforms ,NUM_UNIFORMS*i, mCurrentDuration[i], step) )
|
|
79 |
if( mInter[0][i].interpolateMain(mUniforms ,NUM_UNIFORMS*i, mCurrentDuration[i], step) )
|
|
83 | 80 |
{ |
84 | 81 |
for(int j=0; j<mNumListeners; j++) |
85 | 82 |
EffectMessageSender.newMessage( mListeners.elementAt(j), |
... | ... | |
180 | 177 |
EffectNames.fillWithUnities(eln.ordinal(), mUniforms, NUM_UNIFORMS*mNumEffects); |
181 | 178 |
|
182 | 179 |
if( data instanceof Dynamic1D) |
183 |
mInterI[mNumEffects] = (Dynamic1D)data;
|
|
180 |
mInter[0][mNumEffects] = (Dynamic1D)data;
|
|
184 | 181 |
else if( data instanceof Static1D ) |
185 | 182 |
{ |
186 |
mInterI[mNumEffects] = null;
|
|
183 |
mInter[0][mNumEffects] = null;
|
|
187 | 184 |
mUniforms[NUM_UNIFORMS*mNumEffects] = ((Static1D)data).getX(); |
188 | 185 |
} |
189 | 186 |
else return -1; |
190 | 187 |
|
191 |
mInterP[mNumEffects] = null;
|
|
188 |
mInter[1][mNumEffects] = null;
|
|
192 | 189 |
mBuf[4*mNumEffects+2] = 1000*mObjHalfX; |
193 | 190 |
mBuf[4*mNumEffects+3] = 1000*mObjHalfY; |
194 | 191 |
|
... | ... | |
208 | 205 |
EffectNames.fillWithUnities(eln.ordinal(), mUniforms, NUM_UNIFORMS*mNumEffects); |
209 | 206 |
|
210 | 207 |
if( data instanceof Dynamic1D) |
211 |
mInterI[mNumEffects] = (Dynamic1D)data;
|
|
208 |
mInter[0][mNumEffects] = (Dynamic1D)data;
|
|
212 | 209 |
else if( data instanceof Static1D ) |
213 | 210 |
{ |
214 |
mInterI[mNumEffects] = null;
|
|
211 |
mInter[0][mNumEffects] = null;
|
|
215 | 212 |
mUniforms[NUM_UNIFORMS*mNumEffects] = ((Static1D)data).getX(); |
216 | 213 |
} |
217 | 214 |
else return -1; |
218 | 215 |
|
219 | 216 |
if( region instanceof Dynamic4D) |
220 |
mInterP[mNumEffects] = (Dynamic4D)region;
|
|
217 |
mInter[1][mNumEffects] = (Dynamic4D)region;
|
|
221 | 218 |
else if( region instanceof Static4D ) |
222 | 219 |
{ |
223 |
mInterP[mNumEffects] = null;
|
|
220 |
mInter[1][mNumEffects] = null;
|
|
224 | 221 |
mBuf[4*mNumEffects ] = ((Static4D)region).getX(); |
225 | 222 |
mBuf[4*mNumEffects+1] = ((Static4D)region).getY(); |
226 | 223 |
mBuf[4*mNumEffects+2] = ((Static4D)region).getZ(); |
... | ... | |
244 | 241 |
EffectNames.fillWithUnities(eln.ordinal(), mUniforms, NUM_UNIFORMS*mNumEffects); |
245 | 242 |
|
246 | 243 |
if( level instanceof Dynamic1D) |
247 |
mInterI[mNumEffects] = (Dynamic1D)level;
|
|
244 |
mInter[0][mNumEffects] = (Dynamic1D)level;
|
|
248 | 245 |
else if( level instanceof Static1D ) |
249 | 246 |
{ |
250 |
mInterI[mNumEffects] = null;
|
|
247 |
mInter[0][mNumEffects] = null;
|
|
251 | 248 |
mUniforms[NUM_UNIFORMS*mNumEffects] = ((Static1D)level).getX(); |
252 | 249 |
} |
253 | 250 |
else return -1; |
... | ... | |
257 | 254 |
mUniforms[NUM_UNIFORMS*mNumEffects+3] = color.getZ(); |
258 | 255 |
|
259 | 256 |
if( region instanceof Dynamic4D) |
260 |
mInterP[mNumEffects] = (Dynamic4D)region;
|
|
257 |
mInter[1][mNumEffects] = (Dynamic4D)region;
|
|
261 | 258 |
else if( region instanceof Static4D ) |
262 | 259 |
{ |
263 |
mInterP[mNumEffects] = null;
|
|
260 |
mInter[1][mNumEffects] = null;
|
|
264 | 261 |
mBuf[4*mNumEffects ] = ((Static4D)region).getX(); |
265 | 262 |
mBuf[4*mNumEffects+1] = ((Static4D)region).getY(); |
266 | 263 |
mBuf[4*mNumEffects+2] = ((Static4D)region).getZ(); |
... | ... | |
284 | 281 |
EffectNames.fillWithUnities(eln.ordinal(), mUniforms, NUM_UNIFORMS*mNumEffects); |
285 | 282 |
|
286 | 283 |
if( level instanceof Dynamic1D) |
287 |
mInterI[mNumEffects] = (Dynamic1D)level;
|
|
284 |
mInter[0][mNumEffects] = (Dynamic1D)level;
|
|
288 | 285 |
else if( level instanceof Static1D ) |
289 | 286 |
{ |
290 |
mInterI[mNumEffects] = null;
|
|
287 |
mInter[0][mNumEffects] = null;
|
|
291 | 288 |
mUniforms[NUM_UNIFORMS*mNumEffects] = ((Static1D)level).getX(); |
292 | 289 |
} |
293 | 290 |
else return -1; |
... | ... | |
296 | 293 |
mUniforms[NUM_UNIFORMS*mNumEffects+2] = color.getY(); |
297 | 294 |
mUniforms[NUM_UNIFORMS*mNumEffects+3] = color.getZ(); |
298 | 295 |
|
299 |
mInterP[mNumEffects] = null; //
|
|
296 |
mInter[1][mNumEffects] = null; //
|
|
300 | 297 |
mBuf[4*mNumEffects+2] = 1000*mObjHalfX; // i.e. null region |
301 | 298 |
mBuf[4*mNumEffects+3] = 1000*mObjHalfY; // |
302 | 299 |
|
... | ... | |
316 | 313 |
EffectNames.fillWithUnities(eln.ordinal(), mUniforms, NUM_UNIFORMS*mNumEffects); |
317 | 314 |
|
318 | 315 |
if( chroma instanceof Dynamic4D) |
319 |
mInterI[mNumEffects] = (Dynamic4D)chroma;
|
|
316 |
mInter[0][mNumEffects] = (Dynamic4D)chroma;
|
|
320 | 317 |
else if( chroma instanceof Static4D ) |
321 | 318 |
{ |
322 |
mInterI[mNumEffects] = null;
|
|
319 |
mInter[0][mNumEffects] = null;
|
|
323 | 320 |
mUniforms[NUM_UNIFORMS*mNumEffects ] = ((Static4D)chroma).getX(); |
324 | 321 |
mUniforms[NUM_UNIFORMS*mNumEffects+1] = ((Static4D)chroma).getY(); |
325 | 322 |
mUniforms[NUM_UNIFORMS*mNumEffects+2] = ((Static4D)chroma).getZ(); |
... | ... | |
328 | 325 |
else return -1; |
329 | 326 |
|
330 | 327 |
if( region instanceof Dynamic4D) |
331 |
mInterP[mNumEffects] = (Dynamic4D)region;
|
|
328 |
mInter[1][mNumEffects] = (Dynamic4D)region;
|
|
332 | 329 |
else if( region instanceof Static4D ) |
333 | 330 |
{ |
334 |
mInterP[mNumEffects] = null;
|
|
331 |
mInter[1][mNumEffects] = null;
|
|
335 | 332 |
mBuf[4*mNumEffects ] = ((Static4D)region).getX(); |
336 | 333 |
mBuf[4*mNumEffects+1] = ((Static4D)region).getY(); |
337 | 334 |
mBuf[4*mNumEffects+2] = ((Static4D)region).getZ(); |
... | ... | |
355 | 352 |
EffectNames.fillWithUnities(eln.ordinal(), mUniforms, NUM_UNIFORMS*mNumEffects); |
356 | 353 |
|
357 | 354 |
if( chroma instanceof Dynamic4D) |
358 |
mInterI[mNumEffects] = (Dynamic4D)chroma;
|
|
355 |
mInter[0][mNumEffects] = (Dynamic4D)chroma;
|
|
359 | 356 |
else if( chroma instanceof Static4D ) |
360 | 357 |
{ |
361 |
mInterI[mNumEffects] = null;
|
|
358 |
mInter[0][mNumEffects] = null;
|
|
362 | 359 |
mUniforms[NUM_UNIFORMS*mNumEffects ] = ((Static4D)chroma).getX(); |
363 | 360 |
mUniforms[NUM_UNIFORMS*mNumEffects+1] = ((Static4D)chroma).getY(); |
364 | 361 |
mUniforms[NUM_UNIFORMS*mNumEffects+2] = ((Static4D)chroma).getZ(); |
... | ... | |
366 | 363 |
} |
367 | 364 |
else return -1; |
368 | 365 |
|
369 |
mInterP[mNumEffects] = null; //
|
|
366 |
mInter[1][mNumEffects] = null; //
|
|
370 | 367 |
mBuf[4*mNumEffects+2] = 1000*mObjHalfX; // i.e. null region |
371 | 368 |
mBuf[4*mNumEffects+3] = 1000*mObjHalfY; // |
372 | 369 |
|
Also available in: Unified diff
Some more progress with porting apps to new VERTEX API.