Project

General

Profile

« Previous | Next » 

Revision 0273ef2a

Added by Leszek Koltunski almost 4 years ago

Fixes for pausing and restarting.

View differences:

src/main/java/org/distorted/library/effectqueue/EffectQueue.java
48 48
  private int mNumEffectsToBe;  // added them yet (or less if it hasn't removed some yet)
49 49
  float[] mUniforms;
50 50
  private int mNumUniforms;
51
  long[] mCurrentDuration;
52 51
  Effect[] mEffects;
53 52
  int[] mName;
54 53
  int[] mAndAssociation;
......
141 140
      if( max>0 )
142 141
        {
143 142
        mUniforms        = new float[max*source.mNumUniforms];
144
        mCurrentDuration = new long[max];
145 143
        mEffects         = new Effect[max];
146 144
        mName            = new int[max];
147 145
        mAndAssociation  = new int[max];
......
151 149
      for(int i=0; i<mNumEffects; i++ )
152 150
        {
153 151
        mEffects[i]         = source.mEffects[i];
154
        mCurrentDuration[i] = source.mCurrentDuration[i];
155 152
        mName[i]            = source.mName[i];
156 153
        mAndAssociation[i]  = source.mAndAssociation[i];
157 154
        mEquAssociation[i]  = source.mEquAssociation[i];
......
281 278
    for(int j=effect; j<mNumEffects; j++ )
282 279
      {
283 280
      mEffects[j]         = mEffects[j+1];
284
      mCurrentDuration[j] = mCurrentDuration[j+1];
285 281
      mName[j]            = mName[j+1];
286 282
      mAndAssociation[j]  = mAndAssociation[j+1];
287 283
      mEquAssociation[j]  = mEquAssociation[j+1];
......
439 435
                     if( max>0 )
440 436
                       {
441 437
                       mUniforms        = new float[max*job.num];
442
                       mCurrentDuration = new long[max];
443 438
                       mEffects         = new Effect[max];
444 439
                       mName            = new int[max];
445 440
                       mAndAssociation  = new int[max];
......
454 449

  
455 450
                       if( position==-1 )
456 451
                         {
457
                         mCurrentDuration[mNumEffects]= 0;
458 452
                         mEffects[mNumEffects]        = job.effect;
459 453
                         mName[mNumEffects]           = job.effect.getName().ordinal();
460 454
                         mAndAssociation[mNumEffects] = job.effect.getAndAssociation();
......
467 461
                         {
468 462
                         for(int j=mNumEffects; j>position; j--)
469 463
                           {
470
                           mCurrentDuration[j] = mCurrentDuration[j-1];
471 464
                           mEffects[j]         = mEffects[j-1];
472 465
                           mName[j]            = mName[j-1];
473 466
                           mAndAssociation[j]  = mAndAssociation[j-1];
474 467
                           mEquAssociation[j]  = mEquAssociation[j-1];
475 468
                           }
476 469

  
477
                         mCurrentDuration[position]= 0;
478 470
                         mEffects[position]        = job.effect;
479 471
                         mName[position]           = job.effect.getName().ordinal();
480 472
                         mAndAssociation[position] = job.effect.getAndAssociation();

Also available in: Unified diff