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/tutorials/TutorialPreRender.java
38 38
  private final TutorialSurfaceView mView;
39 39
  private boolean mFinishRotation, mRemoveRotation, mAddRotation,
40 40
                  mSetQuat, mChangeObject, mSetupObject, mSolveObject, mScrambleObject,
41
                  mInitializeObject, mResetAllTextureMaps, mRemovePatternRotation;
41
                  mInitializeObject, mResetAllTextureMaps, mRemovePatternRotation, mSolve;
42 42
  private boolean mUIBlocked, mTouchBlocked;
43 43
  private boolean mIsSolved;
44 44
  private ObjectList mNextObject;
......
66 66
    mChangeObject   = false;
67 67
    mSetupObject    = false;
68 68
    mSolveObject    = false;
69
    mSolve          = false;
69 70
    mScrambleObject = false;
70 71

  
71 72
    mOldObject      = null;
......
238 239
    doEffectNow( BaseEffect.Type.SOLVE );
239 240
    }
240 241

  
242
///////////////////////////////////////////////////////////////////////////////////////////////////
243

  
244
  private void solveNow()
245
    {
246
    mSolve = false;
247
    mNewObject.solve();
248
    }
249

  
241 250
///////////////////////////////////////////////////////////////////////////////////////////////////
242 251

  
243 252
  private void initializeObjectNow()
......
309 318

  
310 319
  void preRender()
311 320
    {
321
    if( mSolve                 ) solveNow();
312 322
    if( mSetQuat               ) setQuatNow();
313 323
    if( mFinishRotation        ) finishRotationNow();
314 324
    if( mRemoveRotation        ) removeRotationNow();
......
403 413
    }
404 414

  
405 415
///////////////////////////////////////////////////////////////////////////////////////////////////
416
// this starts the SolveEffect
406 417

  
407 418
  public void solveObject()
408 419
    {
......
412 423
      }
413 424
    }
414 425

  
426
///////////////////////////////////////////////////////////////////////////////////////////////////
427
// this only solves the object
428

  
429
  public void solve()
430
    {
431
    mSolve = true;
432
    }
433

  
415 434
///////////////////////////////////////////////////////////////////////////////////////////////////
416 435

  
417 436
  public void scrambleObject(int num)

Also available in: Unified diff