Revision 4da7d87a
Added by Leszek Koltunski almost 4 years ago
src/main/java/org/distorted/main/RubikPreRender.java | ||
---|---|---|
45 | 45 |
|
46 | 46 |
private RubikSurfaceView mView; |
47 | 47 |
private boolean mFinishRotation, mRemoveRotation, mRemovePatternRotation, mAddRotation, |
48 |
mSetQuatCurrent, mSetQuatAccumulated, mChangeObject, mSetupObject, mSolveObject,
|
|
49 |
mScrambleObject, mInitializeObject, mSetTextureMap, mResetAllTextureMaps;
|
|
48 |
mSetQuat, mChangeObject, mSetupObject, mSolveObject, mScrambleObject,
|
|
49 |
mInitializeObject, mSetTextureMap, mResetAllTextureMaps; |
|
50 | 50 |
private boolean mCanRotate, mCanPlay; |
51 | 51 |
private boolean mIsSolved; |
52 | 52 |
private RubikObjectList mNextObject; |
... | ... | |
77 | 77 |
mRemoveRotation = false; |
78 | 78 |
mRemovePatternRotation= false; |
79 | 79 |
mAddRotation = false; |
80 |
mSetQuatCurrent = false; |
|
81 |
mSetQuatAccumulated = false; |
|
80 |
mSetQuat = false; |
|
82 | 81 |
mChangeObject = false; |
83 | 82 |
mSetupObject = false; |
84 | 83 |
mSolveObject = false; |
... | ... | |
108 | 107 |
Context con = mView.getContext(); |
109 | 108 |
Resources res = con.getResources(); |
110 | 109 |
|
111 |
mNewObject = object.create(size, mView.getQuatCurrent(), mView.getQuatAccumulated(), moves, res);
|
|
110 |
mNewObject = object.create(size, mView.getQuat(), moves, res); |
|
112 | 111 |
|
113 | 112 |
if( mNewObject!=null ) |
114 | 113 |
{ |
... | ... | |
318 | 317 |
|
319 | 318 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
320 | 319 |
|
321 |
private void setQuatCurrentNow()
|
|
320 |
private void setQuatNow() |
|
322 | 321 |
{ |
323 |
mSetQuatCurrent = false; |
|
324 |
mView.setQuatCurrent(); |
|
325 |
} |
|
326 |
|
|
327 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
328 |
|
|
329 |
private void setQuatAccumulatedNow() |
|
330 |
{ |
|
331 |
mSetQuatAccumulated = false; |
|
332 |
mView.setQuatAccumulated(); |
|
322 |
mSetQuat = false; |
|
323 |
mView.setQuat(); |
|
333 | 324 |
} |
334 | 325 |
|
335 | 326 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
425 | 416 |
|
426 | 417 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
427 | 418 |
|
428 |
void setQuatCurrentOnNextRender() |
|
429 |
{ |
|
430 |
mSetQuatCurrent = true; |
|
431 |
} |
|
432 |
|
|
433 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
434 |
|
|
435 |
void setQuatAccumulatedOnNextRender() |
|
419 |
void setQuatOnNextRender() |
|
436 | 420 |
{ |
437 |
mSetQuatAccumulated = true;
|
|
421 |
mSetQuat = true; |
|
438 | 422 |
} |
439 | 423 |
|
440 | 424 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
441 | 425 |
|
442 | 426 |
void preRender() |
443 | 427 |
{ |
444 |
if( mSetQuatCurrent ) setQuatCurrentNow(); |
|
445 |
if( mSetQuatAccumulated ) setQuatAccumulatedNow(); |
|
428 |
if( mSetQuat ) setQuatNow(); |
|
446 | 429 |
if( mFinishRotation ) finishRotationNow(); |
447 | 430 |
if( mRemoveRotation ) removeRotationNow(); |
448 | 431 |
if( mRemovePatternRotation ) removePatternRotationNow(); |
Also available in: Unified diff
Simplify dragging. Now there's only 1 Quat, rather than the old way with two (Accumulated, Current).