Project

General

Profile

« Previous | Next » 

Revision e8205412

Added by Leszek Koltunski about 3 years ago

Simplify TwistyObject's API.

View differences:

src/main/java/org/distorted/main/RubikPreRender.java
128 128

  
129 129
    if( mNewObject!=null )
130 130
      {
131
      mNewObject.createTexture();
132 131
      mView.setMovement(mNewObject.getMovement());
133 132
      if( firstTime ) mNewObject.restorePreferences(mPreferences);
134 133
      mIsSolved = mNewObject.isSolved();
......
461 460

  
462 461
  void setScreenSize(int width)
463 462
    {
464
    if( mNewObject!=null )
465
      {
466
      mNewObject.createTexture();
467
      mNewObject.recomputeScaleFactor(width);
468
      }
469

  
470
    mScreenWidth  = width;
463
    if( mNewObject!=null ) mNewObject.recomputeScaleFactor(width);
464
    mScreenWidth = width;
471 465
    }
472 466

  
473 467
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/java/org/distorted/tutorials/TutorialPreRender.java
96 96

  
97 97
    if( mNewObject!=null )
98 98
      {
99
      mNewObject.createTexture();
100 99
      mView.setMovement(mNewObject.getMovement());
101 100
      mIsSolved = mNewObject.isSolved();
102 101
      }
......
272 271

  
273 272
  void setScreenSize(int width)
274 273
    {
275
    if( mNewObject!=null )
276
      {
277
      mNewObject.createTexture();
278
      mNewObject.recomputeScaleFactor(width);
279
      }
280

  
281
    mScreenWidth  = width;
274
    if( mNewObject!=null ) mNewObject.recomputeScaleFactor(width);
275
    mScreenWidth = width;
282 276
    }
283 277

  
284 278
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff