Project

General

Profile

« Previous | Next » 

Revision 2df35810

Added by Leszek Koltunski over 2 years ago

Simplifications

View differences:

src/main/java/org/distorted/objectlib/effects/scramble/ScrambleEffect.java
70 70
  private EffectController mController;
71 71
  private int mEffectReturned;
72 72
  private int mNumScramblesLeft;
73
  private long mDurationPerDegree;
73
  private int mDurationPerDegree;
74 74
  private final Random mRnd;
75 75
  private int[] mBasicAngle;
76 76
  private boolean mRotReady, mPluginReady;
......
133 133
      int row  = mScrambles[mNumScrambles][1];
134 134
      int angle= mScrambles[mNumScrambles][2];
135 135

  
136
      int rowBitmap= (1<<row);
137
      int absAngle = (angle<0 ? -angle : angle);
138
      int basicDegrees  = 360/mBasicAngle[axis];
139
      long durationMillis = absAngle*basicDegrees*mDurationPerDegree;
140

  
141 136
      mNumScramblesLeft--;
142
      mController.addRotation(this, axis, rowBitmap, angle*basicDegrees, durationMillis);
137
      mController.addRotation(this, axis, (1<<row), angle, mDurationPerDegree);
143 138
      mNumScrambles++;
144 139
      }
145 140
    else

Also available in: Unified diff