Project

General

Profile

« Previous | Next » 

Revision 771f6dfa

Added by Leszek Koltunski over 2 years ago

Move actual solving the object to PreRender.

(before we had a 'solveObejct()' in preRender already, but that one just starts the Solve Effect!)

View differences:

src/main/java/org/distorted/main/RubikPreRender.java
56 56
  private final RubikSurfaceView mView;
57 57
  private boolean mFinishRotation, mRemoveRotation, mRemovePatternRotation, mAddRotation,
58 58
                  mSetQuat, mChangeObject, mSetupObject, mSolveObject, mScrambleObject,
59
                  mInitializeObject, mSetTextureMap, mResetAllTextureMaps;
59
                  mInitializeObject, mSetTextureMap, mResetAllTextureMaps, mSolve;
60 60
  private boolean mUIBlocked, mTouchBlocked;
61 61
  private boolean mIsSolved;
62 62
  private ObjectList mNextObject;
......
94 94
    mChangeObject         = false;
95 95
    mSetupObject          = false;
96 96
    mSolveObject          = false;
97
    mSolve                = false;
97 98
    mScrambleObject       = false;
98 99

  
99 100
    mOldObject = null;
......
299 300
    doEffectNow( BaseEffect.Type.SOLVE );
300 301
    }
301 302

  
303
///////////////////////////////////////////////////////////////////////////////////////////////////
304

  
305
  private void solveNow()
306
    {
307
    mSolve = false;
308
    mNewObject.solve();
309
    }
310

  
302 311
///////////////////////////////////////////////////////////////////////////////////////////////////
303 312

  
304 313
  private void initializeObjectNow()
......
599 608

  
600 609
  void preRender()
601 610
    {
611
    if( mSolve                 ) solveNow();
602 612
    if( mSetQuat               ) setQuatNow();
603 613
    if( mFinishRotation        ) finishRotationNow();
604 614
    if( mRemoveRotation        ) removeRotationNow();
......
655 665
    }
656 666

  
657 667
///////////////////////////////////////////////////////////////////////////////////////////////////
668
// this starts the Solve Effect
658 669

  
659 670
  public void solveObject()
660 671
    {
......
664 675
      }
665 676
    }
666 677

  
678
///////////////////////////////////////////////////////////////////////////////////////////////////
679
// this only sets the cubits state to solved
680

  
681
  public void solve()
682
    {
683
    mSolve = true;
684
    }
685

  
667 686
///////////////////////////////////////////////////////////////////////////////////////////////////
668 687

  
669 688
  public void resetAllTextureMaps()

Also available in: Unified diff