Revision 916f5dda
Added by Leszek Koltunski over 3 years ago
src/main/java/org/distorted/effects/scramble/ScrambleEffect.java | ||
---|---|---|
242 | 242 |
{ |
243 | 243 |
disassignEffects(); |
244 | 244 |
|
245 |
if( mNumScramblesLeft==0 ) |
|
246 |
{ |
|
247 |
mPluginReady = true; |
|
248 |
if( mRotReady ) mController.effectFinished(FAKE_EFFECT_ID); |
|
249 |
} |
|
245 |
mPluginReady = true; |
|
246 |
if( mRotReady ) mController.effectFinished(FAKE_EFFECT_ID); |
|
250 | 247 |
} |
251 | 248 |
} |
252 | 249 |
|
src/main/java/org/distorted/tutorials/TutorialPreRender.java | ||
---|---|---|
34 | 34 |
public class TutorialPreRender implements EffectController |
35 | 35 |
{ |
36 | 36 |
private ActionFinishedListener mAddActionListener; |
37 |
private TutorialSurfaceView mView; |
|
37 |
private final TutorialSurfaceView mView;
|
|
38 | 38 |
private boolean mFinishRotation, mRemoveRotation, mAddRotation, |
39 | 39 |
mSetQuat, mChangeObject, mSetupObject, mSolveObject, mScrambleObject, |
40 | 40 |
mInitializeObject, mResetAllTextureMaps, mRemovePatternRotation; |
41 |
private boolean mCanPlay; |
|
41 |
private boolean mCanPlay, mCanRotate;
|
|
42 | 42 |
private boolean mIsSolved; |
43 | 43 |
private ObjectList mNextObject; |
44 | 44 |
private int mNextSize; |
... | ... | |
67 | 67 |
mSolveObject = false; |
68 | 68 |
mScrambleObject = false; |
69 | 69 |
|
70 |
mCanRotate = true; |
|
70 | 71 |
mCanPlay = true; |
71 | 72 |
mOldObject = null; |
72 | 73 |
mNewObject = null; |
... | ... | |
113 | 114 |
} |
114 | 115 |
catch( Exception ex ) |
115 | 116 |
{ |
116 |
mCanPlay= true; |
|
117 |
mCanPlay = true; |
|
118 |
mCanRotate= true; |
|
117 | 119 |
} |
118 | 120 |
} |
119 | 121 |
|
... | ... | |
171 | 173 |
|
172 | 174 |
if( mAddRotationID==0 ) // failed to add effect - should never happen |
173 | 175 |
{ |
174 |
mCanPlay = true; |
|
176 |
mCanPlay = true; |
|
177 |
mCanRotate= true; |
|
175 | 178 |
} |
176 | 179 |
} |
177 | 180 |
|
... | ... | |
236 | 239 |
{ |
237 | 240 |
mScrambleObject = false; |
238 | 241 |
mCanPlay = false; |
242 |
mCanRotate = false; |
|
239 | 243 |
mIsSolved = false; |
240 |
RubikScores.getInstance().incrementNumPlays(); |
|
244 |
|
|
241 | 245 |
doEffectNow( BaseEffect.Type.SCRAMBLE ); |
242 | 246 |
} |
243 | 247 |
|
... | ... | |
342 | 346 |
|
343 | 347 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
344 | 348 |
|
345 |
public void initializeObject(int[][] moves)
|
|
349 |
boolean canRotate()
|
|
346 | 350 |
{ |
347 |
mInitializeObject = true; |
|
348 |
mNextMoves = moves; |
|
351 |
return mCanRotate; |
|
349 | 352 |
} |
350 | 353 |
|
351 | 354 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
415 | 418 |
else |
416 | 419 |
{ |
417 | 420 |
mCanPlay = true; |
421 |
mCanRotate = true; |
|
418 | 422 |
} |
419 | 423 |
} |
420 | 424 |
} |
src/main/java/org/distorted/tutorials/TutorialState.java | ||
---|---|---|
46 | 46 |
|
47 | 47 |
private static class Move |
48 | 48 |
{ |
49 |
private int mAxis, mRow, mAngle; |
|
49 |
private final int mAxis, mRow, mAngle;
|
|
50 | 50 |
|
51 | 51 |
Move(int axis, int row, int angle) |
52 | 52 |
{ |
src/main/java/org/distorted/tutorials/TutorialSurfaceView.java | ||
---|---|---|
70 | 70 |
private int mFirstIndex, mLastIndex; |
71 | 71 |
private int mDensity; |
72 | 72 |
|
73 |
private static Static4D mQuat= new Static4D(-0.25189602f,0.3546389f,0.009657208f,0.90038127f); |
|
74 |
private static Static4D mTemp= new Static4D(0,0,0,1); |
|
73 |
private static final Static4D mQuat= new Static4D(-0.25189602f,0.3546389f,0.009657208f,0.90038127f);
|
|
74 |
private static final Static4D mTemp= new Static4D(0,0,0,1);
|
|
75 | 75 |
|
76 | 76 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
77 | 77 |
|
... | ... | |
293 | 293 |
{ |
294 | 294 |
mDragging = false; |
295 | 295 |
mContinuingRotation = false; |
296 |
mBeginningRotation = true;
|
|
296 |
mBeginningRotation = mPreRender.canRotate();
|
|
297 | 297 |
} |
298 | 298 |
else |
299 | 299 |
{ |
Also available in: Unified diff
Bugfix: make it impossible to rotate a cube when it is being scrambled in the Tutorial mode.