Project

General

Profile

« Previous | Next » 

Revision 168b6b56

Added by Leszek Koltunski almost 4 years ago

Improvements for the way we rotate layers of Objects. (take the speed into account - so even if we rotated a layer of a Cube to less than 45 degrees, but we did it fast, do a 90 degree rotation!)

View differences:

src/main/java/org/distorted/main/RubikPreRender.java
65 65
  private ActionFinishedListener mAddActionListener;
66 66
  private long mAddRotationID, mRemoveRotationID;
67 67
  private int mCubit, mFace, mNewColor;
68
  private int mNearestAngle;
68 69

  
69 70
///////////////////////////////////////////////////////////////////////////////////////////////////
70 71

  
......
224 225
    mFinishRotation = false;
225 226
    mCanRotate      = false;
226 227
    mCanPlay        = false;
227
    mRotationFinishedID = mNewObject.finishRotationNow(this);
228
    mRotationFinishedID = mNewObject.finishRotationNow(this, mNearestAngle);
228 229

  
229 230
    if( mRotationFinishedID==0 ) // failed to add effect - should never happen
230 231
      {
......
366 367

  
367 368
///////////////////////////////////////////////////////////////////////////////////////////////////
368 369

  
369
  void finishRotation()
370
  void finishRotation(int nearestAngle)
370 371
    {
372
    mNearestAngle   = nearestAngle;
371 373
    mFinishRotation = true;
372 374
    }
373 375

  

Also available in: Unified diff