Project

General

Profile

« Previous | Next » 

Revision e4f656d1

Added by Leszek Koltunski about 3 years ago

Simplifications

View differences:

src/main/java/org/distorted/helpers/MovesController.java
97 97
        {
98 98
        Move move   = mMoves.remove(numMoves-1);
99 99
        int axis    = move.mAxis;
100
        int row     = (1<<move.mRow);
101 100
        int angle   = move.mAngle;
102
        int duration= Math.abs(angle)*MILLIS_PER_DEGREE;
103 101

  
104 102
        if( angle!=0 )
105 103
          {
106 104
          mCanPrevMove = false;
107 105
          mControl = act.getControl();
108 106
          mControl.blockTouch(BlockController.MOVES_PLACE_0);
109
          mControl.addRotation(this, axis, row, -angle, duration);
107
          mControl.addRotation(this, axis, (1<<move.mRow), -angle, MILLIS_PER_DEGREE);
110 108
          }
111 109
        else
112 110
          {
src/main/java/org/distorted/main/RubikActivity.java
415 415

  
416 416
        if( oldObject!=null )
417 417
          {
418
          ObjectType oldList = oldObject.getObjectType();
418
          ObjectType oldType = oldObject.getObjectType();
419 419
          float fps = view.getRenderer().getFPS();
420 420
          fps = (int)(fps+0.5f);
421 421
          StringBuilder name = new StringBuilder();
422
          name.append(oldList.name());
422
          name.append(oldType.name());
423 423
          name.append(' ');
424 424
          name.append(fps);
425 425
          name.append(" --> ");
src/main/java/org/distorted/patterns/RubikPattern.java
335 335
          int axis      = moves[curMove-1][0];
336 336
		      int rowBitmap = moves[curMove-1][1];
337 337
		      int bareAngle = moves[curMove-1][2];
338
		      int basicAngle= control.getObject().getBasicAngle()[axis];
339
          int angle     = bareAngle*(360/basicAngle);
340
          int duration  = Math.abs(angle)*MILLIS_PER_DEGREE;
341 338

  
342
          if( angle!=0 )
339
          if( bareAngle!=0 )
343 340
            {
344 341
            mCanRotate = false;
345
            control.addRotation(this, axis, rowBitmap, angle, duration);
342
            control.addRotation(this, axis, rowBitmap, bareAngle, MILLIS_PER_DEGREE);
346 343
            }
347 344
          else
348 345
            {
......
376 373
          int axis      = moves[curMove][0];
377 374
		      int rowBitmap = moves[curMove][1];
378 375
		      int bareAngle = moves[curMove][2];
379
		      int basicAngle= control.getObject().getBasicAngle()[axis];
380
          int angle     = bareAngle*(360/basicAngle);
381
          int duration  = Math.abs(angle)*MILLIS_PER_DEGREE;
382 376

  
383
          if( angle!=0 )
377
          if( bareAngle!=0 )
384 378
            {
385 379
            mCanRotate = false;
386
            control.addRotation(this, axis, rowBitmap, -angle, duration);
380
            control.addRotation(this, axis, rowBitmap, -bareAngle, MILLIS_PER_DEGREE);
387 381
            }
388 382
          else
389 383
            {
src/main/java/org/distorted/screens/RubikScreenSolution.java
203 203
        int axis      = mMoves[mCurrMove-1][0];
204 204
		    int rowBitmap = mMoves[mCurrMove-1][1];
205 205
		    int bareAngle = mMoves[mCurrMove-1][2];
206
		    int basicAngle= control.getObject().getBasicAngle()[axis];
207
        int angle     = bareAngle*(360/basicAngle);
208
        int duration  = Math.abs(angle)*MILLIS_PER_DEGREE;
209 206

  
210
        if( angle!=0 )
207
        if( bareAngle!=0 )
211 208
          {
212 209
          mCanRotate = false;
213
          control.addRotation(this, axis, rowBitmap, angle, duration);
210
          control.addRotation(this, axis, rowBitmap, bareAngle, MILLIS_PER_DEGREE);
214 211
          }
215 212
        else
216 213
          {
......
242 239
        int axis      = mMoves[mCurrMove][0];
243 240
		    int rowBitmap = mMoves[mCurrMove][1];
244 241
		    int bareAngle = mMoves[mCurrMove][2];
245
        int basicAngle= control.getObject().getBasicAngle()[axis];
246
        int angle     = bareAngle*(360/basicAngle);
247
        int duration  = Math.abs(angle)*MILLIS_PER_DEGREE;
248 242

  
249
        if( angle!=0 )
243
        if( bareAngle!=0 )
250 244
          {
251 245
          mCanRotate = false;
252
          control.addRotation(this, axis, rowBitmap, -angle, duration);
246
          control.addRotation(this, axis, rowBitmap, -bareAngle, MILLIS_PER_DEGREE);
253 247
          }
254 248
        else
255 249
          {

Also available in: Unified diff