Revision 408d4676
Added by Leszek Koltunski almost 5 years ago
src/main/java/org/distorted/magic/RubikRenderer.java | ||
---|---|---|
47 | 47 |
private int mNextCubeSize, mScrambleCubeNum; |
48 | 48 |
private long mRotationFinishedID; |
49 | 49 |
private long[] mEffectID; |
50 |
private boolean mFinishRotation, mRemoveRotation, mFinishDragCurrent, mFinishDragAccumulated, mSolveCube, mScrambleCube; |
|
50 |
private boolean mFinishRotation, mRemoveRotation, mFinishDragCurrent, mFinishDragAccumulated; |
|
51 |
private boolean mSizeChangeCube, mSolveCube, mScrambleCube; |
|
51 | 52 |
private boolean mCanRotate, mCanDrag, mCanUI; |
52 | 53 |
private RubikCube mOldCube, mNewCube; |
53 | 54 |
private int mScreenWidth, mScreenHeight; |
... | ... | |
71 | 72 |
mRemoveRotation = false; |
72 | 73 |
mFinishDragCurrent = false; |
73 | 74 |
mFinishDragAccumulated = false; |
75 |
mSizeChangeCube = false; |
|
74 | 76 |
mSolveCube = false; |
75 | 77 |
mScrambleCube = false; |
76 | 78 |
|
... | ... | |
119 | 121 |
mCanRotate = true; |
120 | 122 |
} |
121 | 123 |
|
122 |
if( mNextCubeSize!=0 )
|
|
124 |
if( mSizeChangeCube )
|
|
123 | 125 |
{ |
126 |
mSizeChangeCube = false; |
|
127 |
mCanDrag = false; |
|
128 |
mCanRotate = false; |
|
124 | 129 |
createCubeNow(mNextCubeSize); |
125 |
mCanDrag = false; |
|
126 |
mCanRotate = false; |
|
127 |
mNextCubeSize = 0; |
|
128 | 130 |
doEffectNow(0); |
129 | 131 |
} |
130 | 132 |
|
... | ... | |
231 | 233 |
{ |
232 | 234 |
if( mCanDrag && mCanRotate && (mNewCube==null || newSize != mNewCube.getSize()) ) |
233 | 235 |
{ |
236 |
mSizeChangeCube = true; |
|
234 | 237 |
mNextCubeSize = newSize; |
235 | 238 |
return true; |
236 | 239 |
} |
... | ... | |
291 | 294 |
} |
292 | 295 |
|
293 | 296 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
297 |
// do all 'adjustable' effects (SizeChange, Solve, Scramble) |
|
294 | 298 |
|
295 | 299 |
private void doEffectNow(int index) |
296 | 300 |
{ |
... | ... | |
298 | 302 |
|
299 | 303 |
if( mEffectID[index] == -1 ) |
300 | 304 |
{ |
305 |
mCanUI = true; |
|
301 | 306 |
mCanRotate = true; |
302 | 307 |
mCanDrag = true; |
303 | 308 |
} |
Also available in: Unified diff
RubikCube: small improvements.