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/EffectQueueVertex.java
23 23

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

  
29 28
///////////////////////////////////////////////////////////////////////////////////////////////////
......
40 39

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

  
48 47
///////////////////////////////////////////////////////////////////////////////////////////////////
......
69 68

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

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

Also available in: Unified diff