Project

General

Profile

« Previous | Next » 

Revision 476bbc81

Added by Leszek Koltunski almost 8 years ago

Bugfix for removeByType

View differences:

src/main/java/org/distorted/library/DistortedObject.java
386 386
 * Aborts a single Effect.
387 387
 * 
388 388
 * @param id ID of the Effect we want to abort.
389
 * @return <code>true</code> if the Effect was found and successfully aborted.
389
 * @return number of Effects aborted. Always either 0 or 1.
390 390
 */
391
    public boolean abortEffect(long id)
391
    public int abortEffect(long id)
392 392
      {
393 393
      int type = (int)(id&EffectTypes.MASK);
394 394

  
395
      if( type==EffectTypes.MATRIX.type   )  return mM.removeByID(id>>EffectTypes.LENGTH);
396
      if( type==EffectTypes.VERTEX.type   )  return mV.removeByID(id>>EffectTypes.LENGTH);
397
      if( type==EffectTypes.FRAGMENT.type )  return mF.removeByID(id>>EffectTypes.LENGTH);
398
      if( type==EffectTypes.OTHER.type    )  return mO.removeByID(id>>EffectTypes.LENGTH);
395
      if( type==EffectTypes.MATRIX.type   ) return mM.removeByID(id>>EffectTypes.LENGTH);
396
      if( type==EffectTypes.VERTEX.type   ) return mV.removeByID(id>>EffectTypes.LENGTH);
397
      if( type==EffectTypes.FRAGMENT.type ) return mF.removeByID(id>>EffectTypes.LENGTH);
398
      if( type==EffectTypes.OTHER.type    ) return mO.removeByID(id>>EffectTypes.LENGTH);
399 399

  
400
      return false;
400
      return 0;
401 401
      }
402 402

  
403 403
///////////////////////////////////////////////////////////////////////////////////////////////////
......
405 405
 * Abort all Effects of a given type, for example all rotations.
406 406
 * 
407 407
 * @param name one of the constants defined in {@link EffectNames}
408
 * @return <code>true</code> if a single Effect of type effectType has been found and aborted. 
408
 * @return number of Effects aborted.
409 409
 */
410
    public boolean abortEffects(EffectNames name)
410
    public int abortEffects(EffectNames name)
411 411
      {
412 412
      switch(name.getType())
413 413
        {
......
415 415
        case VERTEX  : return mV.removeByType(name);
416 416
        case FRAGMENT: return mF.removeByType(name);
417 417
        case OTHER   : return mO.removeByType(name);
418
        default      : return false;
418
        default      : return 0;
419 419
        }
420 420
      }
421 421
    

Also available in: Unified diff