Project

General

Profile

« Previous | Next » 

Revision 5be1059b

Added by Leszek Koltunski almost 5 years ago

Properly remember size of the Cube.

View differences:

src/main/java/org/distorted/magic/RubikActivity.java
83 83
      setContentView(R.layout.main);
84 84
      RubikSurfaceView view = findViewById(R.id.rubikSurfaceView);
85 85
      view.addSizeButtons(this);
86
      view.markButton(view.getRedButton());
86
      view.markButton(RubikSurfaceView.getRedButton());
87 87

  
88 88
      mPicker = findViewById(R.id.rubikNumberPicker);
89 89
      mPicker.setMin(MIN_SCRAMBLE);
src/main/java/org/distorted/magic/RubikRenderer.java
82 82
      mEffectID = new long[BaseEffect.Type.LENGTH];
83 83

  
84 84
      mMesh= new MeshFlat(20,20);
85
      mNextCubeSize = RubikSize.getSize(mView.getRedButton()).getCubeSize();
85
      mNextCubeSize = RubikSize.getSize(RubikSurfaceView.getRedButton()).getCubeSize();
86 86
      }
87 87

  
88 88
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/java/org/distorted/magic/RubikSurfaceView.java
57 57
    private RubikCubeMovement mMovement;
58 58

  
59 59
    private boolean mInScrambleMode;
60
    private int mButton = RubikSize.SIZE3.ordinal();
61 60

  
62 61
    private boolean mDragging, mBeginningRotation, mContinuingRotation;
63 62
    private float mX, mY;
64 63
    private int mScreenWidth, mScreenHeight, mScreenMin;
65 64

  
65
    private static int mButton = RubikSize.SIZE3.ordinal();
66 66
    private static Static4D mQuatCurrent    = new Static4D(0,0,0,1);
67 67
    private static Static4D mQuatAccumulated= new Static4D(-0.25189602f,0.3546389f,0.009657208f,0.90038127f);
68 68
    private static Static4D mTempCurrent    = new Static4D(0,0,0,1);
......
142 142

  
143 143
///////////////////////////////////////////////////////////////////////////////////////////////////
144 144

  
145
    int getRedButton()
145
    static int getRedButton()
146 146
      {
147 147
      return mButton;
148 148
      }
src/main/java/org/distorted/object/RubikCubeMovement.java
28 28

  
29 29
public class RubikCubeMovement
30 30
{
31
    public  final static int NONE   =-1;
31
    private final static int NONE   =-1;
32 32
    private final static int FRONT  = 0;  // has to be 6 consecutive ints
33 33
    private final static int BACK   = 1;  // FRONT ... BOTTOM
34 34
    private final static int LEFT   = 2;  //

Also available in: Unified diff