Project

General

Profile

« Previous | Next » 

Revision 20dbec0e

Added by Leszek Koltunski about 5 years ago

Simplify the way applications can get notifications when an effect finishes.

Now, instead of the 'DistortedEffects.(de)registerForNotifications()' 2 APIs, we call a single 'Effect.notifyWhenFinished()'.

View differences:

src/main/java/org/distorted/library/effectqueue/EffectQueueFragment.java
23 23

  
24 24
import org.distorted.library.effect.EffectType;
25 25
import org.distorted.library.effect.FragmentEffect;
26
import org.distorted.library.message.EffectMessage;
27 26
import org.distorted.library.message.EffectMessageSender;
28 27

  
29 28
///////////////////////////////////////////////////////////////////////////////////////////////////
......
39 38

  
40 39
///////////////////////////////////////////////////////////////////////////////////////////////////
41 40
   
42
  EffectQueueFragment(long id)
41
  EffectQueueFragment()
43 42
    { 
44
    super(id,NUM_UNIFORMS,INDEX);
43
    super(NUM_UNIFORMS,INDEX);
45 44
    }
46 45

  
47 46
///////////////////////////////////////////////////////////////////////////////////////////////////
......
67 66

  
68 67
      if( mEffects[i].compute(mUniforms, NUM_UNIFORMS*i, mCurrentDuration[i], step) )
69 68
        {
70
        for(int j=0; j<mNumListeners; j++)
71
          EffectMessageSender.newMessage( mListeners.get(j), EffectMessage.EFFECT_FINISHED, mEffects[i].getID(), mDistortedEffectsID);
69
        EffectMessageSender.newMessage(mEffects[i]);
72 70
        }
73 71

  
74 72
      mUniforms[NUM_UNIFORMS*i+5] -= halfX;

Also available in: Unified diff