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/EffectQueueMatrix.java
24 24

  
25 25
import org.distorted.library.effect.EffectType;
26 26
import org.distorted.library.effect.MatrixEffect;
27
import org.distorted.library.message.EffectMessage;
28 27
import org.distorted.library.message.EffectMessageSender;
29 28

  
30 29
///////////////////////////////////////////////////////////////////////////////////////////////////
......
48 47

  
49 48
///////////////////////////////////////////////////////////////////////////////////////////////////
50 49
   
51
  EffectQueueMatrix(long id)
50
  EffectQueueMatrix()
52 51
    { 
53
    super(id,NUM_UNIFORMS,INDEX );
52
    super(NUM_UNIFORMS,INDEX );
54 53
    }
55 54

  
56 55
///////////////////////////////////////////////////////////////////////////////////////////////////
......
128 127

  
129 128
      if( mEffects[i].compute(mUniforms, NUM_UNIFORMS*i, mCurrentDuration[i], step) )
130 129
        {
131
        for(int j=0; j<mNumListeners; j++)
132
          EffectMessageSender.newMessage( mListeners.get(j), EffectMessage.EFFECT_FINISHED, mEffects[i].getID(), mDistortedEffectsID);
130
        EffectMessageSender.newMessage(mEffects[i]);
133 131
        }
134 132
      }
135 133
     

Also available in: Unified diff