Project

General

Profile

« Previous | Next » 

Revision 568d4698

Added by Leszek Koltunski over 2 years ago

New API to objectlib to recreate an already displayed object (because the settings, like 'IconMode' might have changed) and using the new API in puzzle-creator.

View differences:

src/main/java/org/distorted/objectlib/main/ObjectPreRender.java
50 50
  private float mMoveX, mMoveY;
51 51

  
52 52
  private boolean mFinishRotation, mRemoveRotation, mRemovePatternRotation, mAddRotation,
53
                  mSetQuat, mChangeObject, mSolveObject, mScrambleObject,
53
                  mSetQuat, mChangeObject, mSolveObject, mScrambleObject, mRecreateObject,
54 54
                  mInitializeObject, mSetTextureMap, mResetAllTextureMaps, mSolve;
55 55
  private boolean mUIBlocked, mTouchBlocked, mIsSolved;
56 56
  private long mRotationFinishedID;
......
79 79
    mAddRotation          = false;
80 80
    mSetQuat              = false;
81 81
    mChangeObject         = false;
82
    mRecreateObject       = false;
82 83
    mSolveObject          = false;
83 84
    mSolve                = false;
84 85
    mScrambleObject       = false;
......
223 224
      }
224 225
    }
225 226

  
227
///////////////////////////////////////////////////////////////////////////////////////////////////
228

  
229
  private void recreateObjectNow()
230
    {
231
    mRecreateObject = false;
232

  
233
    if ( mNewObject!=null )
234
      {
235
      blockEverything(BlockController.PLACE_1);
236
      createObjectNow(mNewObject.getObjectType());
237
      doEffectNow( BaseEffect.Type.SIZECHANGE );
238
      }
239
    }
240

  
226 241
///////////////////////////////////////////////////////////////////////////////////////////////////
227 242

  
228 243
  private void scrambleObjectNow()
......
393 408
    mNextObject = object;
394 409
    }
395 410

  
411
///////////////////////////////////////////////////////////////////////////////////////////////////
412

  
413
  public void recreateObject()
414
    {
415
    mRecreateObject = true;
416
    }
417

  
396 418
///////////////////////////////////////////////////////////////////////////////////////////////////
397 419

  
398 420
  public boolean isTouchBlocked()
......
461 483
    if( mRemoveRotation        ) removeRotationNow();
462 484
    if( mRemovePatternRotation ) removePatternRotationNow();
463 485
    if( mChangeObject          ) changeObjectNow();
486
    if( mRecreateObject        ) recreateObjectNow();
464 487
    if( mSolveObject           ) solveObjectNow();
465 488
    if( mScrambleObject        ) scrambleObjectNow();
466 489
    if( mAddRotation           ) addRotationNow();

Also available in: Unified diff